[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3e971295-fb0b-3426-6054-e3fa5307943a@schaufler-ca.com>
Date: Tue, 13 Dec 2022 07:37:32 -0800
From: Casey Schaufler <casey@...aufler-ca.com>
To: Jeff Xu <jeffxu@...gle.com>, Paul Moore <paul@...l-moore.com>
Cc: jeffxu@...omium.org, skhan@...uxfoundation.org,
keescook@...omium.org, akpm@...ux-foundation.org,
dmitry.torokhov@...il.com, dverkamp@...omium.org, hughd@...gle.com,
jorgelo@...omium.org, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-mm@...ck.org,
jannh@...gle.com, linux-hardening@...r.kernel.org,
linux-security-module@...r.kernel.org,
kernel test robot <lkp@...el.com>, casey@...aufler-ca.com
Subject: Re: [PATCH v7 6/6] mm/memfd: security hook for memfd_create
On 12/13/2022 7:00 AM, Jeff Xu wrote:
> On Fri, Dec 9, 2022 at 10:29 AM Paul Moore <paul@...l-moore.com> wrote:
>> On Fri, Dec 9, 2022 at 11:05 AM <jeffxu@...omium.org> wrote:
>>> From: Jeff Xu <jeffxu@...gle.com>
>>>
>>> The new security_memfd_create allows lsm to check flags of
>>> memfd_create.
>>>
>>> The security by default system (such as chromeos) can use this
>>> to implement system wide lsm to allow only non-executable memfd
>>> being created.
>>>
>>> Signed-off-by: Jeff Xu <jeffxu@...gle.com>
>>> Reported-by: kernel test robot <lkp@...el.com>
>>> ---
>>> include/linux/lsm_hook_defs.h | 1 +
>>> include/linux/lsm_hooks.h | 4 ++++
>>> include/linux/security.h | 6 ++++++
>>> mm/memfd.c | 5 +++++
>>> security/security.c | 5 +++++
>>> 5 files changed, 21 insertions(+)
>> We typically require at least one in-tree LSM implementation to
>> accompany a new LSM hook. Beyond simply providing proof that the hook
>> has value, it helps provide a functional example both for reviewers as
>> well as future LSM implementations. Also, while the BPF LSM is
>> definitely "in-tree", its nature is such that the actual
>> implementation lives out-of-tree; something like SELinux, AppArmor,
>> Smack, etc. are much more desirable from an in-tree example
>> perspective.
>>
> Thanks for the comments.
> Would that be OK if I add a new LSM in the kernel to block executable
> memfd creation ?
> Alternatively, it might be possible to add this into SELinux or
> landlock, it will be a larger change.
I expect you'll get other opinions, but I'd be happy with a small LSM
that does sophisticated memory fd controls. I also expect that the
SELinux crew would like to see a hook included there.
>
> Thanks
>
> Jeff
>
>
>> --
>> paul-moore.com
Powered by blists - more mailing lists