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:
817e9f2
)
netem: fix a use after free
author
Eric Dumazet
<
[email protected]
>
Mon, 20 Jun 2016 22:00:43 +0000
(15:00 -0700)
committer
David S. Miller
<
[email protected]
>
Thu, 23 Jun 2016 19:07:44 +0000
(15:07 -0400)
If the packet was dropped by lower qdisc, then we must not
access it later.
Save qdisc_pkt_len(skb) in a temp variable.
Fixes: 2ccccf5fb43f ("net_sched: update hierarchical backlog too")
Signed-off-by: Eric Dumazet <
[email protected]
>
Cc: WANG Cong <
[email protected]
>
Cc: Jamal Hadi Salim <
[email protected]
>
Cc: Stephen Hemminger <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/sched/sch_netem.c
patch
|
blob
|
history
diff --git
a/net/sched/sch_netem.c
b/net/sched/sch_netem.c
index 205bed00dd3463c62696ecc61eb78f2c97b3d0c9..178f1630a036414629aed50256cf6a8c3a105984 100644
(file)
--- a/
net/sched/sch_netem.c
+++ b/
net/sched/sch_netem.c
@@
-650,14
+650,14
@@
deliver:
#endif
if (q->qdisc) {
+ unsigned int pkt_len = qdisc_pkt_len(skb);
int err = qdisc_enqueue(skb, q->qdisc);
- if (unlikely(err != NET_XMIT_SUCCESS)) {
- if (net_xmit_drop_count(err)) {
- qdisc_qstats_drop(sch);
- qdisc_tree_reduce_backlog(sch, 1,
- qdisc_pkt_len(skb));
- }
+ if (err != NET_XMIT_SUCCESS &&
+ net_xmit_drop_count(err)) {
+ qdisc_qstats_drop(sch);
+ qdisc_tree_reduce_backlog(sch, 1,
+ pkt_len);
}
goto tfifo_dequeue;
}