All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] capabilities: do not audit log BPRM_FCAPS on set*id
@ 2017-03-03  1:10 Richard Guy Briggs
  2017-03-03  2:07 ` Serge E. Hallyn
  0 siblings, 1 reply; 23+ messages in thread
From: Richard Guy Briggs @ 2017-03-03  1:10 UTC (permalink / raw)
  To: linux-security-module, linux-audit
  Cc: Richard Guy Briggs, Andy Lutomirski, Serge E. Hallyn, Kees Cook,
	James Morris, Eric Paris, Paul Moore, Steve Grubb

The audit subsystem is adding a BPRM_FCAPS record when auditing setuid
application execution (SYSCALL execve). This is not expected as it was
supposed to be limited to when the file system actually had capabilities
in an extended attribute.  It lists all capabilities making the event
really ugly to parse what is happening.  The PATH record correctly
records the setuid bit and owner.  Suppress the BPRM_FCAPS record on
set*id.

See: https://github.com/linux-audit/audit-kernel/issues/16

Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
---
 security/commoncap.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/security/commoncap.c b/security/commoncap.c
index 14540bd..8f6bedf 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -594,16 +594,17 @@ skip:
 	/*
 	 * Audit candidate if current->cap_effective is set
 	 *
-	 * We do not bother to audit if 3 things are true:
+	 * We do not bother to audit if 4 things are true:
 	 *   1) cap_effective has all caps
 	 *   2) we are root
 	 *   3) root is supposed to have all caps (SECURE_NOROOT)
+	 *   4) we are running a set*id binary
 	 * Since this is just a normal root execing a process.
 	 *
 	 * Number 1 above might fail if you don't have a full bset, but I think
 	 * that is interesting information to audit.
 	 */
-	if (!cap_issubset(new->cap_effective, new->cap_ambient)) {
+	if (!is_setid && !cap_issubset(new->cap_effective, new->cap_ambient)) {
 		if (!cap_issubset(CAP_FULL_SET, new->cap_effective) ||
 		    !uid_eq(new->euid, root_uid) || !uid_eq(new->uid, root_uid) ||
 		    issecure(SECURE_NOROOT)) {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2017-04-13 19:36 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-03  1:10 [PATCH] capabilities: do not audit log BPRM_FCAPS on set*id Richard Guy Briggs
2017-03-03  2:07 ` Serge E. Hallyn
2017-03-03  2:50   ` Richard Guy Briggs
2017-03-07 17:22     ` Richard Guy Briggs
2017-03-07 18:10       ` Serge E. Hallyn
2017-03-07 21:10         ` Richard Guy Briggs
2017-03-07 21:25           ` Serge E. Hallyn
2017-03-09 14:34           ` Steve Grubb
2017-03-09 14:34             ` Steve Grubb
2017-03-29 10:29             ` Richard Guy Briggs
2017-03-29 10:29               ` Richard Guy Briggs
2017-04-11 19:36               ` Paul Moore
2017-04-11 19:36                 ` Paul Moore
2017-04-12  6:43                 ` Richard Guy Briggs
2017-04-12  6:43                   ` Richard Guy Briggs
2017-04-12 14:51                   ` Serge E. Hallyn
2017-04-12 14:51                     ` Serge E. Hallyn
2017-04-12 18:49                   ` Steve Grubb
2017-04-12 18:49                     ` Steve Grubb
2017-04-13  8:50                     ` Richard Guy Briggs
2017-04-13  8:50                       ` Richard Guy Briggs
2017-04-13 19:36                       ` Steve Grubb
2017-04-13 19:36                         ` Steve Grubb

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.