aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev_ioctl.c
diff options
context:
space:
mode:
authorKees Cook <[email protected]>2025-05-21 20:46:15 +0000
committerPaolo Abeni <[email protected]>2025-05-27 06:25:43 +0000
commit6b12e0a3c3c9565c7dc106e2a8b1d433b1aa8eb6 (patch)
treee1b2ebd412bdfe544f8dd192b011f7bc9e0801b3 /net/core/dev_ioctl.c
parentnet: core: Convert dev_set_mac_address() to struct sockaddr_storage (diff)
downloadkernel-6b12e0a3c3c9565c7dc106e2a8b1d433b1aa8eb6.tar.gz
kernel-6b12e0a3c3c9565c7dc106e2a8b1d433b1aa8eb6.zip
rtnetlink: do_setlink: Use struct sockaddr_storage
Instead of a heap allocating a variably sized struct sockaddr and lying about the type in the call to netif_set_mac_address(), use a stack allocated struct sockaddr_storage. This lets us drop the cast and avoid the allocation. Putting "ss" on the stack means it will get a reused stack slot since it is the same size (128B) as other existing single-scope stack variables, like the vfinfo array (128B), so no additional stack space is used by this function. Acked-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'net/core/dev_ioctl.c')
0 files changed, 0 insertions, 0 deletions