linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Casey Schaufler <casey@schaufler-ca.com>
To: Sargun Dhillon <sargun@sargun.me>
Cc: LSM <linux-security-module@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Kees Cook <keescook@chromium.org>,
	Igor Stoppa <igor.stoppa@huawei.com>
Subject: Re: [PATCH v4 1/3] security: Refactor LSM hooks into an array and enum
Date: Wed, 7 Mar 2018 12:23:47 -0800	[thread overview]
Message-ID: <6326ecfe-83f9-13d8-d59a-58d567726b07@schaufler-ca.com> (raw)
In-Reply-To: <CAMp4zn8gtb7G28F8D_=npc6a7wwp3QMyvXrNKL0LA=EeFxRiKw@mail.gmail.com>

On 3/7/2018 11:18 AM, Sargun Dhillon wrote:
> On Wed, Mar 7, 2018 at 9:45 AM, Casey Schaufler <casey@schaufler-ca.com> wrote:
>> On 3/6/2018 11:23 PM, Sargun Dhillon wrote:
>>> This commit should have no functional change. It changes the security hook
>>> list heads struct into an array. Additionally, it exposes all of the hooks
>>> via an enum. This loses memory layout randomization as the enum is not
>>> randomized.
>> Please explain why you want to do this. I still dislike it.
>>
> Do you dislike it because of the loss of randomization, or some other reason?

I dislike a huge array of untyped function pointers.
I dislike the loss of type checking in security.c

> The reason for not just having a second list_heads is that it's
> somewhat ugly having to replicate that structure twice -- once for
> dynamic hooks, and once for 'static' hooks.

There was discussion about this some time ago. In the case
where you don't allow dynamic hooks, you mark the lists ro_after_init
whereas in the case with them you don't, but use the locking.


> Instead, we have one enum that LSMs can use and two arrays of heads
> rather than an entire unrolled set of list_heads.

But how is this better? What is the advantage?

>
> If we had a way to randomize this, would it make you comfortable?
>

  reply	other threads:[~2018-03-07 20:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07  7:22 [PATCH v4 0/3] Safe, dynamically loadable LSM hooks Sargun Dhillon
2018-03-07  7:23 ` [PATCH v4 1/3] security: Refactor LSM hooks into an array and enum Sargun Dhillon
2018-03-07 17:45   ` Casey Schaufler
2018-03-07 19:18     ` Sargun Dhillon
2018-03-07 20:23       ` Casey Schaufler [this message]
2018-03-07 22:22         ` Sargun Dhillon
2018-03-07  7:23 ` [PATCH v4 2/3] security: Expose a mechanism to load lsm hooks dynamically at runtime Sargun Dhillon
2018-03-07 17:59   ` Casey Schaufler
2018-03-07 20:29     ` Sargun Dhillon
2018-03-07  7:23 ` [PATCH v4 3/3] security: Add an example sample dynamic LSM Sargun Dhillon
2018-03-07 17:40 ` [PATCH v4 0/3] Safe, dynamically loadable LSM hooks Casey Schaufler

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=6326ecfe-83f9-13d8-d59a-58d567726b07@schaufler-ca.com \
    --to=casey@schaufler-ca.com \
    --cc=igor.stoppa@huawei.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=sargun@sargun.me \
    /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).