WSL2-Linux-Kernel/net/packet
Eric Dumazet 03ea65b91f af_packet: avoid a false positive warning in packet_setsockopt()
[ Upstream commit 86d43e2bf93ccac88ef71cee36a23282ebd9e427 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-07-05 09:14:26 +02:00
..
Kconfig
Makefile
af_packet.c af_packet: avoid a false positive warning in packet_setsockopt() 2024-07-05 09:14:26 +02:00
diag.c af_packet: Fix data-races of pkt_sk(sk)->num. 2023-06-09 10:32:16 +02:00
internal.h packet: Move reference count in packet_sock to atomic_long_t 2023-12-13 18:36:43 +01:00