aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
Diffstat (limited to 'ipc')
-rw-r--r--ipc/shm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ipc/shm.c b/ipc/shm.c
index 406c5b208193..e3a8063b1768 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -1036,6 +1036,10 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
1036 sfd->file = shp->shm_file; 1036 sfd->file = shp->shm_file;
1037 sfd->vm_ops = NULL; 1037 sfd->vm_ops = NULL;
1038 1038
1039 err = security_mmap_file(file, prot, flags);
1040 if (err)
1041 goto out_fput;
1042
1039 down_write(&current->mm->mmap_sem); 1043 down_write(&current->mm->mmap_sem);
1040 if (addr && !(shmflg & SHM_REMAP)) { 1044 if (addr && !(shmflg & SHM_REMAP)) {
1041 err = -EINVAL; 1045 err = -EINVAL;
@@ -1058,6 +1062,7 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
1058invalid: 1062invalid:
1059 up_write(&current->mm->mmap_sem); 1063 up_write(&current->mm->mmap_sem);
1060 1064
1065out_fput:
1061 fput(file); 1066 fput(file);
1062 1067
1063out_nattch: 1068out_nattch: