public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: sched: cls_api: fix tc_chain_fill_node to initialize tcm_info to zero to prevent an info-leak
@ 2026-03-28 21:14 Yochai Eisenrich
  2026-03-29 12:16 ` Jamal Hadi Salim
  2026-03-31  1:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Yochai Eisenrich @ 2026-03-28 21:14 UTC (permalink / raw)
  To: David S . Miller
  Cc: Yochai Eisenrich, Jamal Hadi Salim, Jiri Pirko, security, netdev

When building netlink messages, tc_chain_fill_node() never initializes
the tcm_info field of struct tcmsg. Since the allocation is not zeroed,
kernel heap memory is leaked to userspace through this 4-byte field.

The fix simply zeroes tcm_info alongside the other fields that are
already initialized.

Fixes: 32a4f5ecd738 ("net: sched: introduce chain object to uapi")
Signed-off-by: Yochai Eisenrich <echelonh@gmail.com>

---
 net/sched/cls_api.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 4829c27446e3..20f7f9ee0b35 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -2969,6 +2969,7 @@ static int tc_chain_fill_node(const struct tcf_proto_ops *tmplt_ops,
 	tcm->tcm__pad1 = 0;
 	tcm->tcm__pad2 = 0;
 	tcm->tcm_handle = 0;
+	tcm->tcm_info = 0;
 	if (block->q) {
 		tcm->tcm_ifindex = qdisc_dev(block->q)->ifindex;
 		tcm->tcm_parent = block->q->handle;
--
2.53.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: sched: cls_api: fix tc_chain_fill_node to initialize tcm_info to zero to prevent an info-leak
  2026-03-28 21:14 [PATCH] net: sched: cls_api: fix tc_chain_fill_node to initialize tcm_info to zero to prevent an info-leak Yochai Eisenrich
@ 2026-03-29 12:16 ` Jamal Hadi Salim
  2026-03-31  1:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Jamal Hadi Salim @ 2026-03-29 12:16 UTC (permalink / raw)
  To: Yochai Eisenrich; +Cc: David S . Miller, Jiri Pirko, security, netdev

On Sat, Mar 28, 2026 at 5:14 PM Yochai Eisenrich <echelonh@gmail.com> wrote:
>
> When building netlink messages, tc_chain_fill_node() never initializes
> the tcm_info field of struct tcmsg. Since the allocation is not zeroed,
> kernel heap memory is leaked to userspace through this 4-byte field.
>
> The fix simply zeroes tcm_info alongside the other fields that are
> already initialized.
>
> Fixes: 32a4f5ecd738 ("net: sched: introduce chain object to uapi")
> Signed-off-by: Yochai Eisenrich <echelonh@gmail.com>

Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal

> ---
>  net/sched/cls_api.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
> index 4829c27446e3..20f7f9ee0b35 100644
> --- a/net/sched/cls_api.c
> +++ b/net/sched/cls_api.c
> @@ -2969,6 +2969,7 @@ static int tc_chain_fill_node(const struct tcf_proto_ops *tmplt_ops,
>         tcm->tcm__pad1 = 0;
>         tcm->tcm__pad2 = 0;
>         tcm->tcm_handle = 0;
> +       tcm->tcm_info = 0;
>         if (block->q) {
>                 tcm->tcm_ifindex = qdisc_dev(block->q)->ifindex;
>                 tcm->tcm_parent = block->q->handle;
> --
> 2.53.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: sched: cls_api: fix tc_chain_fill_node to initialize tcm_info to zero to prevent an info-leak
  2026-03-28 21:14 [PATCH] net: sched: cls_api: fix tc_chain_fill_node to initialize tcm_info to zero to prevent an info-leak Yochai Eisenrich
  2026-03-29 12:16 ` Jamal Hadi Salim
@ 2026-03-31  1:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-03-31  1:00 UTC (permalink / raw)
  To: Yochai E; +Cc: davem, jhs, jiri, security, netdev

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sun, 29 Mar 2026 00:14:36 +0300 you wrote:
> When building netlink messages, tc_chain_fill_node() never initializes
> the tcm_info field of struct tcmsg. Since the allocation is not zeroed,
> kernel heap memory is leaked to userspace through this 4-byte field.
> 
> The fix simply zeroes tcm_info alongside the other fields that are
> already initialized.
> 
> [...]

Here is the summary with links:
  - net: sched: cls_api: fix tc_chain_fill_node to initialize tcm_info to zero to prevent an info-leak
    https://git.kernel.org/netdev/net/c/e6e3eb5ee89a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-31  1:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-28 21:14 [PATCH] net: sched: cls_api: fix tc_chain_fill_node to initialize tcm_info to zero to prevent an info-leak Yochai Eisenrich
2026-03-29 12:16 ` Jamal Hadi Salim
2026-03-31  1:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox