diff options
author | Toke Høiland-Jørgensen <toke@redhat.com> | 2019-01-09 17:09:42 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-01-16 05:12:00 +0100 |
commit | f6bab199315b70fd83fe3ee0947bc84c7a35f3d4 (patch) | |
tree | c662d696e0bfe2ee2be86cbdf0da095d9d6389ba /net/sched/sch_prio.c | |
parent | ip6_gre: update version related info when changing link (diff) | |
download | linux-f6bab199315b70fd83fe3ee0947bc84c7a35f3d4.tar.xz linux-f6bab199315b70fd83fe3ee0947bc84c7a35f3d4.zip |
sched: Avoid dereferencing skb pointer after child enqueue
Parent qdiscs may dereference the pointer to the enqueued skb after
enqueue. However, both CAKE and TBF call consume_skb() on the original skb
when splitting GSO packets, leading to a potential use-after-free in the
parent. Fix this by avoiding dereferencing the skb pointer after enqueueing
to the child.
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_prio.c')
-rw-r--r-- | net/sched/sch_prio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index cdf68706e40f..847141cd900f 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c @@ -72,6 +72,7 @@ prio_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr) static int prio_enqueue(struct sk_buff *skb, struct Qdisc *sch, struct sk_buff **to_free) { + unsigned int len = qdisc_pkt_len(skb); struct Qdisc *qdisc; int ret; @@ -88,7 +89,7 @@ prio_enqueue(struct sk_buff *skb, struct Qdisc *sch, struct sk_buff **to_free) ret = qdisc_enqueue(skb, qdisc, to_free); if (ret == NET_XMIT_SUCCESS) { - qdisc_qstats_backlog_inc(sch, skb); + sch->qstats.backlog += len; sch->q.qlen++; return NET_XMIT_SUCCESS; } |