diff options
author | KaiGai Kohei <kaigai@ak.jp.nec.com> | 2009-03-31 21:07:57 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-04-01 18:23:45 -0400 |
commit | 8a6f83afd0c5355db6d11394a798e94950306239 (patch) | |
tree | f7cb84de87f67eeba0dd68681907696f8a5774d1 /security/selinux/include | |
parent | c31f403de62415c738ddc9e673cf8e722c82f861 (diff) |
Permissive domain in userspace object manager
This patch enables applications to handle permissive domain correctly.
Since the v2.6.26 kernel, SELinux has supported an idea of permissive
domain which allows certain processes to work as if permissive mode,
even if the global setting is enforcing mode.
However, we don't have an application program interface to inform
what domains are permissive one, and what domains are not.
It means applications focuses on SELinux (XACE/SELinux, SE-PostgreSQL
and so on) cannot handle permissive domain correctly.
This patch add the sixth field (flags) on the reply of the /selinux/access
interface which is used to make an access control decision from userspace.
If the first bit of the flags field is positive, it means the required
access control decision is on permissive domain, so application should
allow any required actions, as the kernel doing.
This patch also has a side benefit. The av_decision.flags is set at
context_struct_compute_av(). It enables to check required permissions
without read_lock(&policy_rwlock).
Signed-off-by: KaiGai Kohei <kaigai@ak.jp.nec.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Acked-by: Eric Paris <eparis@redhat.com>
--
security/selinux/avc.c | 2 +-
security/selinux/include/security.h | 4 +++-
security/selinux/selinuxfs.c | 4 ++--
security/selinux/ss/services.c | 30 +++++-------------------------
4 files changed, 11 insertions(+), 29 deletions(-)
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/selinux/include')
-rw-r--r-- | security/selinux/include/security.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h index 5c3434f7626f..a7be3f01fb08 100644 --- a/security/selinux/include/security.h +++ b/security/selinux/include/security.h | |||
@@ -91,9 +91,11 @@ struct av_decision { | |||
91 | u32 auditallow; | 91 | u32 auditallow; |
92 | u32 auditdeny; | 92 | u32 auditdeny; |
93 | u32 seqno; | 93 | u32 seqno; |
94 | u32 flags; | ||
94 | }; | 95 | }; |
95 | 96 | ||
96 | int security_permissive_sid(u32 sid); | 97 | /* definitions of av_decision.flags */ |
98 | #define AVD_FLAGS_PERMISSIVE 0x0001 | ||
97 | 99 | ||
98 | int security_compute_av(u32 ssid, u32 tsid, | 100 | int security_compute_av(u32 ssid, u32 tsid, |
99 | u16 tclass, u32 requested, | 101 | u16 tclass, u32 requested, |