From: Jason Wang <hidden> Date: 2017-10-26 12:16:06
An unaligned alloc_frag->offset caused by previous allocation will
result an unaligned skb->head. This will lead unaligned
skb_shared_info and then unaligned dataref which requires to be
aligned for accessing on some architecture. Fix this by aligning
alloc_frag->offset before the frag refilling.
Fixes: 0bbd7dad34f8 ("tun: make tun_build_skb() thread safe")
Cc: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: Wei Wei <redacted>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Reported-by: Wei Wei <redacted>
Signed-off-by: Jason Wang <redacted>
---
- The patch is needed for -stable.
- Wei, can you try this patch to see if it solves your issue?
---
drivers/net/tun.c | 1 +
1 file changed, 1 insertion(+)
From: Eric Dumazet <edumazet@google.com> Date: 2017-10-26 14:11:44
On Thu, Oct 26, 2017 at 5:15 AM, Jason Wang [off-list ref] wrote:
quoted hunk
An unaligned alloc_frag->offset caused by previous allocation will
result an unaligned skb->head. This will lead unaligned
skb_shared_info and then unaligned dataref which requires to be
aligned for accessing on some architecture. Fix this by aligning
alloc_frag->offset before the frag refilling.
Fixes: 0bbd7dad34f8 ("tun: make tun_build_skb() thread safe")
Cc: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: Wei Wei <redacted>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Reported-by: Wei Wei <redacted>
Signed-off-by: Jason Wang <redacted>
---
- The patch is needed for -stable.
- Wei, can you try this patch to see if it solves your issue?
---
drivers/net/tun.c | 1 +
1 file changed, 1 insertion(+)
You have to align to one cache line (SMP_CACHE_BYTES), or SKB_DATA_ALIGN(1)
Then eventually use skb_reserve() for NET_IP_ALIGN, but I guess it is
already done.
From: Jason Wang <hidden> Date: 2017-10-27 03:04:11
On 2017年10月26日 22:11, Eric Dumazet wrote:
On Thu, Oct 26, 2017 at 5:15 AM, Jason Wang [off-list ref] wrote:
quoted
An unaligned alloc_frag->offset caused by previous allocation will
result an unaligned skb->head. This will lead unaligned
skb_shared_info and then unaligned dataref which requires to be
aligned for accessing on some architecture. Fix this by aligning
alloc_frag->offset before the frag refilling.
Fixes: 0bbd7dad34f8 ("tun: make tun_build_skb() thread safe")
Cc: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: Wei Wei <redacted>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Reported-by: Wei Wei <redacted>
Signed-off-by: Jason Wang <redacted>
---
- The patch is needed for -stable.
- Wei, can you try this patch to see if it solves your issue?
---
drivers/net/tun.c | 1 +
1 file changed, 1 insertion(+)