Gustavo A. R. Silva 1e3d976dbb flow_dissector: Fix out-of-bounds warning in __skb_flow_bpf_to_target()
Fix the following out-of-bounds warning:

net/core/flow_dissector.c:835:3: warning: 'memcpy' offset [33, 48] from the object at 'flow_keys' is out of the bounds of referenced subobject 'ipv6_src' with type '__u32[4]' {aka 'unsigned int[4]'} at offset 16 [-Warray-bounds]

The problem is that the original code is trying to copy data into a
couple of struct members adjacent to each other in a single call to
memcpy().  So, the compiler legitimately complains about it. As these
are just a couple of members, fix this by copying each one of them in
separate calls to memcpy().

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>
2021-04-16 17:02:27 -07:00
..
2021-03-30 16:54:50 -07:00
2021-03-26 20:41:52 -07:00
2021-03-25 17:05:07 -07:00
2021-04-09 16:34:56 -07:00
2021-03-28 17:31:13 -07:00
2021-03-22 13:17:49 -07:00
2021-03-28 17:31:13 -07:00
2021-01-24 14:27:18 +01:00
2021-03-28 17:52:51 -07:00
2021-03-28 17:31:13 -07:00
2021-03-19 13:38:46 -07:00
2021-03-25 16:56:27 -07:00