5 #include <linux/module.h>
6 #include <linux/swap.h>
7 +#include <linux/ima.h>
9 static struct vfsmount *shm_mnt;
11 @@ -2620,6 +2621,16 @@ int shmem_lock(struct file *file, int lo
15 +void shmem_set_file(struct vm_area_struct *vma, struct file *file)
17 + ima_counts_get(file);
20 + vma->vm_file = file;
21 + vma->vm_ops = &shmem_vm_ops;
23 +EXPORT_SYMBOL_GPL(shmem_set_file);
26 * shmem_file_setup - get an unlinked file living in tmpfs
27 * @name: name for dentry (to be seen in /proc/<pid>/maps
28 @@ -2697,9 +2708,6 @@ int shmem_zero_setup(struct vm_area_stru
34 - vma->vm_file = file;
35 - vma->vm_ops = &shmem_vm_ops;
36 + shmem_set_file(vma, file);
41 @@ -271,6 +271,7 @@ int expand_files(struct files_struct *fi
42 /* All good, so we try */
43 return expand_fdtable(files, nr);
45 +EXPORT_SYMBOL_GPL(expand_files);
47 static int count_open_files(struct fdtable *fdt)
51 @@ -508,6 +508,7 @@ struct files_struct *get_files_struct(st
55 +EXPORT_SYMBOL_GPL(get_files_struct);
57 void put_files_struct(struct files_struct *files)
59 @@ -527,6 +528,7 @@ void put_files_struct(struct files_struc
63 +EXPORT_SYMBOL_GPL(put_files_struct);
65 void reset_files_struct(struct files_struct *files)
69 @@ -169,6 +169,7 @@ void __put_task_struct(struct task_struc
70 if (!profile_handoff_task(tsk))
73 +EXPORT_SYMBOL_GPL(__put_task_struct);
76 * macro override instead of weak attribute alias, to workaround
79 @@ -6149,6 +6149,7 @@ int can_nice(const struct task_struct *p
80 return (nice_rlim <= p->signal->rlim[RLIMIT_NICE].rlim_cur ||
81 capable(CAP_SYS_NICE));
83 +EXPORT_SYMBOL_GPL(can_nice);
85 #ifdef __ARCH_WANT_SYS_NICE
89 @@ -1115,6 +1115,7 @@ unsigned long zap_page_range(struct vm_a
90 tlb_finish_mmu(tlb, address, end);
93 +EXPORT_SYMBOL_GPL(zap_page_range);
96 * zap_vma_ptes - remove ptes mapping the vma
97 @@ -2501,6 +2502,7 @@ int vmtruncate_range(struct inode *inode
101 +EXPORT_SYMBOL_GPL(vmtruncate_range);
104 * We enter with non-exclusive mmap_sem (to exclude vma changes,
107 @@ -1173,6 +1173,7 @@ void unmap_kernel_range(unsigned long ad
108 vunmap_page_range(addr, end);
109 flush_tlb_kernel_range(addr, end);
111 +EXPORT_SYMBOL_GPL(unmap_kernel_range);
113 int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page ***pages)
115 @@ -1288,6 +1289,7 @@ struct vm_struct *get_vm_area(unsigned l
116 return __get_vm_area_node(size, 1, flags, VMALLOC_START, VMALLOC_END,
117 -1, GFP_KERNEL, __builtin_return_address(0));
119 +EXPORT_SYMBOL_GPL(get_vm_area);
121 struct vm_struct *get_vm_area_caller(unsigned long size, unsigned long flags,
123 --- a/include/linux/mm.h
124 +++ b/include/linux/mm.h
125 @@ -725,6 +725,7 @@ extern void show_free_areas(void);
127 int shmem_lock(struct file *file, int lock, struct user_struct *user);
128 struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags);
129 +void shmem_set_file(struct vm_area_struct *vma, struct file *file);
130 int shmem_zero_setup(struct vm_area_struct *);
133 --- a/kernel/signal.c
134 +++ b/kernel/signal.c
135 @@ -1104,6 +1104,7 @@ struct sighand_struct *lock_task_sighand
139 +EXPORT_SYMBOL(lock_task_sighand);
142 * send signal info to all the members of a group