Re: [PATCH] NFC: hci: Split memcpy() of struct hcp_message flexible array
From: Krzysztof Kozlowski
Date: Sat Sep 24 2022 - 05:28:56 EST
On 24/09/2022 06:08, Kees Cook wrote:
> To work around a misbehavior of the compiler's ability to see into
> composite flexible array structs (as detailed in the coming memcpy()
> hardening series[1]), split the memcpy() of the header and the payload
> so no false positive run-time overflow warning will be generated. This
> split already existed for the "firstfrag" case, so just generalize the
> logic further.
>
> [1] https://lore.kernel.org/linux-hardening/20220901065914.1417829-2-keescook@xxxxxxxxxxxx/
>
Looks correct:
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
Best regards,
Krzysztof