projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1006da1
)
net_sched: fix a use-after-free in tc_ctl_tfilter()
author
WANG Cong
<
[email protected]
>
Tue, 5 May 2015 22:22:02 +0000
(15:22 -0700)
committer
David S. Miller
<
[email protected]
>
Sat, 9 May 2015 20:14:04 +0000
(16:14 -0400)
When tcf_destroy() returns true, tp could be already destroyed,
we should not use tp->next after that.
For long term, we probably should move tp list to list_head.
Fixes: 1e052be69d04 ("net_sched: destroy proto tp when all filters are gone")
Cc: Jamal Hadi Salim <
[email protected]
>
Signed-off-by: Cong Wang <
[email protected]
>
Acked-by: Jamal Hadi Salim <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/sched/cls_api.c
patch
|
blob
|
history
diff --git
a/net/sched/cls_api.c
b/net/sched/cls_api.c
index 8b0470e418dc6e9475464768d629969087e66b37..b6ef9a04de06f411b844b055102b12ca49877707 100644
(file)
--- a/
net/sched/cls_api.c
+++ b/
net/sched/cls_api.c
@@
-308,12
+308,11
@@
replay:
case RTM_DELTFILTER:
err = tp->ops->delete(tp, fh);
if (err == 0) {
- tfilter_notify(net, skb, n, tp, fh, RTM_DELTFILTER);
- if (tcf_destroy(tp, false)) {
- struct tcf_proto *next = rtnl_dereference(tp->next);
+ struct tcf_proto *next = rtnl_dereference(tp->next);
+ tfilter_notify(net, skb, n, tp, fh, RTM_DELTFILTER);
+ if (tcf_destroy(tp, false))
RCU_INIT_POINTER(*back, next);
- }
}
goto errout;
case RTM_GETTFILTER: