Re: [PATCH V2 net] tuntap: properly align skb->head before building skb

From: Wei Wei
Date: Sat Oct 28 2017 - 18:29:44 EST


With this patch, the crash canât be reproduced with the syz-repro and crash log0/log1.

The auto-generated reproducers are here:
https://github.com/dotweiba/skb_clone_atomic_inc_bug

Thanks,
Wei
> On 28 Oct 2017, at 6:06 AM, David Miller <davem@xxxxxxxxxx> wrote:
>
> From: Jason Wang <jasowang@xxxxxxxxxx>
> Date: Fri, 27 Oct 2017 11:05:44 +0800
>
>> 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@xxxxxxxxxx>
>> Cc: Willem de Bruijn <willemdebruijn.kernel@xxxxxxxxx>
>> Cc: Wei Wei <dotweiba@xxxxxxxxx>
>> Cc: Dmitry Vyukov <dvyukov@xxxxxxxxxx>
>> Cc: Mark Rutland <mark.rutland@xxxxxxx>
>> Reported-by: Wei Wei <dotweiba@xxxxxxxxx>
>> Signed-off-by: Jason Wang <jasowang@xxxxxxxxxx>
>
> Applied and queued up for -stable, thanks Jason.