All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>
Cc: David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org, cake@lists.bufferbloat.net
Subject: Re: [PATCH net 2/2] sch_cake: Make sure we can write the IP header before changing DSCP bits
Date: Thu, 4 Apr 2019 14:40:07 -0700	[thread overview]
Message-ID: <20190404144007.7ac9bfe0@shemminger-XPS-13-9360> (raw)
In-Reply-To: <87y34p1owe.fsf@toke.dk>

On Thu, 04 Apr 2019 22:44:33 +0200
Toke Høiland-Jørgensen <toke@redhat.com> wrote:

> Stephen Hemminger <stephen@networkplumber.org> writes:
> 
> > On Thu, 04 Apr 2019 15:01:33 +0200
> > Toke Høiland-Jørgensen <toke@redhat.com> 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.  
> 
> Huh, that would imply that skb->network_header points to before
> skb->head; when does that happen?
> 
> Also, pskb_may_pull() does check for len > skb->len, so I guess a
> follow-up question would be, "does it happen often enough to warrant
> handling at this level"?
> 
> Also, I copied that bit from sch_dsmark, so if you really thing it needs
> to be fixed, I guess we should fix both...
> 
> -Toke

It should never happen just paranoid

  reply	other threads:[~2019-04-04 21:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04 13:01 [PATCH net 0/2] sched: A few small fixes for sch_cake Toke Høiland-Jørgensen
2019-04-04 13:01 ` [PATCH net 1/2] sch_cake: Use tc_skb_protocol() helper for getting packet protocol Toke Høiland-Jørgensen
2019-04-04 13:01 ` [PATCH net 2/2] sch_cake: Make sure we can write the IP header before changing DSCP bits Toke Høiland-Jørgensen
2019-04-04 19:35   ` Stephen Hemminger
2019-04-04 20:44     ` Toke Høiland-Jørgensen
2019-04-04 21:40       ` Stephen Hemminger [this message]
2019-04-04 21:55         ` Toke Høiland-Jørgensen
2019-04-04 17:56 ` [PATCH net 0/2] sched: A few small fixes for sch_cake David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190404144007.7ac9bfe0@shemminger-XPS-13-9360 \
    --to=stephen@networkplumber.org \
    --cc=cake@lists.bufferbloat.net \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=toke@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.