Skip to content

Commit 029c581

Browse files
committed
Merge tag 'mac80211-for-davem-2017-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
Johannes Berg says: ==================== Just two fixes this time: * fix the scheduled scan "BUG: scheduling while atomic" * check mesh address extension flags more strictly ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 0ff50e8 + 1b57b62 commit 029c581

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

net/mac80211/rx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2492,7 +2492,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
24922492
if (is_multicast_ether_addr(hdr->addr1)) {
24932493
mpp_addr = hdr->addr3;
24942494
proxied_addr = mesh_hdr->eaddr1;
2495-
} else if (mesh_hdr->flags & MESH_FLAGS_AE_A5_A6) {
2495+
} else if ((mesh_hdr->flags & MESH_FLAGS_AE) ==
2496+
MESH_FLAGS_AE_A5_A6) {
24962497
/* has_a4 already checked in ieee80211_rx_mesh_check */
24972498
mpp_addr = hdr->addr4;
24982499
proxied_addr = mesh_hdr->eaddr2;

net/wireless/scan.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,9 @@ cfg80211_find_sched_scan_req(struct cfg80211_registered_device *rdev, u64 reqid)
322322
{
323323
struct cfg80211_sched_scan_request *pos;
324324

325-
ASSERT_RTNL();
325+
WARN_ON_ONCE(!rcu_read_lock_held() && !lockdep_rtnl_is_held());
326326

327-
list_for_each_entry(pos, &rdev->sched_scan_req_list, list) {
327+
list_for_each_entry_rcu(pos, &rdev->sched_scan_req_list, list) {
328328
if (pos->reqid == reqid)
329329
return pos;
330330
}
@@ -398,13 +398,13 @@ void cfg80211_sched_scan_results(struct wiphy *wiphy, u64 reqid)
398398
trace_cfg80211_sched_scan_results(wiphy, reqid);
399399
/* ignore if we're not scanning */
400400

401-
rtnl_lock();
401+
rcu_read_lock();
402402
request = cfg80211_find_sched_scan_req(rdev, reqid);
403403
if (request) {
404404
request->report_results = true;
405405
queue_work(cfg80211_wq, &rdev->sched_scan_res_wk);
406406
}
407-
rtnl_unlock();
407+
rcu_read_unlock();
408408
}
409409
EXPORT_SYMBOL(cfg80211_sched_scan_results);
410410

net/wireless/util.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,8 @@ int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,
454454
if (iftype == NL80211_IFTYPE_MESH_POINT)
455455
skb_copy_bits(skb, hdrlen, &mesh_flags, 1);
456456

457+
mesh_flags &= MESH_FLAGS_AE;
458+
457459
switch (hdr->frame_control &
458460
cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) {
459461
case cpu_to_le16(IEEE80211_FCTL_TODS):
@@ -469,9 +471,9 @@ int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,
469471
iftype != NL80211_IFTYPE_STATION))
470472
return -1;
471473
if (iftype == NL80211_IFTYPE_MESH_POINT) {
472-
if (mesh_flags & MESH_FLAGS_AE_A4)
474+
if (mesh_flags == MESH_FLAGS_AE_A4)
473475
return -1;
474-
if (mesh_flags & MESH_FLAGS_AE_A5_A6) {
476+
if (mesh_flags == MESH_FLAGS_AE_A5_A6) {
475477
skb_copy_bits(skb, hdrlen +
476478
offsetof(struct ieee80211s_hdr, eaddr1),
477479
tmp.h_dest, 2 * ETH_ALEN);
@@ -487,9 +489,9 @@ int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,
487489
ether_addr_equal(tmp.h_source, addr)))
488490
return -1;
489491
if (iftype == NL80211_IFTYPE_MESH_POINT) {
490-
if (mesh_flags & MESH_FLAGS_AE_A5_A6)
492+
if (mesh_flags == MESH_FLAGS_AE_A5_A6)
491493
return -1;
492-
if (mesh_flags & MESH_FLAGS_AE_A4)
494+
if (mesh_flags == MESH_FLAGS_AE_A4)
493495
skb_copy_bits(skb, hdrlen +
494496
offsetof(struct ieee80211s_hdr, eaddr1),
495497
tmp.h_source, ETH_ALEN);

0 commit comments

Comments
 (0)