Commit 3e71447b authored by WANG Cong's avatar WANG Cong Committed by Greg Kroah-Hartman

fq_codel: fix a use-after-free

[ Upstream commit 052cbda4 ]

Fixes: 25331d6c ("net: sched: implement qstat helper routines")
Cc: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarCong Wang <cwang@twopensource.com>
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1b8976fe
...@@ -162,10 +162,10 @@ static unsigned int fq_codel_drop(struct Qdisc *sch) ...@@ -162,10 +162,10 @@ static unsigned int fq_codel_drop(struct Qdisc *sch)
skb = dequeue_head(flow); skb = dequeue_head(flow);
len = qdisc_pkt_len(skb); len = qdisc_pkt_len(skb);
q->backlogs[idx] -= len; q->backlogs[idx] -= len;
kfree_skb(skb);
sch->q.qlen--; sch->q.qlen--;
qdisc_qstats_drop(sch); qdisc_qstats_drop(sch);
qdisc_qstats_backlog_dec(sch, skb); qdisc_qstats_backlog_dec(sch, skb);
kfree_skb(skb);
flow->dropped++; flow->dropped++;
return idx; return idx;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment