projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
29b3881
)
net: sched: do not allocate a tracker in tcf_exts_init()
author
Eric Dumazet
<edumazet@google.com>
Mon, 10 Jan 2022 09:47:50 +0000
(
01:47
-0800)
committer
Jakub Kicinski
<kuba@kernel.org>
Wed, 12 Jan 2022 04:40:16 +0000
(20:40 -0800)
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>
Link:
https://lore.kernel.org/r/20220110094750.236478-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/pkt_cls.h
patch
|
blob
|
history
diff --git
a/include/net/pkt_cls.h
b/include/net/pkt_cls.h
index
ebef45e
..
676cb8e
100644
(file)
--- 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)