X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=ipc%2Fshm.c;h=13282510bc0da71aa9789ff72ba015bede5c96e7;hb=138e996c214b83a8bcc730cb9e52584b278f5204;hp=331fc1b0b3c7952110f0223d741fc4fa19881d70;hpb=e7c8e54440bcae3f883ca8801f6558fe29bf0198;p=deliverable%2Flinux.git diff --git a/ipc/shm.c b/ipc/shm.c index 331fc1b0b3c7..13282510bc0d 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -1200,7 +1200,11 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr, if (err) goto out_fput; - down_write(¤t->mm->mmap_sem); + if (down_write_killable(¤t->mm->mmap_sem)) { + err = -EINTR; + goto out_fput; + } + if (addr && !(shmflg & SHM_REMAP)) { err = -EINVAL; if (addr + size < addr) @@ -1271,7 +1275,8 @@ SYSCALL_DEFINE1(shmdt, char __user *, shmaddr) if (addr & ~PAGE_MASK) return retval; - down_write(&mm->mmap_sem); + if (down_write_killable(&mm->mmap_sem)) + return -EINTR; /* * This function tries to be smart and unmap shm segments that