]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
net_sched: fix a use-after-free in sfq
authorWANG Cong <xiyou.wangcong@gmail.com>
Tue, 14 Jul 2015 18:21:57 +0000 (11:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Jul 2015 04:36:34 +0000 (21:36 -0700)
Fixes: 25331d6ce42b ("net: sched: implement qstat helper routines")
Cc: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_sfq.c

index 7d14926633601b85c2d281d914fa978c8a038e10..52f75a5473e120f8d0a02a2ff1c0215ff02437b5 100644 (file)
@@ -306,10 +306,10 @@ drop:
                len = qdisc_pkt_len(skb);
                slot->backlog -= len;
                sfq_dec(q, x);
-               kfree_skb(skb);
                sch->q.qlen--;
                qdisc_qstats_drop(sch);
                qdisc_qstats_backlog_dec(sch, skb);
+               kfree_skb(skb);
                return len;
        }