linux-next: manual merge of the net-next tree with the net tree

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

 



Hi all,

Today's linux-next merge of the net-next tree got a conflict in
net/wireless/nl80211.c between commit 3a5a423bb958 ("nl80211: fix attrbuf
access race by allocating a separate one") from the net tree and commit
5fe231e87372 ("cfg80211: vastly simplify locking") from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@xxxxxxxxxxxxxxxx

diff --cc net/wireless/nl80211.c
index b14b7e3,31d265f..0000000
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@@ -1564,17 -1527,12 +1527,17 @@@ static int nl80211_dump_wiphy(struct sk
  	struct cfg80211_registered_device *dev;
  	s64 filter_wiphy = -1;
  	bool split = false;
 -	struct nlattr **tb = nl80211_fam.attrbuf;
 +	struct nlattr **tb;
  	int res;
  
 +	/* will be zeroed in nlmsg_parse() */
 +	tb = kmalloc(sizeof(*tb) * (NL80211_ATTR_MAX + 1), GFP_KERNEL);
 +	if (!tb)
 +		return -ENOMEM;
 +
- 	mutex_lock(&cfg80211_mutex);
+ 	rtnl_lock();
  	res = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize,
 -			  tb, nl80211_fam.maxattr, nl80211_policy);
 +			  tb, NL80211_ATTR_MAX, nl80211_policy);
  	if (res == 0) {
  		split = tb[NL80211_ATTR_SPLIT_WIPHY_DUMP];
  		if (tb[NL80211_ATTR_WIPHY])
@@@ -1586,11 -1544,8 +1549,10 @@@
  			int ifidx = nla_get_u32(tb[NL80211_ATTR_IFINDEX]);
  
  			netdev = dev_get_by_index(sock_net(skb->sk), ifidx);
 -			if (!netdev)
 +			if (!netdev) {
- 				mutex_unlock(&cfg80211_mutex);
 +				kfree(tb);
  				return -ENODEV;
 +			}
  			if (netdev->ieee80211_ptr) {
  				dev = wiphy_to_dev(
  					netdev->ieee80211_ptr->wiphy);

Attachment: pgpFNPfSTDLVN.pgp
Description: PGP signature


[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux