mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
ipc: use rlimit helpers
Make sure compiler won't do weird things with limits. E.g. fetching them
twice may return 2 different values after writable limits are implemented.
I.e. either use rlimit helpers added in
3e10e716ab ("resource: add helpers for
fetching rlimits") or ACCESS_ONCE if not applicable.
Signed-off-by: Jiri Slaby <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
d6db2ade10
commit
f1eb1332b8
2 changed files with 2 additions and 3 deletions
|
|
@ -764,8 +764,7 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf)
|
|||
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)
|
||||
if (cmd == SHM_LOCK && !rlimit(RLIMIT_MEMLOCK))
|
||||
goto out_unlock;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue