Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Matthew Rosato <mjrosato@linux.vnet.ibm.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH] net_sched: check skb_transport_header_was_set() in qdisc_pkt_len_init()
Date: Mon, 20 May 2013 11:58:43 -0700	[thread overview]
Message-ID: <1369076323.3301.200.camel@edumazet-glaptop> (raw)
In-Reply-To: <1369075650-21005-1-git-send-email-mjrosato@linux.vnet.ibm.com>

On Mon, 2013-05-20 at 14:47 -0400, Matthew Rosato wrote:
> commit 1def9238d4aa2 (net_sched: more precise pkt_len computation) does
> not check to see if skb_transport_header is valid prior to using it in
> qdisc_pkt_len_init(), which can lead to a kernel panic if
> skb_transport_header is not valid but gso_size is nonzero.  This patch
> adds a check for skb_transport_header_was_set().
> 
> I managed to hit this scenario by driving a burst of traffic from a
> qemu guest through a macvtap interface, causing a panic in the host kernel.
> 
> Signed-off-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com>
> ---
>  net/core/dev.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/dev.c b/net/core/dev.c
> index fc1e289..5d0d3af 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2596,7 +2596,7 @@ static void qdisc_pkt_len_init(struct sk_buff *skb)
>  	/* To get more precise estimation of bytes sent on wire,
>  	 * we add to pkt_len the headers size of all segments
>  	 */
> -	if (shinfo->gso_size)  {
> +	if (shinfo->gso_size && skb_transport_header_was_set(skb))  {
>  		unsigned int hdr_len;
>  		u16 gso_segs = shinfo->gso_segs;
>  

Have you tried a recent kernel ?

I believe this was already discussed.

Please fix macvtap instead if its still buggy.

  reply	other threads:[~2013-05-20 18:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-20 18:47 [PATCH] net_sched: check skb_transport_header_was_set() in qdisc_pkt_len_init() Matthew Rosato
2013-05-20 18:58 ` Eric Dumazet [this message]
2013-05-20 20:32   ` Matthew Rosato
2013-05-20 20:37     ` Eric Dumazet

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=1369076323.3301.200.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=mjrosato@linux.vnet.ibm.com \
    --cc=netdev@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox