mirror of
https://github.com/torvalds/linux.git
synced 2026-06-05 21:15:53 +02:00
netem: fix a use after free
[ Upstream commit21de12ee55] 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:2ccccf5fb4("net_sched: update hierarchical backlog too") Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: WANG Cong <xiyou.wangcong@gmail.com> Cc: Jamal Hadi Salim <jhs@mojatatu.com> Cc: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
da7da39bdf
commit
6fb6914d5b
|
|
@ -650,14 +650,14 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch)
|
|||
#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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user