@@ -87,9 +87,8 @@ extern int cap_inode_removexattr(struct dentry *dentry, const char *name);
8787extern int cap_inode_need_killpriv (struct dentry * dentry );
8888extern int cap_inode_killpriv (struct dentry * dentry );
8989extern int cap_mmap_addr (unsigned long addr );
90- extern int cap_file_mmap (struct file * file , unsigned long reqprot ,
91- unsigned long prot , unsigned long flags ,
92- unsigned long addr , unsigned long addr_only );
90+ extern int cap_mmap_file (struct file * file , unsigned long reqprot ,
91+ unsigned long prot , unsigned long flags );
9392extern int cap_task_fix_setuid (struct cred * new , const struct cred * old , int flags );
9493extern int cap_task_prctl (int option , unsigned long arg2 , unsigned long arg3 ,
9594 unsigned long arg4 , unsigned long arg5 );
@@ -587,15 +586,17 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
587586 * simple integer value. When @arg represents a user space pointer, it
588587 * should never be used by the security module.
589588 * Return 0 if permission is granted.
590- * @file_mmap :
589+ * @mmap_addr :
590+ * Check permissions for a mmap operation at @addr.
591+ * @addr contains virtual address that will be used for the operation.
592+ * Return 0 if permission is granted.
593+ * @mmap_file :
591594 * Check permissions for a mmap operation. The @file may be NULL, e.g.
592595 * if mapping anonymous memory.
593596 * @file contains the file structure for file to map (may be NULL).
594597 * @reqprot contains the protection requested by the application.
595598 * @prot contains the protection that will be applied by the kernel.
596599 * @flags contains the operational flags.
597- * @addr contains virtual address that will be used for the operation.
598- * @addr_only contains a boolean: 0 if file-backed VMA, otherwise 1.
599600 * Return 0 if permission is granted.
600601 * @file_mprotect:
601602 * Check permissions before changing memory access permissions.
@@ -1482,10 +1483,10 @@ struct security_operations {
14821483 void (* file_free_security ) (struct file * file );
14831484 int (* file_ioctl ) (struct file * file , unsigned int cmd ,
14841485 unsigned long arg );
1485- int (* file_mmap ) (struct file * file ,
1486+ int (* mmap_addr ) (unsigned long addr );
1487+ int (* mmap_file ) (struct file * file ,
14861488 unsigned long reqprot , unsigned long prot ,
1487- unsigned long flags , unsigned long addr ,
1488- unsigned long addr_only );
1489+ unsigned long flags );
14891490 int (* file_mprotect ) (struct vm_area_struct * vma ,
14901491 unsigned long reqprot ,
14911492 unsigned long prot );
@@ -1744,9 +1745,9 @@ int security_file_permission(struct file *file, int mask);
17441745int security_file_alloc (struct file * file );
17451746void security_file_free (struct file * file );
17461747int security_file_ioctl (struct file * file , unsigned int cmd , unsigned long arg );
1747- int security_file_mmap (struct file * file , unsigned long reqprot ,
1748- unsigned long prot , unsigned long flags ,
1749- unsigned long addr , unsigned long addr_only );
1748+ int security_mmap_file (struct file * file , unsigned long reqprot ,
1749+ unsigned long prot , unsigned long flags );
1750+ int security_mmap_addr ( unsigned long addr );
17501751int security_file_mprotect (struct vm_area_struct * vma , unsigned long reqprot ,
17511752 unsigned long prot );
17521753int security_file_lock (struct file * file , unsigned int cmd );
@@ -2182,11 +2183,14 @@ static inline int security_file_ioctl(struct file *file, unsigned int cmd,
21822183 return 0 ;
21832184}
21842185
2185- static inline int security_file_mmap (struct file * file , unsigned long reqprot ,
2186+ static inline int security_mmap_file (struct file * file , unsigned long reqprot ,
21862187 unsigned long prot ,
2187- unsigned long flags ,
2188- unsigned long addr ,
2189- unsigned long addr_only )
2188+ unsigned long flags )
2189+ {
2190+ return 0 ;
2191+ }
2192+
2193+ static inline int security_mmap_addr (unsigned long addr )
21902194{
21912195 return cap_mmap_addr (addr );
21922196}
0 commit comments