Re: [PATCH] shmtcl SHM_LOCK perms

From: Hugh Dickins
Date: Tue Nov 30 2004 - 20:13:23 EST


On Tue, 30 Nov 2004, Chris Wright wrote:
> * Hugh Dickins (hugh@xxxxxxxxxxx) wrote:
> > Michael Kerrisk has observed that at present any process can SHM_LOCK
> > any shm segment of size within process RLIMIT_MEMLOCK, despite having no
> > permissions on the segment: surprising, though not obviously evil. And
> > any process can SHM_UNLOCK any shm segment, despite no permissions on it:
> > that is surely wrong.
>
> You may be neither the owner, nor the creator of a segment but have read
> access to it. In which case you could simply copy the contents of the
> segment anywhere you like, which has similar effect to SHM_UNLOCK from
> the point of view of paging out sensitive data.

True, and if securing sensitive data against pageout were the only reason
for SHM_LOCK, then I guess it might be an argument for letting anyone with
read permission do SHM_UNLOCK.

But that's not the only reason for SHM_LOCK, and all you're telling us
there is that the owner of sensitive data should be careful who they
give read permission to - indeed! So I still tend to agree with
Michael, that the most natural restriction is to owner or creator -
relax that if some app actually has a good case for relaxing it.

Hugh

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/