From: WANG Cong Date: Mon, 13 Jul 2015 19:30:07 +0000 (-0700) Subject: fq_codel: fix a use-after-free X-Git-Tag: v4.9.8~3868^2~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=052cbda41fdc243a8d40cce7ab3a6327b4b2887e;p=platform%2Fkernel%2Flinux-rpi3.git fq_codel: fix a use-after-free Fixes: 25331d6ce42b ("net: sched: implement qstat helper routines") Cc: John Fastabend Signed-off-by: Cong Wang Signed-off-by: Cong Wang Acked-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c index d75993f..06e7c84 100644 --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c @@ -155,10 +155,10 @@ static unsigned int fq_codel_drop(struct Qdisc *sch) skb = dequeue_head(flow); len = qdisc_pkt_len(skb); q->backlogs[idx] -= len; - kfree_skb(skb); sch->q.qlen--; qdisc_qstats_drop(sch); qdisc_qstats_backlog_dec(sch, skb); + kfree_skb(skb); flow->dropped++; return idx; }