Eric Dumazet a720d71dd4 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:12:34 +02:00
..
2023-10-25 11:54:15 +02:00
2023-06-21 15:45:38 +02:00
2024-03-26 18:22:03 -04:00
2024-05-17 11:48:00 +02:00
2024-06-16 13:32:15 +02:00
2024-05-17 11:48:10 +02:00
2023-06-21 15:45:38 +02:00
2023-06-21 15:45:38 +02:00