[lkml]   [2013]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2/4] ipc,shm: prevent race with rmid in shmat(2)
Hi Davidlohr,

On 09/16/2013 05:04 AM, Davidlohr Bueso wrote:
> This fixes a race in shmat() between finding the msq and
> actually attaching the segment, as another thread can delete shmid
> underneath us if we are preempted before acquiring the kern_ipc_perm.lock.
According the the man page, Linux supports attaching to deleted shm
> On Linux, it is possible to attach a shared memory segment even if it
> is already marked to be deleted. However, POSIX.1-2001 does not
> specify this behavior and many other implementations do not support it.
Does your patch change that?
Unfortunately, I have neither any experience with ipc/shm nor any test

As far as I can see it's not a problem if we are attaching to a deleted
segment: shm_close cleans up everything.


 \ /
  Last update: 2013-09-27 08:21    [W:0.118 / U:1.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site