Subject: Re: [PATCH v3 net 0/2] net: Fix error/warning by -fstrict-flex-arrays=3.

From: Kees Cook <[email-masked]>
Date: Tue, 25 Jul 2023 11:05:21 -0700

On Mon, Jul 24, 2023 at 02:34:23PM -0700, Kuniyuki Iwashima wrote:
> df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") started applying
> strict rules for standard string functions (strlen(), memcpy(), etc.) if
> CONFIG_FORTIFY_SOURCE=y.
> 
> This series fixes two false positives caught by syzkaller.
> 
> 
> Changes:
>   v3:
>     * Drop Reviewed-by
>     * Patch 1: Use strnlen()
>     * Patch 2: Add a new flex array member
> 
>   v2: https://lore.kernel.org/netdev/[email-masked]/
>     * Patch 2: Fix offset calc.
> 
>   v1: https://lore.kernel.org/netdev/[email-masked]/
> 
> 
> Kuniyuki Iwashima (2):
>   af_unix: Fix fortify_panic() in unix_bind_bsd().
>   af_packet: Fix warning of fortified memcpy() in packet_getname().
> 
>  include/uapi/linux/if_packet.h | 6 +++++-
>  net/packet/af_packet.c         | 2 +-
>  net/unix/af_unix.c             | 6 ++----
>  3 files changed, 8 insertions(+), 6 deletions(-)
> 
> -- 
> 2.30.2
> 

Thanks for updating and testing!

Reviewed-by: Kees Cook <[email-masked]>

-- 
Kees Cook