From: Mateusz Guzik <mjguzik@gmail.com>
To: KP Singh <kpsingh@kernel.org>
Cc: linux-security-module@vger.kernel.org, bpf@vger.kernel.org,
paul@paul-moore.com, keescook@chromium.org,
casey@schaufler-ca.com, song@kernel.org, daniel@iogearbox.net,
ast@kernel.org, renauld@google.com
Subject: Re: [PATCH v4 0/5] Reduce overhead of LSMs with static calls
Date: Sat, 23 Sep 2023 19:13:14 +0200 [thread overview]
Message-ID: <CAGudoHE+od5oZLVAU4z3nXCNGk6uangd+zmDEuoATmDLHeFLGQ@mail.gmail.com> (raw)
In-Reply-To: <CACYkzJ67gw6bvTzX6wx_OtxUXi6kpVT196CXV6XCN1AaGQuKAw@mail.gmail.com>
On 9/23/23, KP Singh <kpsingh@kernel.org> wrote:
> On Fri, Sep 22, 2023 at 8:42 PM Mateusz Guzik <mjguzik@gmail.com> wrote:
>>
>> On Fri, Sep 22, 2023 at 04:55:00PM +0200, KP Singh wrote:
>> > Since we know the address of the enabled LSM callbacks at compile time
>> > and only
>> > the order is determined at boot time, the LSM framework can allocate
>> > static
>> > calls for each of the possible LSM callbacks and these calls can be
>> > updated once
>> > the order is determined at boot.
>> >
>>
>> Any plans to further depessimize the state by not calling into these
>> modules if not configured?
>>
>> For example Debian has a milipede:
>> CONFIG_LSM="landlock,lockdown,yama,loadpin,safesetid,integrity,apparmor,selinux,smack,tomoyo,bpf"
>>
>> Everything is enabled (but not configured).
>
> If it's not configured, we won't generate static call slots and even
> if they are in the CONFIG_LSM (or lsm=) they are simply ignored.
>
Maybe there is a terminology mismatch here, so let me be more specific
with tomoyo as an example.
In debian you have:
CONFIG_SECURITY_TOMOYO=y
CONFIG_LSM, as per above, includes it on the list.
At the same time debian does not ship any tooling to configure tomoyo
-- it is compiled into the kernel but not configured to enforce
anything.
On stock kernel this results in tons of calls to
tomoyo_init_request_info, which are quite expensive due to an
avoidable memset thrown in, and which always return
tomoyo_init_request_info.
Does not look like your patch whacks this problem.
--
Mateusz Guzik <mjguzik gmail.com>
next prev parent reply other threads:[~2023-09-23 17:13 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-22 14:55 [PATCH v4 0/5] Reduce overhead of LSMs with static calls KP Singh
2023-09-22 14:55 ` [PATCH v4 1/5] kernel: Add helper macros for loop unrolling KP Singh
2023-09-22 14:55 ` [PATCH v4 2/5] security: Count the LSMs enabled at compile time KP Singh
2023-09-22 15:50 ` Kees Cook
2023-09-22 16:07 ` KP Singh
2023-09-27 22:37 ` KP Singh
2023-09-22 14:55 ` [PATCH v4 3/5] security: Replace indirect LSM hook calls with static calls KP Singh
2023-09-23 14:52 ` kernel test robot
2023-09-27 5:26 ` kernel test robot
2023-09-22 14:55 ` [PATCH v4 4/5] bpf: Only enable BPF LSM hooks when an LSM program is attached KP Singh
2023-09-22 14:55 ` [PATCH v4 5/5] security: Add CONFIG_SECURITY_HOOK_LIKELY KP Singh
2023-09-22 15:50 ` Kees Cook
2023-09-22 15:51 ` [PATCH v4 0/5] Reduce overhead of LSMs with static calls Kees Cook
2023-09-22 18:42 ` Mateusz Guzik
2023-09-23 16:16 ` KP Singh
2023-09-23 17:13 ` Mateusz Guzik [this message]
2023-09-23 17:15 ` Mateusz Guzik
2023-09-24 2:46 ` Kees Cook
2023-09-25 20:08 ` Mateusz Guzik
2023-09-25 22:02 ` Kees Cook
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=CAGudoHE+od5oZLVAU4z3nXCNGk6uangd+zmDEuoATmDLHeFLGQ@mail.gmail.com \
--to=mjguzik@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=casey@schaufler-ca.com \
--cc=daniel@iogearbox.net \
--cc=keescook@chromium.org \
--cc=kpsingh@kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=renauld@google.com \
--cc=song@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).