SELinux: include definition of new capabilities
PATCH 1/2 SELinux: include definition of new capabilities
The kernel has added CAP_WAKE_ALARM and CAP_EPOLLWAKEUP. We need to define these in SELinux so they can be mediated by policy.
--- security/selinux/include/classmap.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
security/selinux/include/classmap.h +3 -1
@@ -145,7 +145,9 @@ struct security_class_mapping secclass_map[] = { "node_bind", "name_connect", NULL } }, { "memprotect", { "mmap_zero", NULL } }, { "peer", { "recv", NULL } }, - { "capability2", { "mac_override", "mac_admin", "syslog", NULL } }, + { "capability2", + { "mac_override", "mac_admin", "syslog", "wake_alarm", "epollwakeup", + NULL } }, { "kernel_service", { "use_as_override", "create_files_as", NULL } }, { "tun_socket", { COMMON_SOCK_PERMS, NULL } },
Signature · 7 lines
1.7.10.4 -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
PATCH 2/2 SELinux: do not check open perms if they are not known to policy
When I introduced open perms policy didn't understand them and I implemented them as a policycap. When I added the checking of open perm to truncate I forgot to conditionalize it on the userspace defined policy capability. Running an old policy with a new kernel will not check open on open(2) but will check it on truncate. Conditionalize the truncate check the same as the open check.
--- security/selinux/hooks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/selinux/hooks.c +1 -1
@@ -2709,7 +2709,7 @@ static int selinux_inode_setattr(struct dentry *dentry, struct iattr *iattr) ATTR_ATIME_SET | ATTR_MTIME_SET | ATTR_TIMES_SET))return dentry_has_perm (cred, dentry,FILE__SETATTR ); -if (ia_valid &ATTR_SIZE ) +if (selinux_policycap_openperm && (ia_valid &ATTR_SIZE )) av |=FILE__OPEN ;return dentry_has_perm (cred, dentry, av);
Signature · 7 lines
1.7.10.4 -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Re: [PATCH 2/2] SELinux: do not check open perms if they are not known to policy
Quoted 8 lines · Eric Paris
When I introduced open perms policy didn't understand them and I implemented them as a policycap. When I added the checking of open perm to truncate I forgot to conditionalize it on the userspace defined policy capability. Running an old policy with a new kernel will not check open on open(2) but will check it on truncate. Conditionalize the truncate check the same as the open check.
Signed-off-by Eric Paris <[email protected]>
Quoted 18 lines
Cc [email protected] # 3.4.x--- security/selinux/hooks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)security/selinux/hooks.c +1
-1@@ -2709,7 +2709,7 @@ static int selinux_inode_setattr(struct dentry *dentry, struct iattr *iattr) ATTR_ATIME_SET | ATTR_MTIME_SET | ATTR_TIMES_SET))return dentry_has_perm (cred, dentry,FILE__SETATTR ); -if (ia_valid &ATTR_SIZE ) +if (selinux_policycap_openperm && (ia_valid &ATTR_SIZE )) av |=FILE__OPEN ;return dentry_has_perm (cred, dentry, av);
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 4 lines · Eric Paris
The kernel has added
CAP_WAKE_ALARMandCAP_EPOLLWAKEUP. We need to define these in SELinux so they can be mediated by policy.Signed-off-by Eric Paris <[email protected]>
Quoted 19 lines
--- security/selinux/include/classmap.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)security/selinux/include/classmap.h +3
-1@@ -145,7 +145,9 @@ struct security_class_mapping secclass_map[] = { "node_bind", "name_connect", NULL } }, { "memprotect", { "mmap_zero", NULL } }, { "peer", { "recv", NULL } }, - { "capability2", { "mac_override", "mac_admin", "syslog", NULL } }, + { "capability2", + { "mac_override", "mac_admin", "syslog", "wake_alarm", "epollwakeup", + NULL } }, { "kernel_service", { "use_as_override", "create_files_as", NULL } }, { "tun_socket", { COMMON_SOCK_PERMS, NULL } },
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.