summaryrefslogtreecommitdiffstats
path: root/security/selinux/include/policycap.h
diff options
context:
space:
mode:
authorRichard Haines <richard_c_haines@btinternet.com>2022-02-25 17:54:38 +0000
committerPaul Moore <paul@paul-moore.com>2022-02-25 15:35:19 -0500
commit65881e1db4e948614d9eb195b8e1197339822949 (patch)
tree5412d30772bda69f399724371c13d53cfa4c1d96 /security/selinux/include/policycap.h
parentb97df7c098c531010e445da88d02b7bf7bf59ef6 (diff)
downloadlinux-stable-65881e1db4e948614d9eb195b8e1197339822949.tar.gz
linux-stable-65881e1db4e948614d9eb195b8e1197339822949.tar.bz2
linux-stable-65881e1db4e948614d9eb195b8e1197339822949.zip
selinux: allow FIOCLEX and FIONCLEX with policy capability
These ioctls are equivalent to fcntl(fd, F_SETFD, flags), which SELinux always allows too. Furthermore, a failed FIOCLEX could result in a file descriptor being leaked to a process that should not have access to it. As this patch removes access controls, a policy capability needs to be enabled in policy to always allow these ioctls. Based-on-patch-by: Demi Marie Obenour <demiobenour@gmail.com> Signed-off-by: Richard Haines <richard_c_haines@btinternet.com> [PM: subject line tweak] Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/include/policycap.h')
-rw-r--r--security/selinux/include/policycap.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/security/selinux/include/policycap.h b/security/selinux/include/policycap.h
index 2ec038efbb03..a9e572ca4fd9 100644
--- a/security/selinux/include/policycap.h
+++ b/security/selinux/include/policycap.h
@@ -11,6 +11,7 @@ enum {
POLICYDB_CAPABILITY_CGROUPSECLABEL,
POLICYDB_CAPABILITY_NNP_NOSUID_TRANSITION,
POLICYDB_CAPABILITY_GENFS_SECLABEL_SYMLINKS,
+ POLICYDB_CAPABILITY_IOCTL_SKIP_CLOEXEC,
__POLICYDB_CAPABILITY_MAX
};
#define POLICYDB_CAPABILITY_MAX (__POLICYDB_CAPABILITY_MAX - 1)