git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CRED: Wrap task credential accesses in the SYSV IPC subsystem
[safe/jmp/linux-2.6]
/
ipc
/
shm.c
diff --git
a/ipc/shm.c
b/ipc/shm.c
index
867e5d6
..
0c3debb
100644
(file)
--- a/
ipc/shm.c
+++ b/
ipc/shm.c
@@
-752,9
+752,10
@@
asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf)
goto out_unlock;
if (!capable(CAP_IPC_LOCK)) {
goto out_unlock;
if (!capable(CAP_IPC_LOCK)) {
+ uid_t euid = current_euid();
err = -EPERM;
err = -EPERM;
- if (
current->
euid != shp->shm_perm.uid &&
-
current->
euid != shp->shm_perm.cuid)
+ if (euid != shp->shm_perm.uid &&
+ euid != shp->shm_perm.cuid)
goto out_unlock;
if (cmd == SHM_LOCK &&
!current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur)
goto out_unlock;
if (cmd == SHM_LOCK &&
!current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur)