All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tislabs.com>
To: Russell Coker <russell@coker.com.au>
Cc: SE Linux <selinux@tycho.nsa.gov>
Subject: Re: audit bug in fd handling
Date: Wed, 10 Jul 2002 09:12:21 -0400 (EDT)	[thread overview]
Message-ID: <Pine.GSO.4.33.0207100909500.26546-200000@raven> (raw)
In-Reply-To: <20020710074550.C3E6D106@lyta.coker.com.au>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 519 bytes --]


On Wed, 10 Jul 2002, Russell Coker wrote:

> It seems that when a file handle open read/write is inherited by a domain
> that is permitted read access only, an error about write access will be
> logged - even if there is a dontaudit rule!

The attached patch (also committed to the sourceforge CVS tree) fixes this
bug in the auditdeny logic.  To apply, save the patch to
~/auditdeny.patch, cd lsm-2.4, and patch -p0 < ~/auditdeny.patch.  Then,
rebuild your kernel.

--
Stephen D. Smalley, NAI Labs
ssmalley@nai.com



[-- Attachment #2: Type: TEXT/PLAIN, Size: 1116 bytes --]

Index: security/selinux/include/linux/flask/avc.h
===================================================================
RCS file: /cvsroot/selinux/nsa/lsm-2.4/security/selinux/include/linux/flask/avc.h,v
retrieving revision 1.3
diff -u -r1.3 avc.h
--- security/selinux/include/linux/flask/avc.h	3 Jun 2002 13:46:51 -0000	1.3
+++ security/selinux/include/linux/flask/avc.h	10 Jul 2002 13:03:52 -0000
@@ -214,6 +214,7 @@
 	unsigned long	flags;
 	struct avc_entry entry;
 	__u32 seqno;
+	access_vector_t denied;
 
 	spin_lock_irqsave(&avc_lock, flags);
 	avc_cache_stats_incr(AVC_ENTRY_LOOKUPS);
@@ -254,9 +255,11 @@
 		ae = aeref->ae;
 	}
 
-	if (!requested || (requested & ae->allowed) != requested) {
-		if (!requested || (requested & ae->auditdeny))
-			avc_audit(ssid, tsid, tclass, requested & ~(ae->allowed), ae,
+	denied = requested & ~(ae->allowed);
+
+	if (!requested || denied) {
+		if (!requested || (denied & ae->auditdeny))
+			avc_audit(ssid, tsid, tclass, denied, ae,
 				  AVC_AUDITDENY, auditdata);
 #ifdef CONFIG_SECURITY_SELINUX_DEVELOP
 		if (avc_debug_always_allow) {

  parent reply	other threads:[~2002-07-10 13:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-10  7:45 audit bug in fd handling Russell Coker
2002-07-10 11:55 ` Stephen Smalley
2002-07-10 13:12 ` Stephen Smalley [this message]
2002-07-10 13:23 ` Ed Street
2002-07-10 14:40   ` Russell Coker
2002-07-11 16:13     ` sysadm_tty_device_t Ed Street
2002-07-11 17:21       ` sysadm_tty_device_t Stephen Smalley
2002-07-11 17:24         ` sysadm_tty_device_t Ed Street
2002-07-11 17:39           ` sysadm_tty_device_t Stephen Smalley
2002-07-11 17:54             ` sysadm_tty_device_t Ed Street
2002-07-11 18:19               ` sysadm_tty_device_t Stephen Smalley
2002-07-11 18:24                 ` sysadm_tty_device_t Ed Street
2002-07-11 18:35                   ` sysadm_tty_device_t Stephen Smalley
2002-07-11 17:55             ` sysadm_tty_device_t Ed Street
2002-07-11 19:55             ` sysadm_tty_device_t Timothy Wood
2002-07-11 19:53               ` sysadm_tty_device_t Ed Street
2002-07-11 20:07                 ` sysadm_tty_device_t Stephen Smalley
2002-07-11 20:12                 ` sysadm_tty_device_t Timothy Wood
2002-07-11 20:05               ` sysadm_tty_device_t Stephen Smalley
2002-07-19 21:27             ` booting problem Charles R. Fuller
2002-07-22 11:59               ` Stephen Smalley
2002-07-11 18:28       ` sysadm_tty_device_t Timothy Wood

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=Pine.GSO.4.33.0207100909500.26546-200000@raven \
    --to=sds@tislabs.com \
    --cc=russell@coker.com.au \
    --cc=selinux@tycho.nsa.gov \
    /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.