linux-stable/net/packet
Eric Dumazet 86d43e2bf9 af_packet: avoid a false positive warning in packet_setsockopt()
Although the code is correct, the following line

	copy_from_sockptr(&req_u.req, optval, len));

triggers this warning :

memcpy: detected field-spanning write (size 28) of single field "dst" at include/linux/sockptr.h:49 (size 16)

Refactor the code to be more explicit.

Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-04-08 13:19:01 +01:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
af_packet.c af_packet: avoid a false positive warning in packet_setsockopt() 2024-04-08 13:19:01 +01:00
diag.c net/packet: Add getsockopt support for PACKET_COPY_THRESH 2024-03-11 15:52:05 -07:00
internal.h packet: Move reference count in packet_sock to atomic_long_t 2023-12-04 14:45:04 -08:00