Re: [Cake] [PATCH net 2/2] sch_cake: Make sure we can write the IP header before changing DSCP bits

2019-04-04 Thread Toke Høiland-Jørgensen
Stephen Hemminger writes: > On Thu, 04 Apr 2019 22:44:33 +0200 > Toke Høiland-Jørgensen wrote: > >> Stephen Hemminger writes: >> >> > On Thu, 04 Apr 2019 15:01:33 +0200 >> > Toke Høiland-Jørgensen wrote: >> > >> >> static u8 cake_handle_diffserv(struct sk_buff *skb, u16 wash) >> >> { >>

Re: [Cake] [PATCH net 2/2] sch_cake: Make sure we can write the IP header before changing DSCP bits

2019-04-04 Thread Stephen Hemminger
On Thu, 04 Apr 2019 22:44:33 +0200 Toke Høiland-Jørgensen wrote: > Stephen Hemminger writes: > > > On Thu, 04 Apr 2019 15:01:33 +0200 > > Toke Høiland-Jørgensen wrote: > > > >> static u8 cake_handle_diffserv(struct sk_buff *skb, u16 wash) > >> { > >> + int wlen = skb_network_offset(skb);

Re: [Cake] [PATCH net 2/2] sch_cake: Make sure we can write the IP header before changing DSCP bits

2019-04-04 Thread Toke Høiland-Jørgensen
Stephen Hemminger writes: > On Thu, 04 Apr 2019 15:01:33 +0200 > Toke Høiland-Jørgensen wrote: > >> static u8 cake_handle_diffserv(struct sk_buff *skb, u16 wash) >> { >> +int wlen = skb_network_offset(skb); > > In theory this could be negative, you should handle that? > Rather than

Re: [Cake] [PATCH net 2/2] sch_cake: Make sure we can write the IP header before changing DSCP bits

2019-04-04 Thread Stephen Hemminger
On Thu, 04 Apr 2019 15:01:33 +0200 Toke Høiland-Jørgensen wrote: > static u8 cake_handle_diffserv(struct sk_buff *skb, u16 wash) > { > + int wlen = skb_network_offset(skb); In theory this could be negative, you should handle that? Rather than calling may_pull() with a huge unsigned value.

Re: [Cake] [PATCH net 0/2] sched: A few small fixes for sch_cake

2019-04-04 Thread David Miller
From: Toke Høiland-Jørgensen Date: Thu, 04 Apr 2019 15:01:33 +0200 > Hi Dave > > Kevin noticed a few issues with the way CAKE reads the skb protocol and the IP > diffserv fields. This series fixes those two issues, and should probably go to > in 4.19 as well. However, the previous refactoring

[Cake] [PATCH iproute2] q_cake: Add support for setting the fwmark option

2019-04-04 Thread Toke Høiland-Jørgensen
This adds support for the newly added fwmark option to CAKE, which allows overriding the tin selection from the per-packet firewall marks. The fwmark field is a bitmask that is applied to the fwmark to select the tin. Signed-off-by: Toke Høiland-Jørgensen --- man/man8/tc-cake.8 | 16

[Cake] [PATCH net 2/2] sch_cake: Make sure we can write the IP header before changing DSCP bits

2019-04-04 Thread Toke Høiland-Jørgensen
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 Signed-off-by: Toke Høiland-Jørgensen --- net/sched/sch_cake.c | 11 +++ 1 file

[Cake] [PATCH net 0/2] sched: A few small fixes for sch_cake

2019-04-04 Thread Toke Høiland-Jørgensen
Hi Dave Kevin noticed a few issues with the way CAKE reads the skb protocol and the IP diffserv fields. This series fixes those two issues, and should probably go to in 4.19 as well. However, the previous refactoring patch means they don't apply as-is; I can send a follow-up directly to stable if

[Cake] [PATCH net 1/2] sch_cake: Use tc_skb_protocol() helper for getting packet protocol

2019-04-04 Thread Toke Høiland-Jørgensen
We shouldn't be using skb->protocol directly as that will miss cases with hardware-accelerated VLAN tags. Use the helper instead to get the right protocol number. Reported-by: Kevin Darbyshire-Bryant Signed-off-by: Toke Høiland-Jørgensen --- net/sched/sch_cake.c |2 +- 1 file changed, 1