aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/trace-event-scripting.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <[email protected]>2022-09-16 15:37:40 +0100
committerJakub Kicinski <[email protected]>2022-09-20 11:26:14 -0700
commit26c013108c12b94bc023bf19198a4300596c98b1 (patch)
treec713b038b1f48a571e68da4a7035e3a396e40374 /tools/perf/util/trace-event-scripting.c
parent8e25c02b8cce7063ae9f08cad51d246a60370bc9 (diff)
wireguard: netlink: avoid variable-sized memcpy on sockaddr
Doing a variable-sized memcpy is slower, and the compiler isn't smart enough to turn this into a constant-size assignment. Further, Kees' latest fortified memcpy will actually bark, because the destination pointer is type sockaddr, not explicitly sockaddr_in or sockaddr_in6, so it thinks there's an overflow: memcpy: detected field-spanning write (size 28) of single field "&endpoint.addr" at drivers/net/wireguard/netlink.c:446 (size 16) Fix this by just assigning by using explicit casts for each checked case. Fixes: e7096c131e51 ("net: WireGuard secure network tunnel") Signed-off-by: Jason A. Donenfeld <[email protected]> Reviewed-by: Kees Cook <[email protected]> Reported-by: [email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions