summaryrefslogtreecommitdiff
path: root/net/core/rtnetlink.c
diff options
context:
space:
mode:
authorKees Cook <kees@kernel.org>2025-05-21 13:46:10 -0700
committerPaolo Abeni <pabeni@redhat.com>2025-05-27 08:25:42 +0200
commit161972650d6795ea00f8b72557cf3c3e593ed250 (patch)
treeae9e97e5674b98f5d107343c70786b43775e19e3 /net/core/rtnetlink.c
parented449ddbd867f2cc02d6890c231431f264a876eb (diff)
downloadlinux-161972650d6795ea00f8b72557cf3c3e593ed250.tar.gz
linux-161972650d6795ea00f8b72557cf3c3e593ed250.tar.bz2
linux-161972650d6795ea00f8b72557cf3c3e593ed250.zip
net: core: Switch netif_set_mac_address() to struct sockaddr_storage
In order to avoid passing around struct sockaddr that has a size the compiler cannot reason about (nor track at runtime), convert netif_set_mac_address() to take struct sockaddr_storage. This is just a cast conversion, so there is are no binary changes. Following patches will make actual allocation changes. Acked-by: Gustavo A. R. Silva <gustavoars@kernel.org> Signed-off-by: Kees Cook <kees@kernel.org> Link: https://patch.msgid.link/20250521204619.2301870-2-kees@kernel.org Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/core/rtnetlink.c')
-rw-r--r--net/core/rtnetlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 8a914b37ef6e..9743f1c2ae3c 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -3100,7 +3100,7 @@ static int do_setlink(const struct sk_buff *skb, struct net_device *dev,
memcpy(sa->sa_data, nla_data(tb[IFLA_ADDRESS]),
dev->addr_len);
- err = netif_set_mac_address(dev, sa, extack);
+ err = netif_set_mac_address(dev, (struct sockaddr_storage *)sa, extack);
kfree(sa);
if (err) {
up_write(&dev_addr_sem);