mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2026-01-28 11:18:01 +00:00
Fix the following out-of-bounds warning: net/ethtool/ioctl.c:492:2: warning: 'memcpy' offset [49, 84] from the object at 'link_usettings' is out of the bounds of referenced subobject 'base' with type 'struct ethtool_link_settings' at offset 0 [-Warray-bounds] The problem is that the original code is trying to copy data into a some struct members adjacent to each other in a single call to memcpy(). This causes a legitimate compiler warning because memcpy() overruns the length of &link_usettings.base. Fix this by directly using &link_usettings and _from_ as destination and source addresses, instead. This helps with the ongoing efforts to globally enable -Warray-bounds and get us closer to being able to tighten the FORTIFY_SOURCE routines on memcpy(). Link: https://github.com/KSPP/linux/issues/109 Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net> |
||
|---|---|---|
| .. | ||
| bitset.c | ||
| bitset.h | ||
| cabletest.c | ||
| channels.c | ||
| coalesce.c | ||
| common.c | ||
| common.h | ||
| debug.c | ||
| eee.c | ||
| eeprom.c | ||
| features.c | ||
| fec.c | ||
| ioctl.c | ||
| linkinfo.c | ||
| linkmodes.c | ||
| linkstate.c | ||
| Makefile | ||
| netlink.c | ||
| netlink.h | ||
| pause.c | ||
| privflags.c | ||
| rings.c | ||
| stats.c | ||
| strset.c | ||
| tsinfo.c | ||
| tunnels.c | ||
| wol.c | ||