Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net-next] net: sched: do not allocate a tracker in tcf_exts_init()
@ 2022-01-10  9:47 Eric Dumazet
  2022-01-12  4:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2022-01-10  9:47 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski
  Cc: netdev, Eric Dumazet, Eric Dumazet, syzbot

From: Eric Dumazet <edumazet@google.com>

While struct tcf_exts has a net pointer, it is not refcounted
until tcf_exts_get_net() is called.

Fixes: dbdcda634ce3 ("net: sched: add netns refcount tracker to struct tcf_exts")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
---
 include/net/pkt_cls.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index ebef45e821afd51e407dc19d83d0ad10759e7aba..676cb8ea9e15cae4b098b461918ea0ff49d97768 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -218,8 +218,10 @@ static inline int tcf_exts_init(struct tcf_exts *exts, struct net *net,
 #ifdef CONFIG_NET_CLS_ACT
 	exts->type = 0;
 	exts->nr_actions = 0;
+	/* Note: we do not own yet a reference on net.
+	 * This reference might be taken later from tcf_exts_get_net().
+	 */
 	exts->net = net;
-	netns_tracker_alloc(net, &exts->ns_tracker, GFP_KERNEL);
 	exts->actions = kcalloc(TCA_ACT_MAX_PRIO, sizeof(struct tc_action *),
 				GFP_KERNEL);
 	if (!exts->actions)
-- 
2.34.1.575.g55b058a8bb-goog


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

* Re: [PATCH net-next] net: sched: do not allocate a tracker in tcf_exts_init()
  2022-01-10  9:47 [PATCH net-next] net: sched: do not allocate a tracker in tcf_exts_init() Eric Dumazet
@ 2022-01-12  4:50 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-01-12  4:50 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: davem, kuba, netdev, edumazet, syzkaller

Hello:

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

On Mon, 10 Jan 2022 01:47:50 -0800 you wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> While struct tcf_exts has a net pointer, it is not refcounted
> until tcf_exts_get_net() is called.
> 
> Fixes: dbdcda634ce3 ("net: sched: add netns refcount tracker to struct tcf_exts")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: syzbot <syzkaller@googlegroups.com>
> 
> [...]

Here is the summary with links:
  - [net-next] net: sched: do not allocate a tracker in tcf_exts_init()
    https://git.kernel.org/netdev/net/c/cb963a19d99f

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] 2+ messages in thread

end of thread, other threads:[~2022-01-12  4:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-10  9:47 [PATCH net-next] net: sched: do not allocate a tracker in tcf_exts_init() Eric Dumazet
2022-01-12  4:50 ` 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;
as well as URLs for NNTP newsgroup(s).