]> www.infradead.org Git - users/jedix/linux-maple.git/commit
lsm: count the LSMs enabled at compile time
authorKP Singh <kpsingh@kernel.org>
Fri, 16 Aug 2024 15:43:06 +0000 (17:43 +0200)
committerPaul Moore <paul@paul-moore.com>
Thu, 22 Aug 2024 16:23:47 +0000 (12:23 -0400)
commitd51e783c17bab0c139bf78d6bd9d1f66673f7903
tree63a687b2677e5079ac9d3c5970d57df0a8eb87d9
parent7cff549daa67c7549c5a8688674cea2df8c2ec80
lsm: count the LSMs enabled at compile time

These macros are a clever trick to determine a count of the number of
LSMs that are enabled in the config to ascertain the maximum number of
static calls that need to be configured per LSM hook.

Without this one would need to generate static calls for the total
number of LSMs in the kernel (even if they are not compiled) times the
number of LSM hooks which ends up being quite wasteful.

Tested-by: Guenter Roeck <linux@roeck-us.net>
Suggested-by: Kui-Feng Lee <sinquersw@gmail.com>
Suggested-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: John Johansen <john.johansen@canonical.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Acked-by: Song Liu <song@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Nacked-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: KP Singh <kpsingh@kernel.org>
[PM: added IPE to the count during merge]
Signed-off-by: Paul Moore <paul@paul-moore.com>
include/linux/args.h
include/linux/lsm_count.h [new file with mode: 0644]