diff options
author | GONG, Ruiqi <gongruiqi1@huawei.com> | 2023-08-21 04:32:18 +0300 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2023-08-22 13:30:15 +0300 |
commit | 3a198c95c95da10ad844cbeade2fe40bdf14c411 (patch) | |
tree | 7bbba25268a9059ccd569310cfdc214b492834b5 /net/core/dst.c | |
parent | 90308679c297ffcbb317c715ef434e9fb3c881dc (diff) | |
download | linux-3a198c95c95da10ad844cbeade2fe40bdf14c411.tar.xz |
alx: fix OOB-read compiler warning
The following message shows up when compiling with W=1:
In function ‘fortify_memcpy_chk’,
inlined from ‘alx_get_ethtool_stats’ at drivers/net/ethernet/atheros/alx/ethtool.c:297:2:
./include/linux/fortify-string.h:592:4: error: call to ‘__read_overflow2_field’
declared with attribute warning: detected read beyond size of field (2nd parameter);
maybe use struct_group()? [-Werror=attribute-warning]
592 | __read_overflow2_field(q_size_field, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In order to get alx stats altogether, alx_get_ethtool_stats() reads
beyond hw->stats.rx_ok. Fix this warning by directly copying hw->stats,
and refactor the unnecessarily complicated BUILD_BUG_ON btw.
Signed-off-by: GONG, Ruiqi <gongruiqi1@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20230821013218.1614265-1-gongruiqi@huaweicloud.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/core/dst.c')
0 files changed, 0 insertions, 0 deletions