Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: alexander.duyck@gmail.com
Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com
Subject: Re: [PATCH v4] flow-dissector: Fix alignment issue in __skb_flow_get_ports
Date: Fri, 10 Oct 2014 15:34:21 -0400 (EDT)	[thread overview]
Message-ID: <20141010.153421.869334149742394721.davem@davemloft.net> (raw)
In-Reply-To: <20141010190716.8311.98709.stgit@ahduyck-workstation.home>

From: alexander.duyck@gmail.com
Date: Fri, 10 Oct 2014 12:09:12 -0700

> From: Alexander Duyck <alexander.h.duyck@redhat.com>
> 
> This patch addresses a kernel unaligned access bug seen on a sparc64 system
> with an igb adapter.  Specifically the __skb_flow_get_ports was returning a
> be32 pointer which was then having the value directly returned.
> 
> In order to prevent this it is actually easier to simply not populate the
> ports or address values when an skb is not present.  In this case the
> assumption is that the data isn't needed and rather than slow down the
> faster aligned accesses by making them have to assume the unaligned path on
> architectures that don't support efficent unaligned access it makes more
> sense to simply switch off the bits that were copying the source and
> destination address/port for the case where we only care about the protocol
> types and lengths which are normally 16 bit fields anyway.
> 
> Reported-by: David S. Miller <davem@davemloft.net>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
> ---
> 
> v2: Fixed alignment to __be16 on ports
> v3: Discarded previous approach and instead simplified things by
>     not populating ports, or src/dst addresses if skb is not present.
>     By doing this we avoid the unaligned access issue entirely and do not
>     populate fields that will not be used by the eth_get_headlen function.
> v4: Minor whitespace cleanups
>     Added workaround for access of doff resulting in unaligned access

Applied, thanks Alex.

      reply	other threads:[~2014-10-10 19:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-10 19:09 [PATCH v4] flow-dissector: Fix alignment issue in __skb_flow_get_ports alexander.duyck
2014-10-10 19:34 ` David Miller [this message]

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=20141010.153421.869334149742394721.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=alexander.duyck@gmail.com \
    --cc=eric.dumazet@gmail.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