From: Paul Moore <pmoore@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Milan Broz <gmazyland@gmail.com>, selinux@tycho.nsa.gov
Subject: Re: [PATCH] selinux: fix the default socket labeling in sock_graft()
Date: Thu, 10 Jul 2014 15:11:09 -0400 [thread overview]
Message-ID: <3731034.dgD2eG8Wyv@sifl> (raw)
In-Reply-To: <53BED153.2020206@tycho.nsa.gov>
On Thursday, July 10, 2014 01:45:55 PM Stephen Smalley wrote:
> Ok, I think I understand this now: for inet and unix, sksec->sid is set
> in other hooks upon connection establishment based on the peer label -
> primarily for multi-level servers - and we are propagating it upward to
> the parent socket inode. For others, sksec->sid is not set anywhere
> except initialized to unlabeled upon sock creation and so you are just
> pushing the parent socket inode label down to the sock in your patch.
Yep.
> It seems a bit fragile though and certainly doesn't align with the
> sock_graft hook documentation anymore. Wondering if we should assert
> that sksec->sid is not SECINITSID_UNLABELED in the inet/inet6/unix case
> (i.e. that sksec->sid has been set prior to copying it to isec->sid) and
> that sksec->sid is SECINITSID_UNLABELED (i.e. that it has not already
> been set by the protocol implementation) in the default case.
> We need to update the hook documentation too.
Since we can't return an error code, we would be stuck with a BUG_ON() which
is okay, but doesn't help in the situation where the kernel has compiled out
the BUG/BUG_ON macros. Regardless, there probably is some value in adding a
BUG_ON(), if for no other reason than documentation.
I'll see about correcting the comment in, thanks for catching that.
--
paul moore
security and virtualization @ redhat
next prev parent reply other threads:[~2014-07-10 19:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-10 15:37 [PATCH] selinux: fix the default socket labeling in sock_graft() Paul Moore
2014-07-10 16:56 ` Stephen Smalley
2014-07-10 17:45 ` Stephen Smalley
2014-07-10 19:11 ` Paul Moore [this message]
2014-07-10 19:47 ` Paul Moore
2014-07-10 19:57 ` Stephen Smalley
2014-07-10 20:57 ` 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=3731034.dgD2eG8Wyv@sifl \
--to=pmoore@redhat.com \
--cc=gmazyland@gmail.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.