mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
take security_mmap_file() outside of ->mmap_sem
Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
e5467859f7
commit
8b3ec6814c
5 changed files with 62 additions and 28 deletions
|
|
@ -1036,6 +1036,10 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
|
|||
sfd->file = shp->shm_file;
|
||||
sfd->vm_ops = NULL;
|
||||
|
||||
err = security_mmap_file(file, prot, flags);
|
||||
if (err)
|
||||
goto out_fput;
|
||||
|
||||
down_write(¤t->mm->mmap_sem);
|
||||
if (addr && !(shmflg & SHM_REMAP)) {
|
||||
err = -EINVAL;
|
||||
|
|
@ -1058,6 +1062,7 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
|
|||
invalid:
|
||||
up_write(¤t->mm->mmap_sem);
|
||||
|
||||
out_fput:
|
||||
fput(file);
|
||||
|
||||
out_nattch:
|
||||
|
|
|
|||
Loading…
Reference in a new issue