[PATCH 2/2] nvme: trace: avoid memcpy overflow warning

Keith Busch kbusch at kernel.org
Fri Jan 5 12:25:12 PST 2024


On Wed, Jan 03, 2024 at 04:56:56PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd at arndb.de>
> 
> A previous patch introduced a struct_group() in nvme_common_command to help
> stringop fortification figure out the length of the fields, but one function
> is not currently using them:
> 
> In file included from drivers/nvme/target/core.c:7:
> In file included from include/linux/string.h:254:
> include/linux/fortify-string.h:592:4: error: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror,-Wattribute-warning]
>                         __read_overflow2_field(q_size_field, size);
>                         ^
> 
> Change this one to use the correct field name to avoid the warning.
> 
> Fixes: 5c629dc9609dc ("nvme: use struct group for generic command dwords")
> Signed-off-by: Arnd Bergmann <arnd at arndb.de>

Thanks, applied to nvme-6.8 with Christoph's line-wrap suggestion.



More information about the Linux-nvme mailing list