[PATCH] security: don't treat structure as an array of struct hlist_head
Kees Cook
keescook at chromium.org
Tue Apr 12 17:26:04 UTC 2022
On Thu, Apr 07, 2022 at 10:59:30AM -0700, Bill Wendling wrote:
> The initialization of "security_hook_heads" is done by casting it to
> another structure pointer type, and treating it as an array of "struct
> hlist_head" objects. This requires an exception be made in "randstruct",
> because otherwise it will emit an error, reducing the effectiveness of
> the hardening technique.
>
> Instead of using a cast, initialize the individual struct hlist_head
> elements in security_hook_heads explicitly. This removes the need for
> the cast and randstruct exception.
>
> Signed-off-by: Bill Wendling <morbo at google.com>
> Cc: Kees Cook <keescook at chromium.org>
Ah! Yes, thanks. This is a good solution for this. I'd rather not have
any exceptions in the randstruct plugin. :) I'll take this via the
hardening tree unless anyone objects.
-Kees
--
Kees Cook
More information about the Linux-security-module-archive
mailing list