lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 8 Dec 2023 16:07:55 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Dmitry Antipov <dmantipov@...dex.ru>
Cc: Ɓukasz Stelmach <l.stelmach@...sung.com>,
 netdev@...r.kernel.org
Subject: Re: [PATCH] net: asix: fix fortify warning

On Wed,  6 Dec 2023 16:38:04 +0300 Dmitry Antipov wrote:
> When compiling with gcc version 14.0.0 20231129 (experimental) and
> CONFIG_FORTIFY_SOURCE=y, I've noticed the following warning:
> 
> ...
> In function 'fortify_memcpy_chk',
>     inlined from 'ax88796c_tx_fixup' at drivers/net/ethernet/asix/ax88796c_main.c:287:2:
> ./include/linux/fortify-string.h:588:25: warning: call to '__read_overflow2_field'
> declared with attribute warning: detected read beyond size of field (2nd parameter);
> maybe use struct_group()? [-Wattribute-warning]
>   588 |                         __read_overflow2_field(q_size_field, size);
>       |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ...
> 
> This call to 'memcpy()' is interpreted as an attempt to copy TX_OVERHEAD
> (which is 8) bytes from 4-byte 'sop' field of 'struct tx_pkt_info' and
> thus overread warning is issued. Since we actually wants to copy both
> 'sop' and 'seg' fields at once, use the convenient 'struct_group()' here.

Can we change the definition of TX_OVERHEAD to be
sizeof_field(... tx_overhead), to make it clear that
the two are indeed identical?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ