Re: [PATCH 4.9 1/1] LSM: Initialize security_hook_heads upon registration.

Greg KH
2022-08-11T12:18:00Z

On Thu, Aug 11, 2022 at 01:53:40PM +0200, Alexander Grund wrote:
> From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
>
> commit 3dfc9b02864b19f4dab376f14479ee4ad1de6c9e upstream.
>
> "struct security_hook_heads" is an array of "struct list_head"
> where elements can be initialized just before registration.
>
> 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@I-love.SAKURA.ne.jp>
> Acked-by: Kees Cook <keescook@chromium.org>
> Cc: John Johansen <john.johansen@canonical.com>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Paul Moore <paul@paul-moore.com>
> Cc: Stephen Smalley <sds@tycho.nsa.gov>
> Cc: Casey Schaufler <casey@schaufler-ca.com>
> Cc: James Morris <james.l.morris@oracle.com>
> Signed-off-by: James Morris <james.l.morris@oracle.com>
> [ bp: 4.9 backported: Adjust for changed hooks and missing __lsm_ro_after_init ]
> Signed-off-by: Alexander Grund <theflamefire89@gmail.com>
> ---
> security/security.c | 359 +-------------------------------------------
> 1 file changed, 7 insertions(+), 352 deletions(-)

As this fixes no bug or real issue that anyone is having with 4.9, why
is this needed?

What devices and users would benefit from this that would need it for
the next 5 months only before they move to 4.14.y? And why aren't those
users on 4.14.y already?

thanks,

greg k-h