diff options
Diffstat (limited to 'ipc/shm.c')
-rw-r--r-- | ipc/shm.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -752,9 +752,10 @@ asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf) | |||
752 | goto out_unlock; | 752 | goto out_unlock; |
753 | 753 | ||
754 | if (!capable(CAP_IPC_LOCK)) { | 754 | if (!capable(CAP_IPC_LOCK)) { |
755 | uid_t euid = current_euid(); | ||
755 | err = -EPERM; | 756 | err = -EPERM; |
756 | if (current->euid != shp->shm_perm.uid && | 757 | if (euid != shp->shm_perm.uid && |
757 | current->euid != shp->shm_perm.cuid) | 758 | euid != shp->shm_perm.cuid) |
758 | goto out_unlock; | 759 | goto out_unlock; |
759 | if (cmd == SHM_LOCK && | 760 | if (cmd == SHM_LOCK && |
760 | !current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur) | 761 | !current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur) |