[RFC PATCH 05/29] lsm: replace the name field with a pointer to the lsm_id struct

Kees Cook kees at kernel.org
Wed Apr 9 21:40:06 UTC 2025


On Wed, Apr 09, 2025 at 02:49:50PM -0400, Paul Moore wrote:
> Reduce the duplication between the lsm_id struct and the DEFINE_LSM()
> definition by linking the lsm_id struct directly into the individual
> LSM's DEFINE_LSM() instance.
> 
> Linking the lsm_id into the LSM definition also allows us to simplify
> the security_add_hooks() function by removing the code which populates
> the lsm_idlist[] array and moving it into the normal LSM startup code
> where the LSM list is parsed and the individual LSMs are enabled,
> making for a cleaner implementation with less overhead at boot.
> 
> Signed-off-by: Paul Moore <paul at paul-moore.com>

Love it! Much cleaner.

Reviewed-by: Kees Cook <kees at kernel.org>

-- 
Kees Cook



More information about the Linux-security-module-archive mailing list