lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bf7d3043-d795-ac00-7183-59b081b19142@redhat.com>
Date:   Fri, 8 Dec 2017 10:25:19 +0800
From:   Jason Wang <jasowang@...hat.com>
To:     Eric Dumazet <eric.dumazet@...il.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     mst@...hat.com, willemdebruijn.kernel@...il.com,
        tom@...bertland.com, aconole@...hat.com, wexu@...hat.com
Subject: Re: [PATCH net-next V3] tun: add eBPF based queue selection method



On 2017年12月08日 06:11, Eric Dumazet wrote:
> On Mon, 2017-12-04 at 17:31 +0800, Jason Wang wrote:
>> This patch introduces an eBPF based queue selection method. With
>> this,
>> the policy could be offloaded to userspace completely through a new
>> ioctl TUNSETSTEERINGEBPF.
> Sorry for the delay, I see this patch was merged already.
>
> ...
>
>>   static void tun_free_netdev(struct net_device *dev)
>>   {
>>   	struct tun_struct *tun = netdev_priv(dev);
>> @@ -1996,6 +2068,9 @@ static void tun_free_netdev(struct net_device
>> *dev)
>>   	free_percpu(tun->pcpu_stats);
>>   	tun_flow_uninit(tun);
>>   	security_tun_dev_free_security(tun->security);
>> +	rtnl_lock();
>> +	__tun_set_steering_ebpf(tun, NULL);
>> +	rtnl_unlock();
>>   }
> I am pretty sure tun_free_netdev() (aka ->priv_destructor()) can be
> called under RTNL (say from register_netdevice())
>
> So this will dead lock badly ?
>
>

Unfortunately yes. Will switch to use spinlock (tun->lock) to 
synchronize here.

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ