Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Andrew Lunn
Sun, 22 Nov 2026 04:10
Re: [PATCH net-next] net: zero hw address entries on allocation
Author: Andrew Lunn
Date: Sun, 22 Nov 2026 04:10
Date: Sun, 22 Nov 2026 04:10
22 lines
9131 bytes
9131 bytes
On Sun, Nov 22, 2026 at 09:26:33AM +0900, Yuyang Huang wrote:
> __hw_addr_create() allocates struct netdev_hw_addr with kmalloc() and
> copies only addr_len bytes into ha->addr[MAX_ADDR_LEN], leaving the
> rest uninitialized.
>
> If dev->addr_len later grows while entries remain (e.g., adding a
> multicast address to a down TAP device with SIOCADDMULTI and then
> switching it to ARPHRD_TUNNEL6 via TUNSETLINK), readers using
> dev->addr_len such as /proc/net/dev_mcast and AF_PACKET
> RTM_GETMULTICAST expose the uninitialized trailing slab bytes, and
> __hw_addr_add_ex() reads them in memcmp().
>
> Switch __hw_addr_create() to kzalloc() so the unused tail of ha->addr
> is always zero.
>
> Link: https://lore.kernel.org/netdev/179012275175.2160803.16091441325063775173@kernel.org/
> Signed-off-by: Yuyang Huang <yuyanghuang@google.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads