]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
net: netem: fix backlog accounting for corrupted GSO frames
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 17 Jun 2019 18:11:10 +0000 (11:11 -0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
commit2ed3362cda0df371433c4c6066ceebd2666b1818
tree55a5d809c4fbfe6b12d8660f1b1465b0db5816fe
parent0bc44511417ce0d1545e52406ffcb6ed58b21d4b
net: netem: fix backlog accounting for corrupted GSO frames

BugLink: https://bugs.launchpad.net/bugs/1863019
[ Upstream commit 177b8007463c4f36c9a2c7ce7aa9875a4cad9bd5 ]

When GSO frame has to be corrupted netem uses skb_gso_segment()
to produce the list of frames, and re-enqueues the segments one
by one.  The backlog length has to be adjusted to account for
new frames.

The current calculation is incorrect, leading to wrong backlog
lengths in the parent qdisc (both bytes and packets), and
incorrect packet backlog count in netem itself.

Parent backlog goes negative, netem's packet backlog counts
all non-first segments twice (thus remaining non-zero even
after qdisc is emptied).

Move the variables used to count the adjustment into local
scope to make 100% sure they aren't used at any stage in
backports.

Fixes: 6071bd1aa13e ("netem: Segment GSO packets on enqueue")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/sched/sch_netem.c