Re: [PATCH net-next V2] tuntap: fix possible deadlock when fail to register netdev

From: David Miller
Date: Fri Dec 08 2017 - 10:45:00 EST


From: "Michael S. Tsirkin" <mst@xxxxxxxxxx>
Date: Fri, 8 Dec 2017 06:43:44 +0200

> On Fri, Dec 08, 2017 at 12:02:30PM +0800, Jason Wang wrote:
>> Private destructor could be called when register_netdev() fail with
>> rtnl lock held. This will lead deadlock in tun_free_netdev() who tries
>> to hold rtnl_lock. Fixing this by switching to use spinlock to
>> synchronize.
>>
>> Fixes: 96f84061620c ("tun: add eBPF based queue selection method")
>> Reported-by: Eric Dumazet <eric.dumazet@xxxxxxxxx>
>> Cc: Eric Dumazet <eric.dumazet@xxxxxxxxx>
>> Cc: Willem de Bruijn <willemb@xxxxxxxxxx>
>> Signed-off-by: Jason Wang <jasowang@xxxxxxxxxx>
>
> Acked-by: Michael S. Tsirkin <mst@xxxxxxxxxx>

Applied, thanks.