From: Casey Schaufler <casey@schaufler-ca.com>
To: Paul Moore <paul.moore@hp.com>,
selinux@tycho.nsa.gov, linux-security-module@vger.kernel.org
Subject: Re: [RFC PATCH v6 05/13] SELinux: add secctx_to_secid() LSM hook
Date: Fri, 9 Nov 2007 14:19:02 -0800 (PST) [thread overview]
Message-ID: <199039.66000.qm@web36614.mail.mud.yahoo.com> (raw)
In-Reply-To: <20071109212415.31738.16402.stgit@flek.americas.hpqcorp.net>
--- Paul Moore <paul.moore@hp.com> wrote:
> Add a secctx_to_secid() LSM hook to go along with the existing
> secid_to_secctx() LSM hook.
I'll bite. Where does this get used?
There are already places in the networking and audit code where
a secid is gotten and saved for the sole purpose of getting a secctx
at some later time. My favorite example:
> static void ip_cmsg_recv_security(struct msghdr *msg, struct sk_buff *skb)
> {
> char *secdata;
> u32 seclen, secid;
> int err;
In the Smack case what's in skb is the secctx.
> err = security_socket_getpeersec_dgram(NULL, skb, &secid);
> if (err)
> return;
Smack pulls the secctx off the packet and finds a secid for it.
> err = security_secid_to_secctx(secid, &secdata, &seclen);
> if (err)
> return;
Just so that it can turn around and look up the secctx it had in the
first place.
> put_cmsg(msg, SOL_IP, SCM_SECURITY, seclen, secdata);
> security_release_secctx(secdata, seclen);
Fortunatly, this is no-op.
> }
I expect that the purpose of the proposed secctx_to_secid() is to
make it easier to implement more of these cases, where the only
reason to do the conversion is to have something to convert back
later. With SELinux as the only consumer of the LSM, and with the
SELinux secid mindset I suppose this could make sense. It would
also be perfectly reasonable if there was anything to do with a
secid except convert it to a secctx, but there isn't.
There. I got the righteous indignation off my chest. I say to
go ahead with adding this to the LSM because I need it to for
dealing with the aformentioned audit code, which I have looked
into fixing to use secctx instead of secid, and determined that
there are a couple cases where you end up with the secid in any
case.
In Linux 2.7 I propose that we fix these problems. Not today.
Casey Schaufler
casey@schaufler-ca.com
--
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 prev parent reply other threads:[~2007-11-09 22:19 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-09 21:23 [RFC PATCH v6 00/13] Labeled networking patches Paul Moore
2007-11-09 21:23 ` [RFC PATCH v6 01/13] NetLabel: remove unneeded RCU read locks Paul Moore
2007-11-09 21:23 ` [RFC PATCH v6 02/13] NetLabel: cleanup the LSM domain hash functions Paul Moore
2007-11-09 21:24 ` [RFC PATCH v6 03/13] NetLabel: consolidate the LSM domain mapping/hashing locks Paul Moore
2007-11-09 21:24 ` [RFC PATCH v6 04/13] NetLabel: Add secid token support to the NetLabel secattr struct Paul Moore
2007-11-09 21:24 ` [RFC PATCH v6 05/13] SELinux: add secctx_to_secid() LSM hook Paul Moore
2007-11-09 22:19 ` Casey Schaufler [this message]
2007-11-10 1:21 ` Paul Moore
2007-11-11 6:27 ` Casey Schaufler
2007-11-09 21:24 ` [RFC PATCH v6 06/13] NetLabel: add IP address family information to the netlbl_skbuff_getattr() function Paul Moore
2007-11-09 21:24 ` [RFC PATCH v6 07/13] SELinux: Add a capabilities bitmap to SELinux policy version 22 Paul Moore
2007-11-09 21:24 ` [RFC PATCH v6 08/13] SELinux: Add new peer permissions to the Flask definitions Paul Moore
2007-11-11 22:31 ` James Morris
2007-11-12 16:34 ` Paul Moore
2007-11-09 21:24 ` [RFC PATCH v6 09/13] SELinux: Better integration between peer labeling subsystems Paul Moore
2007-11-11 22:34 ` James Morris
2007-11-12 16:40 ` Paul Moore
2007-11-09 21:24 ` [RFC PATCH v6 10/13] SELinux: Enable dynamic enable/disable of the network access checks Paul Moore
2007-11-09 21:24 ` [RFC PATCH v6 11/13] SELinux: allow NetLabel to directly cache SIDs Paul Moore
2007-11-09 21:24 ` [RFC PATCH v6 12/13] NetLabel: introduce static network labels for unlabeled connections Paul Moore
2007-11-09 21:25 ` [RFC PATCH v6 13/13] NetLabel: add auditing to the static labeling mechanism 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=199039.66000.qm@web36614.mail.mud.yahoo.com \
--to=casey@schaufler-ca.com \
--cc=linux-security-module@vger.kernel.org \
--cc=paul.moore@hp.com \
--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.