sch_cake: Make sure we can write the IP header before changing DSCP bits
authorToke Høiland-Jørgensen <toke@redhat.com>
Thu, 4 Apr 2019 13:01:33 +0000 (15:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 27 Apr 2019 07:36:32 +0000 (09:36 +0200)
commitcbce0413f783a5a9d49005a2187201df8eb15a38
treec22359a33bc49057c8a50fb562335abbfaa050a9
parent490532225e20f2c3ef763c7da2c4e090ac42318a
sch_cake: Make sure we can write the IP header before changing DSCP bits

[ Upstream commit c87b4ecdbe8db27867a7b7f840291cd843406bd7 ]

There is not actually any guarantee that the IP headers are valid before we
access the DSCP bits of the packets. Fix this using the same approach taken
in sch_dsmark.

Reported-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sched/sch_cake.c