Thread (26 messages) flat view 26 messages, 6 authors, 2014-10-13

Re: [PATCH v2] flow-dissector: Fix alignment issue in __skb_flow_get_ports

From: Eric Dumazet <hidden>
Date: 2014-10-10 15:36:18

On Fri, 2014-10-10 at 07:59 -0700, alexander.duyck@gmail.com wrote:
From: Alexander Duyck <redacted>

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 keep the handling of the ports consistent with how we were
handling the IPv4 and IPv6 addresses I have instead replaced the assignment
with a memcpy to the flow key ports value.  This way it should stay a
memcpy on systems that cannot handle unaligned access, and will likely be
converted to a 32b assignment on the systems that can support it.

Signed-off-by: Alexander Duyck <redacted>
---
I believe you also need to take care of calls to ipv6_addr_hash()

The IPv4 part also needs something in iph_to_flow_copy_addrs(),
otherwise compiler might assume  &iph->saddr is word aligned.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help