[PATCH 1/2] LSM: Initialize security_hook_heads upon registration.
Kees Cook
keescook at chromium.org
Wed Mar 22 18:12:59 UTC 2017
On Wed, Mar 22, 2017 at 3:46 AM, Tetsuo Handa
<penguin-kernel at i-love.sakura.ne.jp> wrote:
> "struct security_hook_heads" is an array of "struct list_head"
> where elements can be initialized just before registration.
>
> We might introduce different "struct security_hook_heads" for built-in
> LSM modules and dynamically loadable LSM modules when we start allowing
> dynamically loadable LSM modules. But even if we decide to use different
> lists, there is no need to waste 350+ lines for initialization. Let's
> initialize "struct security_hook_heads" just before registration.
>
> Signed-off-by: Tetsuo Handa <penguin-kernel at I-love.SAKURA.ne.jp>
> Cc: John Johansen <john.johansen at canonical.com>
> Cc: Kees Cook <keescook at chromium.org>
> Cc: Paul Moore <paul at paul-moore.com>
> Cc: Stephen Smalley <sds at tycho.nsa.gov>
> Cc: Casey Schaufler <casey at schaufler-ca.com>
> Cc: James Morris <james.l.morris at oracle.com>
This seems nice to me! struct security_hook_heads is really just a
named array. :) If we wanted to do this without cast, we could convert
the named list_heads to an enum, but that should likely be a separate
change.
Acked-by: Kees Cook <keescook at chromium.org>
-Kees
--
Kees Cook
Pixel Security
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
More information about the Linux-security-module-archive
mailing list