* [PATCH] net: fix uninitialized heap leak in multicast address dumps
@ 2026-11-16 2:40 Henry Martin
2026-11-16 2:43 ` netdev-bot+sinfo
2026-11-16 9:04 ` Nicolas Dichtel
0 siblings, 2 replies; 3+ messages in thread
From: Henry Martin @ 2026-11-16 2:40 UTC (permalink / raw)
To: Paolo Abeni, David S . Miller, Eric Dumazet, Jakub Kicinski,
Simon Horman, Stanislav Fomichev, Nicolas Dichtel, Yuyang Huang,
Aleksandr Loktionov
Cc: netdev, linux-kernel, Henry Martin, stable
__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@vger.kernel.org
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@gmail.com>
---
net/core/dev_addr_lists.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index d827cc21867b..53a2dfa2706c 100644
--- a/net/core/dev_addr_lists.c
+++ b/net/core/dev_addr_lists.c
@@ -100,6 +100,11 @@ __hw_addr_create(const unsigned char *addr, int addr_len,
if (!ha)
return NULL;
memcpy(ha->addr, addr, addr_len);
+ /* Entries are dumped with the current dev->addr_len, which can grow
+ * after creation (e.g. tun TUNSETLINK), so never leave the tail
+ * uninitialized.
+ */
+ memset(ha->addr + addr_len, 0, MAX_ADDR_LEN - addr_len);
ha->type = addr_type;
ha->refcount = 1;
ha->global_use = global;
--
2.43.7
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: fix uninitialized heap leak in multicast address dumps
2026-11-16 2:40 [PATCH] net: fix uninitialized heap leak in multicast address dumps Henry Martin
@ 2026-11-16 2:43 ` netdev-bot+sinfo
2026-11-16 9:04 ` Nicolas Dichtel
1 sibling, 0 replies; 3+ messages in thread
From: netdev-bot+sinfo @ 2026-11-16 2:43 UTC (permalink / raw)
To: Henry Martin
Cc: Paolo Abeni, David S . Miller, Eric Dumazet, Jakub Kicinski,
Simon Horman, Stanislav Fomichev, Nicolas Dichtel, Yuyang Huang,
Aleksandr Loktionov, netdev, linux-kernel, stable
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical
(e.g. found by LLM and not proven at runtime). If it was triggered
please include the symptoms, like the stack trace or kernel messages.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.
*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
--
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: fix uninitialized heap leak in multicast address dumps
2026-11-16 2:40 [PATCH] net: fix uninitialized heap leak in multicast address dumps Henry Martin
2026-11-16 2:43 ` netdev-bot+sinfo
@ 2026-11-16 9:04 ` Nicolas Dichtel
1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Dichtel @ 2026-11-16 9:04 UTC (permalink / raw)
To: Henry Martin, Paolo Abeni, David S . Miller, Eric Dumazet,
Jakub Kicinski, Simon Horman, Stanislav Fomichev, Yuyang Huang,
Aleksandr Loktionov
Cc: netdev, linux-kernel, stable
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@vger.kernel.org
> 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@gmail.com>
Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-16 9:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-16 2:40 [PATCH] net: fix uninitialized heap leak in multicast address dumps Henry Martin
2026-11-16 2:43 ` netdev-bot+sinfo
2026-11-16 9:04 ` Nicolas Dichtel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®