From: Darrel Goeddel <dgoeddel@TrustedCS.com>
To: Stephen Smalley <sds@epoch.ncsc.mil>, James Morris <jmorris@redhat.com>
Cc: "'SELinux List'" <SELinux@tycho.nsa.gov>, redhat-lspp@redhat.com
Subject: [PATCH] fix masking of capabilities over netlink in permissive mode
Date: Wed, 31 May 2006 12:35:19 -0500 [thread overview]
Message-ID: <447DD3D7.4050200@trustedcs.com> (raw)
I think I ran across the problem described in this thread:
http://www.redhat.com/archives/linux-audit/2006-May/msg00059.html
The process' effective capabilities are always being masked with the
allowed vector of the avc decision (for self against the capability
security class) in netlink's copy of the process capabilities (eff_cap).
The allowed vector takes on a slightly different role when SELinux
is not in enforcing mode - it starts to track used-but-not-normally-
permitted actions in the allowed vector. That is what is causing
the first attempt to fail (the allowed vector has not been "inflated")
and the following attempts to succeed (the vector has been inflated in
response to its previous use). Does my reasoning (and patch) seem to
be on track?
This patch removes the masking of capabilities passed over netlink
socket when SELinux is in enforcing mode.
Signed-off-by: Darrel Goeddel <dgoeddel@trustedcs.com>
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 21dad41..c7650bb 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3599,7 +3599,8 @@ static int selinux_netlink_send(struct s
avd.allowed = 0;
avc_has_perm_noaudit(tsec->sid, tsec->sid,
SECCLASS_CAPABILITY, ~0, &avd);
- cap_mask(NETLINK_CB(skb).eff_cap, avd.allowed);
+ if (selinux_enforcing)
+ cap_mask(NETLINK_CB(skb).eff_cap, avd.allowed);
if (policydb_loaded_version >= POLICYDB_VERSION_NLCLASS)
err = selinux_nlmsg_perm(sk, skb);
--
Darrel
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next reply other threads:[~2006-05-31 17:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-31 17:35 Darrel Goeddel [this message]
2006-05-31 17:54 ` [PATCH] fix masking of capabilities over netlink in permissive mode Stephen Smalley
2006-06-01 14:13 ` Darrel Goeddel
2006-06-01 14:31 ` Stephen Smalley
2006-06-01 14:58 ` Darrel Goeddel
2006-06-01 16:23 ` [redhat-lspp] " Steve Grubb
2006-06-01 16:36 ` Linda Knippers
2006-06-02 14:49 ` Darrel Goeddel
2006-06-02 15:35 ` Stephen Smalley
2006-06-13 19:00 ` Darrel Goeddel
2006-06-14 15:02 ` Stephen Smalley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=447DD3D7.4050200@trustedcs.com \
--to=dgoeddel@trustedcs.com \
--cc=SELinux@tycho.nsa.gov \
--cc=jmorris@redhat.com \
--cc=redhat-lspp@redhat.com \
--cc=sds@epoch.ncsc.mil \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.