diff options
author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2021-04-16 14:31:51 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-19 10:12:57 +0200 |
commit | 245f5ab5ce5226aaaa5173c59e5fa89ea4219b41 (patch) | |
tree | 487885b1cf4dd1f2e255c10a3ee53b5f6e9f84fe /.cocciconfig | |
parent | d5716625f185be6960732694eb9d37bca9073464 (diff) |
flow_dissector: Fix out-of-bounds warning in __skb_flow_bpf_to_target()
[ Upstream commit 1e3d976dbb23b3fce544752b434bdc32ce64aabc ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to '.cocciconfig')
0 files changed, 0 insertions, 0 deletions