diff options
author | Stephen Smalley <sds@tycho.nsa.gov> | 2014-04-29 14:29:04 -0400 |
---|---|---|
committer | Serge Hallyn <serge.hallyn@ubuntu.com> | 2014-06-03 15:21:48 -0400 |
commit | ca7786a2f916540931d7114d441efa141c99c898 (patch) | |
tree | 47af90d33b13780b1491cd751d8750a01668b884 /security/selinux/hooks.c | |
parent | 2fd4e6698f0863f47558e63b67c7c3a026513541 (diff) |
selinux: Report permissive mode in avc: denied messages.
We cannot presently tell from an avc: denied message whether access was in
fact denied or was allowed due to global or per-domain permissive mode.
Add a permissive= field to the avc message to reflect this information.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r-- | security/selinux/hooks.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 6ab22720c277..d3a2c2e80fec 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -2770,6 +2770,7 @@ static int selinux_inode_follow_link(struct dentry *dentry, struct nameidata *na | |||
2770 | 2770 | ||
2771 | static noinline int audit_inode_permission(struct inode *inode, | 2771 | static noinline int audit_inode_permission(struct inode *inode, |
2772 | u32 perms, u32 audited, u32 denied, | 2772 | u32 perms, u32 audited, u32 denied, |
2773 | int result, | ||
2773 | unsigned flags) | 2774 | unsigned flags) |
2774 | { | 2775 | { |
2775 | struct common_audit_data ad; | 2776 | struct common_audit_data ad; |
@@ -2780,7 +2781,7 @@ static noinline int audit_inode_permission(struct inode *inode, | |||
2780 | ad.u.inode = inode; | 2781 | ad.u.inode = inode; |
2781 | 2782 | ||
2782 | rc = slow_avc_audit(current_sid(), isec->sid, isec->sclass, perms, | 2783 | rc = slow_avc_audit(current_sid(), isec->sid, isec->sclass, perms, |
2783 | audited, denied, &ad, flags); | 2784 | audited, denied, result, &ad, flags); |
2784 | if (rc) | 2785 | if (rc) |
2785 | return rc; | 2786 | return rc; |
2786 | return 0; | 2787 | return 0; |
@@ -2822,7 +2823,7 @@ static int selinux_inode_permission(struct inode *inode, int mask) | |||
2822 | if (likely(!audited)) | 2823 | if (likely(!audited)) |
2823 | return rc; | 2824 | return rc; |
2824 | 2825 | ||
2825 | rc2 = audit_inode_permission(inode, perms, audited, denied, flags); | 2826 | rc2 = audit_inode_permission(inode, perms, audited, denied, rc, flags); |
2826 | if (rc2) | 2827 | if (rc2) |
2827 | return rc2; | 2828 | return rc2; |
2828 | return rc; | 2829 | return rc; |