Re: [PATCH] net: fix uninitialized heap leak in multicast address dumps

From: Nicolas Dichtel

Date: Mon Nov 16 2026 - 04:04:36 EST


Le 16/11/2026 à 03:40, Henry Martin a écrit :
> __hw_addr_create() allocates entries with kmalloc() and initializes
> only addr_len bytes of ha->addr. Dump paths emit entries using the
> current dev->addr_len, which can grow after the entry was created:
> tun's TUNSETLINK changes a device from ARPHRD_NONE (addr_len 0) to
> ARPHRD_IP6GRE (addr_len 16). Both the RTM_GETMULTICAST dump and
> /proc/net/dev_mcast then emit up to 16 bytes of never-written slab
> memory per entry.
>
> This discloses leftover kernel heap contents to anyone reading those
> interfaces.
>
> Zero the tail of ha->addr at creation time, so dumps can only emit
> initialized bytes.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: a748ee242681 ("net: move address list functions to a separate file")
> Link: https://lists.openwall.net/linux-kernel/2026/09/10/320
> Signed-off-by: Henry Martin <bsdhenrymartin@xxxxxxxxx>

Reviewed-by: Nicolas Dichtel <nicolas.dichtel@xxxxxxxxx>