diff options
author | Stephen Smalley <sds@tycho.nsa.gov> | 2010-01-14 17:28:10 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-01-17 17:54:26 -0500 |
commit | 19439d05b88dafc4e55d9ffce84ccc27cf8b2bcc (patch) | |
tree | e529e1bbba49f30684c3b88a67df1d62ba3e11b1 /security/selinux/include/security.h | |
parent | 8d9525048c74786205b99f3fcd05a839721edfb7 (diff) |
selinux: change the handling of unknown classes
If allow_unknown==deny, SELinux treats an undefined kernel security
class as an error condition rather than as a typical permission denial
and thus does not allow permissions on undefined classes even when in
permissive mode. Change the SELinux logic so that this case is handled
as a typical permission denial, subject to the usual permissive mode and
permissive domain handling.
Also drop the 'requested' argument from security_compute_av() and
helpers as it is a legacy of the original security server interface and
is unused.
Changes:
- Handle permissive domains consistently by moving up the test for a
permissive domain.
- Make security_compute_av_user() consistent with security_compute_av();
the only difference now is that security_compute_av() performs mapping
between the kernel-private class and permission indices and the policy
values. In the userspace case, this mapping is handled by libselinux.
- Moved avd_init inside the policy lock.
Based in part on a patch by Paul Moore <paul.moore@hp.com>.
Reported-by: Andrew Worsley <amworsley@gmail.com>
Signed-off-by: Stephen D. Smalley <sds@tycho.nsa.gov>
Reviewed-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/selinux/include/security.h')
-rw-r--r-- | security/selinux/include/security.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h index 2553266ad793..022cf067aa3f 100644 --- a/security/selinux/include/security.h +++ b/security/selinux/include/security.h | |||
@@ -96,13 +96,11 @@ struct av_decision { | |||
96 | /* definitions of av_decision.flags */ | 96 | /* definitions of av_decision.flags */ |
97 | #define AVD_FLAGS_PERMISSIVE 0x0001 | 97 | #define AVD_FLAGS_PERMISSIVE 0x0001 |
98 | 98 | ||
99 | int security_compute_av(u32 ssid, u32 tsid, | 99 | void security_compute_av(u32 ssid, u32 tsid, |
100 | u16 tclass, u32 requested, | 100 | u16 tclass, struct av_decision *avd); |
101 | struct av_decision *avd); | ||
102 | 101 | ||
103 | int security_compute_av_user(u32 ssid, u32 tsid, | 102 | void security_compute_av_user(u32 ssid, u32 tsid, |
104 | u16 tclass, u32 requested, | 103 | u16 tclass, struct av_decision *avd); |
105 | struct av_decision *avd); | ||
106 | 104 | ||
107 | int security_transition_sid(u32 ssid, u32 tsid, | 105 | int security_transition_sid(u32 ssid, u32 tsid, |
108 | u16 tclass, u32 *out_sid); | 106 | u16 tclass, u32 *out_sid); |