All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Moore <paul.moore@hp.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Marshall Miller <mmiller@tresys.com>,
	SE Linux <selinux@tycho.nsa.gov>,
	James Morris <jmorris@namei.org>,
	Eric Paris <eparis@parisplace.org>
Subject: Re: Incorrect avc logs for the packet object class
Date: Thu, 21 May 2009 10:37:06 -0400	[thread overview]
Message-ID: <200905211037.06609.paul.moore@hp.com> (raw)
In-Reply-To: <1242915280.20082.463.camel@localhost.localdomain>

On Thursday 21 May 2009 10:14:40 am Stephen Smalley wrote:
> On Wed, 2009-05-20 at 13:23 -0400, Marshall Miller wrote:
> > I first noticed this bug on a RHEL 5 system, and I also noticed it on
> > Ubuntu Jaunty.  I tested this out on Fedora 11 Preview and it was there
> > also.
> >
> > The avc messages for the packet object class sporadically report
> > incorrect comm/pid info.  It is most apparent when multiple processes
> > are sending/receiving packets at the same time.  To demonstrate this, I
> > added an iptables rule such that every packet being sent is labeled
> > system_u:object_r:dns_client_packet_t:s0 (arbitrarily chosen from
> > existing types).  I then created and inserted a module that auditallows
> > all packet perms for subj == domain and obj == dns_client_packet_t.
> > Then I started the Software Updater, and when it started downloading
> > packages I ran firefox.
>
> This has always been an issue for the low level networking permission
> checks that may happen outside of process context; unfortunately,
> "current" is still defined in that situation and thus avc_audit() cannot
> distinguish the cases where it has a relevant process context from these
> situations.  Options for fixing:
> - Have the callers of avc_has_perm() pass a flag (e.g. via
> avc_audit_data) when no relevant process context is available, and use
> that flag within avc_audit() to omit the comm= and pid= information and
> to pass a NULL audit_context to audit_log_start().
> - Have avc_audit() internally check for certain classes and permissions
> (e.g. SECCLASS_PACKET, SECCLASS_PEER, SECCLASS_NETIF, SECCLASS_NODE)
> known to have this behavior, and likewise omit the comm= and pid=
> information and pass a NULL context to audit_log_start() in that case.
> Concern with this approach is that a given class/permission may be used
> from multiple call sites, some of which may have a valid process context
> and some of which may not.

For the reasons that Stephen pointed out as well as a concern that it would be 
harder to maintain (we would likely forget to add new classes in the future 
should they arise) I vote for the first flag-passing approach.  It should be a 
relatively small patch; if I don't hear any objections I'll start working on 
it on in the next day or two ... I would think we should be able to still get 
this into 2.6.30.

-- 
paul moore
linux @ hp


--
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.

  reply	other threads:[~2009-05-21 14:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-20 17:23 Incorrect avc logs for the packet object class Marshall Miller
2009-05-21 14:14 ` Stephen Smalley
2009-05-21 14:37   ` Paul Moore [this message]
2009-05-21 16:26     ` Stephen Smalley
2009-05-21 17:57       ` Stephen Smalley
2009-05-21 19:05         ` Paul Moore
2009-05-21 19:10           ` Paul Moore

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=200905211037.06609.paul.moore@hp.com \
    --to=paul.moore@hp.com \
    --cc=eparis@parisplace.org \
    --cc=jmorris@namei.org \
    --cc=mmiller@tresys.com \
    --cc=sds@tycho.nsa.gov \
    --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.