Search Linux Wireless

Re: [PATCH] cfg80211: fix potential deadlock regression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2013-06-04 at 22:22 +0200, Johannes Berg wrote:
 
> -	rtnl_lock();
>  
>  	res = device_add(&rdev->wiphy.dev);
> +	if (res)
> +		return res;

I just ran across a regression caused by this commit

I'm again getting uevent notifications for wireless devices that are not
yet properly registered (ENODEV on NL80211 when using sysfs phy id)

I originally  fixed the bug by taking the cfg80211 mutex across the
whole registration:

commit 5a652052fedbd7869572c757dd2ffc2ed420c69d
Author: Maxime Bizon <mbizon@xxxxxxxxxx>
Date:   Wed Jul 21 17:21:38 2010 +0200

    cfg80211: fix race between sysfs and cfg80211
    
    device_add() is called before adding the phy to the cfg80211 device
    list.
    
    So if a userspace program uses sysfs uevents to detect new phy
    devices, and queries nl80211 to get phy info, it can get ENODEV even
    though the phy exists in sysfs.
    
    An easy workaround is to hold the cfg80211 mutex until the phy is
    present in sysfs/cfg80211/debugfs.


It does not seem we can reverse the rfkill_register() and device_add()
because wiphy dev is a parent of rfkill dev.

any idea to fix this ?

Thanks,

-- 
Maxime


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux