linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: bill.c.roberts@gmail.com (William Roberts)
To: linux-security-module@vger.kernel.org
Subject: [PATCH v5 1/2] selinux: add brief info to policydb
Date: Wed, 17 May 2017 09:04:28 -0700	[thread overview]
Message-ID: <CAFftDdpHH5J18h7zUnYEv0Q++cLOdUqbUGptZHvwXpKh5WjEFw@mail.gmail.com> (raw)
In-Reply-To: <CAPkE-bU-XSQHobkAQzed+fM14sKku56oPq=P=KoCOwuUqcFosw@mail.gmail.com>

On Wed, May 17, 2017 at 8:43 AM, Sebastien Buisson
<sbuisson.ddn@gmail.com> wrote:
> 2017-05-17 17:34 GMT+02:00 William Roberts <bill.c.roberts@gmail.com>:
>>>>>> Is there a particular reason to not just return policybrief_len here as
>>>>>> well, for consistency in the interface?  How do you intend to use this
>>>>>> value in the caller?
>>>>>
>>>>> As called in the other patch to expose policy brief via selinuxfs
>>>>> (sel_read_policybrief), the intent is to provide the caller with the
>>>>> length of the string returned.
>>>>> Or should I set *len to policy brief_len here, and just make the
>>>>> caller aware that the returned length is in fact the length of the
>>>>> buffer (i.e. including terminating NUL byte)?
>>>>
>>>> What is the caller supposed to do with length? This interface seemed kind of
>>>> odd. If it's guaranteed NUL byte terminated, do they even need length?
>>>
>>> The length is useful as an input parameter in case the caller provides
>>> its own buffer (instead of letting the function allocate one), and as
>>
>> This is what I don't get, why doesn't the function just always allocate?
>
> For performance reasons mainly. The caller would have a statically
> allocated buffer, reused every time it needs to get the policy brief
> info.

I'm assuming in the Lustre code you're going to call security_policy_brief(),
how would the caller know how big that buffer is going to be?

I'm looking at both v5 patches, I don't see where it's being called with alloc
set to false.

I don't see how this works with LSM stacking, I would imagine the security
hook needs to call this routine for each LSM and join them together in
some module name spaced way, which was mentioned before, but I don't
see that either, am I missing it?


-- 
Respectfully,

William C Roberts
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2017-05-17 16:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16  9:51 [PATCH v5 1/2] selinux: add brief info to policydb Sebastien Buisson
2017-05-16  9:51 ` [PATCH v5 2/2] selinux: expose policy brief via selinuxfs Sebastien Buisson
2017-05-16 20:40 ` [PATCH v5 1/2] selinux: add brief info to policydb Stephen Smalley
2017-05-17 14:59   ` Sebastien Buisson
2017-05-17 15:09     ` William Roberts
2017-05-17 15:24       ` Sebastien Buisson
2017-05-17 15:34         ` William Roberts
2017-05-17 15:43           ` Sebastien Buisson
2017-05-17 16:04             ` William Roberts [this message]
2017-05-17 16:22               ` William Roberts
2017-05-17 17:00               ` Sebastien Buisson
2017-05-17 18:28                 ` William Roberts
2017-05-17 15:38     ` Stephen Smalley

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=CAFftDdpHH5J18h7zUnYEv0Q++cLOdUqbUGptZHvwXpKh5WjEFw@mail.gmail.com \
    --to=bill.c.roberts@gmail.com \
    --cc=linux-security-module@vger.kernel.org \
    /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).