Skip to content

Commit e2f3b78

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull SELinux regression fixes from James Morris. Andrew Morton has a box that hit that open perms problem. I also renamed the "epollwakeup" selinux name for the new capability to be "block_suspend", to match the rename done by commit d9914cf ("PM: Rename CAP_EPOLLWAKEUP to CAP_BLOCK_SUSPEND"). * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: SELinux: do not check open perms if they are not known to policy SELinux: include definition of new capabilities
2 parents 6f70242 + 3d2195c commit e2f3b78

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

security/selinux/hooks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2717,7 +2717,7 @@ static int selinux_inode_setattr(struct dentry *dentry, struct iattr *iattr)
27172717
ATTR_ATIME_SET | ATTR_MTIME_SET | ATTR_TIMES_SET))
27182718
return dentry_has_perm(cred, dentry, FILE__SETATTR);
27192719

2720-
if (ia_valid & ATTR_SIZE)
2720+
if (selinux_policycap_openperm && (ia_valid & ATTR_SIZE))
27212721
av |= FILE__OPEN;
27222722

27232723
return dentry_has_perm(cred, dentry, av);

security/selinux/include/classmap.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ struct security_class_mapping secclass_map[] = {
145145
"node_bind", "name_connect", NULL } },
146146
{ "memprotect", { "mmap_zero", NULL } },
147147
{ "peer", { "recv", NULL } },
148-
{ "capability2", { "mac_override", "mac_admin", "syslog", NULL } },
148+
{ "capability2",
149+
{ "mac_override", "mac_admin", "syslog", "wake_alarm", "block_suspend",
150+
NULL } },
149151
{ "kernel_service", { "use_as_override", "create_files_as", NULL } },
150152
{ "tun_socket",
151153
{ COMMON_SOCK_PERMS, NULL } },

0 commit comments

Comments
 (0)