From: Paul Moore <paul@paul-moore.com>
To: Steffen Klassert <steffen.klassert@secunet.com>
Cc: Fan Du <fan.du@windriver.com>,
davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] {selinux, af_key} Rework pfkey_sadb2xfrm_user_sec_ctx
Date: Thu, 17 Oct 2013 21:18:40 -0400 [thread overview]
Message-ID: <62825117.jOccj7YDuu@sifl> (raw)
In-Reply-To: <20131017095148.GC7660@secunet.com>
On Thursday, October 17, 2013 11:51:48 AM Steffen Klassert wrote:
> On Thu, Oct 17, 2013 at 09:34:53AM +0800, Fan Du wrote:
> > On 2013年10月16日 23:15, Paul Moore wrote:
> > >The fact that you are now changing sadb_x_sec_ctx->sadb_x_sec_len
> > >whenever
> > >pfkey_sadb2xfrm_user_sec_ctx() is called raises an eyebrow. Can you
> > >elaborate on why this is not a problem?
> >
> > Thanks for your attention, Paul.
> >
> > sadb_x_sec_ctx is extra headers passed down from user space, the usage of
> > of this data structure falls down to one of pfkey_funcs function only for
> > one time, more specifically speaking, it's only used by SELINUX for
> > security checking for each operation. In other words, sadb_x_sec_ctx
> > involves with a one shot business here. So the original codes seems do a
> > lots of extra job which could easily be avoid using casting operation.
>
> Since the selinux people have to live with that change in the fist place,
> I'd like to see an ack of one of the selinux maintainers before I take
> in into ipsec-next, Paul?
Well, my earlier concern over modifying the length field probably isn't a
major concern as was pointed out so I could maybe look the other way on that
point. However, while looking a bit closer at the structs and how they are
used, I noticed that PFKEY structs are all explicitly packed (sadb_x_sec_ctx)
and the LSM struct is not (xfrm_user_sec_ctx). I'm not enough of a compiler
guru across all the different architectures to know if this is significant or
not given the structure, but it does make me pause.
Any compiler gurus care to weigh in on this?
--
paul moore
www.paul-moore.com
next prev parent reply other threads:[~2013-10-18 1:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-16 6:15 [PATCH net-next] {selinux, af_key} Rework pfkey_sadb2xfrm_user_sec_ctx Fan Du
2013-10-16 15:15 ` Paul Moore
2013-10-17 1:34 ` Fan Du
2013-10-17 9:51 ` Steffen Klassert
2013-10-18 1:18 ` Paul Moore [this message]
2013-10-18 19:58 ` David Miller
2013-10-21 3:01 ` Fan Du
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=62825117.jOccj7YDuu@sifl \
--to=paul@paul-moore.com \
--cc=davem@davemloft.net \
--cc=fan.du@windriver.com \
--cc=netdev@vger.kernel.org \
--cc=steffen.klassert@secunet.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).