[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF=yD-JLeqAM=LYQCpEry_NBFXDNphjcixGe0+sv0XUqtNCF7w@mail.gmail.com>
Date: Mon, 7 Jan 2019 17:30:10 -0500
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Stanislav Fomichev <sdf@...gle.com>
Cc: Network Development <netdev@...r.kernel.org>,
David Miller <davem@...emloft.net>,
Jason Wang <jasowang@...hat.com>,
Jesper Dangaard Brouer <brouer@...hat.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Eric Dumazet <edumazet@...gle.com>,
syzbot <syzkaller@...glegroups.com>
Subject: Re: [PATCH net v2 2/2] tun: always set skb->dev to tun->dev
On Mon, Jan 7, 2019 at 4:41 PM Stanislav Fomichev <sdf@...gle.com> wrote:
>
> While debugging previous issue I noticed that commit 90e33d459407 ("tun:
> enable napi_gro_frags() for TUN/TAP driver") started conditionally
> (!frags) calling eth_type_trans(skb, tun->dev) for IFF_TAP case. Since
> eth_type_trans sets skb->dev, some skbs can now have NULL skb->dev.
> Fix that by always setting skb->dev unconditionally.
>
> The syzbot fails with the following trace:
> WARNING: CPU: 0 PID: 11136 at net/core/flow_dissector.c:764
> skb_flow_dissect_flow_keys_basic include/linux/skbuff.h:1240 [inline]
> skb_probe_transport_header include/linux/skbuff.h:2403 [inline]
> tun_get_user+0x2d4a/0x4250 drivers/net/tun.c:1906
> tun_chr_write_iter+0xb9/0x160 drivers/net/tun.c:1993
> call_write_iter include/linux/fs.h:1808 [inline]
> new_sync_write fs/read_write.c:474 [inline]
>
> But I don't think there is an actual issue since we exercise flow
> dissector via eth_get_headlen which doesn't use skb (and hence BPF flow
> dissector).
Do you mean skb_probe_transport_header?
if frags, tun_napi_alloc_frags will return napi->skb, which has
skb->dev set by napi_reuse_skb.
I don't think this is needed.
Powered by blists - more mailing lists