OSDN Git Service

selinux: stop passing MAY_NOT_BLOCK to the AVC upon follow_link
authorStephen Smalley <sds@tycho.nsa.gov>
Wed, 12 Dec 2018 15:10:56 +0000 (10:10 -0500)
committerPaul Moore <paul@paul-moore.com>
Fri, 11 Jan 2019 01:34:37 +0000 (20:34 -0500)
commite46e01eebbbcf2ff6d28ee7cae9f117e9d1572c8
tree21fb06603d0a98d0146053922e1a93ba5ded5817
parent3a28cff3bd4bf43f02be0c4e7933aebf3dc8197e
selinux: stop passing MAY_NOT_BLOCK to the AVC upon follow_link

commit bda0be7ad9948 ("security: make inode_follow_link RCU-walk aware")
switched selinux_inode_follow_link() to use avc_has_perm_flags() and
pass down the MAY_NOT_BLOCK flag if called during RCU walk.  However,
the only test of MAY_NOT_BLOCK occurs during slow_avc_audit()
and only if passing an inode as audit data (LSM_AUDIT_DATA_INODE).  Since
selinux_inode_follow_link() passes a dentry directly, passing MAY_NOT_BLOCK
here serves no purpose.  Switch selinux_inode_follow_link() to use
avc_has_perm() and drop avc_has_perm_flags() since there are no other
users.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/avc.c
security/selinux/hooks.c
security/selinux/include/avc.h