mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
CRED: Wrap task credential accesses in the SYSV IPC subsystem
Wrap access to task credentials so that they can be separated more easily from the task_struct during the introduction of COW creds. Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id(). Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more sense to use RCU directly rather than a convenient wrapper; these will be addressed by later patches. Signed-off-by: David Howells <[email protected]> Reviewed-by: James Morris <[email protected]> Acked-by: Serge Hallyn <[email protected]> Signed-off-by: James Morris <[email protected]>
This commit is contained in:
parent
da9592edeb
commit
414c0708d0
3 changed files with 19 additions and 10 deletions
|
|
@ -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)) {
|
||||
uid_t euid = current_euid();
|
||||
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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue