2022-05-11 08:57:48

by Iwashima, Kuniyuki

[permalink] [raw]
Subject: Re: [PATCH] af_unix: Silence randstruct GCC plugin warning

From: Kees Cook <[email protected]>
Date: Tue, 10 May 2022 17:01:09 -0700
> While preparing for Clang randstruct support (which duplicated many of
> the warnings the randstruct GCC plugin warned about), one strange one
> remained only for the randstruct GCC plugin. Eliminating this rids
> the plugin of the last exception.
>
> It seems the plugin is happy to dereference individual members of
> a cross-struct cast, but it is upset about casting to a whole object
> pointer. This only manifests in one place in the kernel, so just replace
> the variable with individual member accesses. There is no change in
> executable instruction output.
>
> Drop the last exception from the randstruct GCC plugin.
>
> Cc: "David S. Miller" <[email protected]>
> Cc: Jakub Kicinski <[email protected]>
> Cc: Christoph Hellwig <[email protected]>
> Cc: Paolo Abeni <[email protected]>
> Cc: Kuniyuki Iwashima <[email protected]>
> Cc: Alexei Starovoitov <[email protected]>
> Cc: Cong Wang <[email protected]>
> Cc: Al Viro <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Kees Cook <[email protected]>

LGTM, thank you.

Acked-by: Kuniyuki Iwashima <[email protected]>