aboutsummaryrefslogtreecommitdiffstats
path: root/security/commoncap.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-05-30 13:30:51 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-05-31 13:11:54 -0400
commite5467859f7f79b69fc49004403009dfdba3bec53 (patch)
tree73b011daf79eeddd61bbcaf65cd197b5e5f6f149 /security/commoncap.c
parentd007794a182bc072a7b7479909dbd0d67ba341be (diff)
split ->file_mmap() into ->mmap_addr()/->mmap_file()
... i.e. file-dependent and address-dependent checks. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security/commoncap.c')
-rw-r--r--security/commoncap.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/security/commoncap.c b/security/commoncap.c
index ebac3618896e..6dbae4650abe 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -980,23 +980,8 @@ int cap_mmap_addr(unsigned long addr)
980 return ret; 980 return ret;
981} 981}
982 982
983/* 983int cap_mmap_file(struct file *file, unsigned long reqprot,
984 * cap_file_mmap - check if able to map given addr 984 unsigned long prot, unsigned long flags)
985 * @file: unused
986 * @reqprot: unused
987 * @prot: unused
988 * @flags: unused
989 * @addr: address attempting to be mapped
990 * @addr_only: unused
991 *
992 * If the process is attempting to map memory below dac_mmap_min_addr they need
993 * CAP_SYS_RAWIO. The other parameters to this function are unused by the
994 * capability security module. Returns 0 if this mapping should be allowed
995 * -EPERM if not.
996 */
997int cap_file_mmap(struct file *file, unsigned long reqprot,
998 unsigned long prot, unsigned long flags,
999 unsigned long addr, unsigned long addr_only)
1000{ 985{
1001 return cap_mmap_addr(addr); 986 return 0;
1002} 987}