diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mmap.c | 4 | ||||
-rw-r--r-- | mm/shmem.c | 2 |
2 files changed, 6 insertions, 0 deletions
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/fs.h> | 20 | #include <linux/fs.h> |
21 | #include <linux/personality.h> | 21 | #include <linux/personality.h> |
22 | #include <linux/security.h> | 22 | #include <linux/security.h> |
23 | #include <linux/ima.h> | ||
23 | #include <linux/hugetlb.h> | 24 | #include <linux/hugetlb.h> |
24 | #include <linux/profile.h> | 25 | #include <linux/profile.h> |
25 | #include <linux/module.h> | 26 | #include <linux/module.h> |
@@ -1052,6 +1053,9 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, | |||
1052 | error = security_file_mmap(file, reqprot, prot, flags, addr, 0); | 1053 | error = security_file_mmap(file, reqprot, prot, flags, addr, 0); |
1053 | if (error) | 1054 | if (error) |
1054 | return error; | 1055 | return error; |
1056 | error = ima_file_mmap(file, prot); | ||
1057 | if (error) | ||
1058 | return error; | ||
1055 | 1059 | ||
1056 | return mmap_region(file, addr, len, flags, vm_flags, pgoff, | 1060 | return mmap_region(file, addr, len, flags, vm_flags, pgoff, |
1057 | accountable); | 1061 | accountable); |
diff --git a/mm/shmem.c b/mm/shmem.c index 19d566ccdeea..75199888a6bd 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -59,6 +59,7 @@ static struct vfsmount *shm_mnt; | |||
59 | #include <linux/highmem.h> | 59 | #include <linux/highmem.h> |
60 | #include <linux/seq_file.h> | 60 | #include <linux/seq_file.h> |
61 | #include <linux/magic.h> | 61 | #include <linux/magic.h> |
62 | #include <linux/ima.h> | ||
62 | 63 | ||
63 | #include <asm/uaccess.h> | 64 | #include <asm/uaccess.h> |
64 | #include <asm/div64.h> | 65 | #include <asm/div64.h> |
@@ -2666,6 +2667,7 @@ int shmem_zero_setup(struct vm_area_struct *vma) | |||
2666 | if (IS_ERR(file)) | 2667 | if (IS_ERR(file)) |
2667 | return PTR_ERR(file); | 2668 | return PTR_ERR(file); |
2668 | 2669 | ||
2670 | ima_shm_check(file); | ||
2669 | if (vma->vm_file) | 2671 | if (vma->vm_file) |
2670 | fput(vma->vm_file); | 2672 | fput(vma->vm_file); |
2671 | vma->vm_file = file; | 2673 | vma->vm_file = file; |