<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/mac80211, branch v4.4.65</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>mac80211: reject ToDS broadcast data frames</title>
<updated>2017-04-27T07:09:33+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2017-04-20T19:32:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b812c69019e421cf9b4fd7e57747e73e2b83c741'/>
<id>b812c69019e421cf9b4fd7e57747e73e2b83c741</id>
<content type='text'>
commit 3018e947d7fd536d57e2b550c33e456d921fff8c upstream.

AP/AP_VLAN modes don't accept any real 802.11 multicast data
frames, but since they do need to accept broadcast management
frames the same is currently permitted for data frames. This
opens a security problem because such frames would be decrypted
with the GTK, and could even contain unicast L3 frames.

Since the spec says that ToDS frames must always have the BSSID
as the RA (addr1), reject any other data frames.

The problem was originally reported in "Predicting, Decrypting,
and Abusing WPA2/802.11 Group Keys" at usenix
https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/vanhoef
and brought to my attention by Jouni.

Reported-by: Jouni Malinen &lt;j@w1.fi&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
--

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 3018e947d7fd536d57e2b550c33e456d921fff8c upstream.

AP/AP_VLAN modes don't accept any real 802.11 multicast data
frames, but since they do need to accept broadcast management
frames the same is currently permitted for data frames. This
opens a security problem because such frames would be decrypted
with the GTK, and could even contain unicast L3 frames.

Since the spec says that ToDS frames must always have the BSSID
as the RA (addr1), reject any other data frames.

The problem was originally reported in "Predicting, Decrypting,
and Abusing WPA2/802.11 Group Keys" at usenix
https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/vanhoef
and brought to my attention by Jouni.

Reported-by: Jouni Malinen &lt;j@w1.fi&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
--

</pre>
</div>
</content>
</entry>
<entry>
<title>mac80211: flush delayed work when entering suspend</title>
<updated>2017-03-15T01:57:14+00:00</updated>
<author>
<name>Matt Chen</name>
<email>matt.chen@intel.com</email>
</author>
<published>2017-01-21T18:16:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8650af261d6c119062da542c70881653db0a0b20'/>
<id>8650af261d6c119062da542c70881653db0a0b20</id>
<content type='text'>
commit a9e9200d8661c1a0be8c39f93deb383dc940de35 upstream.

The issue was found when entering suspend and resume.
It triggers a warning in:
mac80211/key.c: ieee80211_enable_keys()
...
WARN_ON_ONCE(sdata-&gt;crypto_tx_tailroom_needed_cnt ||
             sdata-&gt;crypto_tx_tailroom_pending_dec);
...

It points out sdata-&gt;crypto_tx_tailroom_pending_dec isn't cleaned up successfully
in a delayed_work during suspend. Add a flush_delayed_work to fix it.

Signed-off-by: Matt Chen &lt;matt.chen@intel.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit a9e9200d8661c1a0be8c39f93deb383dc940de35 upstream.

The issue was found when entering suspend and resume.
It triggers a warning in:
mac80211/key.c: ieee80211_enable_keys()
...
WARN_ON_ONCE(sdata-&gt;crypto_tx_tailroom_needed_cnt ||
             sdata-&gt;crypto_tx_tailroom_pending_dec);
...

It points out sdata-&gt;crypto_tx_tailroom_pending_dec isn't cleaned up successfully
in a delayed_work during suspend. Add a flush_delayed_work to fix it.

Signed-off-by: Matt Chen &lt;matt.chen@intel.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mac80211: Fix adding of mesh vendor IEs</title>
<updated>2017-02-14T23:22:51+00:00</updated>
<author>
<name>Thorsten Horstmann</name>
<email>thorsten@defutech.de</email>
</author>
<published>2017-02-03T13:38:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b9c29d45f980260b387749c7029453b9ee16b07f'/>
<id>b9c29d45f980260b387749c7029453b9ee16b07f</id>
<content type='text'>
commit da7061c82e4a1bc6a5e134ef362c86261906c860 upstream.

The function ieee80211_ie_split_vendor doesn't return 0 on errors. Instead
it returns any offset &lt; ielen when WLAN_EID_VENDOR_SPECIFIC is found. The
return value in mesh_add_vendor_ies must therefore be checked against
ifmsh-&gt;ie_len and not 0. Otherwise all ifmsh-&gt;ie starting with
WLAN_EID_VENDOR_SPECIFIC will be rejected.

Fixes: 082ebb0c258d ("mac80211: fix mesh beacon format")
Signed-off-by: Thorsten Horstmann &lt;thorsten@defutech.de&gt;
Signed-off-by: Mathias Kretschmer &lt;mathias.kretschmer@fit.fraunhofer.de&gt;
Signed-off-by: Simon Wunderlich &lt;sw@simonwunderlich.de&gt;
[sven@narfation.org: Add commit message]
Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit da7061c82e4a1bc6a5e134ef362c86261906c860 upstream.

The function ieee80211_ie_split_vendor doesn't return 0 on errors. Instead
it returns any offset &lt; ielen when WLAN_EID_VENDOR_SPECIFIC is found. The
return value in mesh_add_vendor_ies must therefore be checked against
ifmsh-&gt;ie_len and not 0. Otherwise all ifmsh-&gt;ie starting with
WLAN_EID_VENDOR_SPECIFIC will be rejected.

Fixes: 082ebb0c258d ("mac80211: fix mesh beacon format")
Signed-off-by: Thorsten Horstmann &lt;thorsten@defutech.de&gt;
Signed-off-by: Mathias Kretschmer &lt;mathias.kretschmer@fit.fraunhofer.de&gt;
Signed-off-by: Simon Wunderlich &lt;sw@simonwunderlich.de&gt;
[sven@narfation.org: Add commit message]
Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mac80211: initialize fast-xmit 'info' later</title>
<updated>2017-01-12T10:22:43+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2017-01-02T10:19:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9b73f43fcef40fa2bc8ceacbffdf040036bf891b'/>
<id>9b73f43fcef40fa2bc8ceacbffdf040036bf891b</id>
<content type='text'>
commit 35f432a03e41d3bf08c51ede917f94e2288fbe8c upstream.

In ieee80211_xmit_fast(), 'info' is initialized to point to the skb
that's passed in, but that skb may later be replaced by a clone (if
it was shared), leading to an invalid pointer.

This can lead to use-after-free and also later crashes since the
real SKB's info-&gt;hw_queue doesn't get initialized properly.

Fix this by assigning info only later, when it's needed, after the
skb replacement (may have) happened.

Reported-by: Ben Greear &lt;greearb@candelatech.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 35f432a03e41d3bf08c51ede917f94e2288fbe8c upstream.

In ieee80211_xmit_fast(), 'info' is initialized to point to the skb
that's passed in, but that skb may later be replaced by a clone (if
it was shared), leading to an invalid pointer.

This can lead to use-after-free and also later crashes since the
real SKB's info-&gt;hw_queue doesn't get initialized properly.

Fix this by assigning info only later, when it's needed, after the
skb replacement (may have) happened.

Reported-by: Ben Greear &lt;greearb@candelatech.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>cfg80211/mac80211: fix BSS leaks when abandoning assoc attempts</title>
<updated>2017-01-09T07:07:42+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2016-12-08T16:22:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b63929e8e130a97303dfacc28f558262f0605708'/>
<id>b63929e8e130a97303dfacc28f558262f0605708</id>
<content type='text'>
commit e6f462df9acd2a3295e5d34eb29e2823220cf129 upstream.

When mac80211 abandons an association attempt, it may free
all the data structures, but inform cfg80211 and userspace
about it only by sending the deauth frame it received, in
which case cfg80211 has no link to the BSS struct that was
used and will not cfg80211_unhold_bss() it.

Fix this by providing a way to inform cfg80211 of this with
the BSS entry passed, so that it can clean up properly, and
use this ability in the appropriate places in mac80211.

This isn't ideal: some code is more or less duplicated and
tracing is missing. However, it's a fairly small change and
it's thus easier to backport - cleanups can come later.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit e6f462df9acd2a3295e5d34eb29e2823220cf129 upstream.

When mac80211 abandons an association attempt, it may free
all the data structures, but inform cfg80211 and userspace
about it only by sending the deauth frame it received, in
which case cfg80211 has no link to the BSS struct that was
used and will not cfg80211_unhold_bss() it.

Fix this by providing a way to inform cfg80211 of this with
the BSS entry passed, so that it can clean up properly, and
use this ability in the appropriate places in mac80211.

This isn't ideal: some code is more or less duplicated and
tracing is missing. However, it's a fairly small change and
it's thus easier to backport - cleanups can come later.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mac80211: discard multicast and 4-addr A-MSDUs</title>
<updated>2016-11-10T15:36:35+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2016-10-05T08:14:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d9237e75fd74b6beee27281abdf9b6fbc189498e'/>
<id>d9237e75fd74b6beee27281abdf9b6fbc189498e</id>
<content type='text'>
commit ea720935cf6686f72def9d322298bf7e9bd53377 upstream.

In mac80211, multicast A-MSDUs are accepted in many cases that
they shouldn't be accepted in:
 * drop A-MSDUs with a multicast A1 (RA), as required by the
   spec in 9.11 (802.11-2012 version)
 * drop A-MSDUs with a 4-addr header, since the fourth address
   can't actually be useful for them; unless 4-address frame
   format is actually requested, even though the fourth address
   is still not useful in this case, but ignored

Accepting the first case, in particular, is very problematic
since it allows anyone else with possession of a GTK to send
unicast frames encapsulated in a multicast A-MSDU, even when
the AP has client isolation enabled.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit ea720935cf6686f72def9d322298bf7e9bd53377 upstream.

In mac80211, multicast A-MSDUs are accepted in many cases that
they shouldn't be accepted in:
 * drop A-MSDUs with a multicast A1 (RA), as required by the
   spec in 9.11 (802.11-2012 version)
 * drop A-MSDUs with a 4-addr header, since the fourth address
   can't actually be useful for them; unless 4-address frame
   format is actually requested, even though the fourth address
   is still not useful in this case, but ignored

Accepting the first case, in particular, is very problematic
since it allows anyone else with possession of a GTK to send
unicast frames encapsulated in a multicast A-MSDU, even when
the AP has client isolation enabled.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mac80211: fix purging multicast PS buffer queue</title>
<updated>2016-09-07T06:32:41+00:00</updated>
<author>
<name>Felix Fietkau</name>
<email>nbd@nbd.name</email>
</author>
<published>2016-08-02T09:13:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ed6625cfdbe6bb9bc9561934361abdca43be551a'/>
<id>ed6625cfdbe6bb9bc9561934361abdca43be551a</id>
<content type='text'>
commit 6b07d9ca9b5363dda959b9582a3fc9c0b89ef3b5 upstream.

The code currently assumes that buffered multicast PS frames don't have
a pending ACK frame for tx status reporting.
However, hostapd sends a broadcast deauth frame on teardown for which tx
status is requested. This can lead to the "Have pending ack frames"
warning on module reload.
Fix this by using ieee80211_free_txskb/ieee80211_purge_tx_queue.

Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 6b07d9ca9b5363dda959b9582a3fc9c0b89ef3b5 upstream.

The code currently assumes that buffered multicast PS frames don't have
a pending ACK frame for tx status reporting.
However, hostapd sends a broadcast deauth frame on teardown for which tx
status is requested. This can lead to the "Have pending ack frames"
warning on module reload.
Fix this by using ieee80211_free_txskb/ieee80211_purge_tx_queue.

Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mac80211: Fix mesh estab_plinks counting in STA removal case</title>
<updated>2016-07-27T16:47:27+00:00</updated>
<author>
<name>Jouni Malinen</name>
<email>j@w1.fi</email>
</author>
<published>2016-06-19T20:51:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=96d50acbd447f536b39cc3c2964a6231aeb6bb6f'/>
<id>96d50acbd447f536b39cc3c2964a6231aeb6bb6f</id>
<content type='text'>
commit 126e7557328a1cd576be4fca95b133a2695283ff upstream.

If a user space program (e.g., wpa_supplicant) deletes a STA entry that
is currently in NL80211_PLINK_ESTAB state, the number of established
plinks counter was not decremented and this could result in rejecting
new plink establishment before really hitting the real maximum plink
limit. For !user_mpm case, this decrementation is handled by
mesh_plink_deactive().

Fix this by decrementing estab_plinks on STA deletion
(mesh_sta_cleanup() gets called from there) so that the counter has a
correct value and the Beacon frame advertisement in Mesh Configuration
element shows the proper value for capability to accept additional
peers.

Signed-off-by: Jouni Malinen &lt;j@w1.fi&gt;
Signed-off-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 126e7557328a1cd576be4fca95b133a2695283ff upstream.

If a user space program (e.g., wpa_supplicant) deletes a STA entry that
is currently in NL80211_PLINK_ESTAB state, the number of established
plinks counter was not decremented and this could result in rejecting
new plink establishment before really hitting the real maximum plink
limit. For !user_mpm case, this decrementation is handled by
mesh_plink_deactive().

Fix this by decrementing estab_plinks on STA deletion
(mesh_sta_cleanup() gets called from there) so that the counter has a
correct value and the Beacon frame advertisement in Mesh Configuration
element shows the proper value for capability to accept additional
peers.

Signed-off-by: Jouni Malinen &lt;j@w1.fi&gt;
Signed-off-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mac80211: mesh: flush mesh paths unconditionally</title>
<updated>2016-07-27T16:47:27+00:00</updated>
<author>
<name>Bob Copeland</name>
<email>me@bobcopeland.com</email>
</author>
<published>2016-05-15T17:19:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7b90e041d140f785fb2fb06e467ff152c9210082'/>
<id>7b90e041d140f785fb2fb06e467ff152c9210082</id>
<content type='text'>
commit fe7a7c57629e8dcbc0e297363a9b2366d67a6dc5 upstream.

Currently, the mesh paths associated with a nexthop station are cleaned
up in the following code path:

    __sta_info_destroy_part1
    synchronize_net()
    __sta_info_destroy_part2
     -&gt; cleanup_single_sta
       -&gt; mesh_sta_cleanup
         -&gt; mesh_plink_deactivate
           -&gt; mesh_path_flush_by_nexthop

However, there are a couple of problems here:

1) the paths aren't flushed at all if the MPM is running in userspace
   (e.g. when using wpa_supplicant or authsae)

2) there is no synchronize_rcu between removing the path and readers
   accessing the nexthop, which means the following race is possible:

CPU0                            CPU1
~~~~                            ~~~~
                                sta_info_destroy_part1()
                                synchronize_net()
rcu_read_lock()
mesh_nexthop_resolve()
  mpath = mesh_path_lookup()
                                [...] -&gt; mesh_path_flush_by_nexthop()
  sta = rcu_dereference(
    mpath-&gt;next_hop)
                                kfree(sta)
  access sta &lt;-- CRASH

Fix both of these by unconditionally flushing paths before destroying
the sta, and by adding a synchronize_net() after path flush to ensure
no active readers can still dereference the sta.

Fixes this crash:

[  348.529295] BUG: unable to handle kernel paging request at 00020040
[  348.530014] IP: [&lt;f929245d&gt;] ieee80211_mps_set_frame_flags+0x40/0xaa [mac80211]
[  348.530014] *pde = 00000000
[  348.530014] Oops: 0000 [#1] PREEMPT
[  348.530014] Modules linked in: drbg ansi_cprng ctr ccm ppp_generic slhc ipt_MASQUERADE nf_nat_masquerade_ipv4 8021q ]
[  348.530014] CPU: 0 PID: 20597 Comm: wget Tainted: G           O 4.6.0-rc5-wt=V1 #1
[  348.530014] Hardware name: To Be Filled By O.E.M./To be filled by O.E.M., BIOS 080016  11/07/2014
[  348.530014] task: f64fa280 ti: f4f9c000 task.ti: f4f9c000
[  348.530014] EIP: 0060:[&lt;f929245d&gt;] EFLAGS: 00010246 CPU: 0
[  348.530014] EIP is at ieee80211_mps_set_frame_flags+0x40/0xaa [mac80211]
[  348.530014] EAX: f4ce63e0 EBX: 00000088 ECX: f3788416 EDX: 00020008
[  348.530014] ESI: 00000000 EDI: 00000088 EBP: f6409a4c ESP: f6409a40
[  348.530014]  DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068
[  348.530014] CR0: 80050033 CR2: 00020040 CR3: 33190000 CR4: 00000690
[  348.530014] Stack:
[  348.530014]  00000000 f4ce63e0 f5f9bd80 f6409a64 f9291d80 0000ce67 f5d51e00 f4ce63e0
[  348.530014]  f3788416 f6409a80 f9291dc1 f4ce8320 f4ce63e0 f5d51e00 f4ce63e0 f4ce8320
[  348.530014]  f6409a98 f9277f6f 00000000 00000000 0000007c 00000000 f6409b2c f9278dd1
[  348.530014] Call Trace:
[  348.530014]  [&lt;f9291d80&gt;] mesh_nexthop_lookup+0xbb/0xc8 [mac80211]
[  348.530014]  [&lt;f9291dc1&gt;] mesh_nexthop_resolve+0x34/0xd8 [mac80211]
[  348.530014]  [&lt;f9277f6f&gt;] ieee80211_xmit+0x92/0xc1 [mac80211]
[  348.530014]  [&lt;f9278dd1&gt;] __ieee80211_subif_start_xmit+0x807/0x83c [mac80211]
[  348.530014]  [&lt;c04df012&gt;] ? sch_direct_xmit+0xd7/0x1b3
[  348.530014]  [&lt;c022a8c6&gt;] ? __local_bh_enable_ip+0x5d/0x7b
[  348.530014]  [&lt;f956870c&gt;] ? nf_nat_ipv4_out+0x4c/0xd0 [nf_nat_ipv4]
[  348.530014]  [&lt;f957e036&gt;] ? iptable_nat_ipv4_fn+0xf/0xf [iptable_nat]
[  348.530014]  [&lt;c04c6f45&gt;] ? netif_skb_features+0x14d/0x30a
[  348.530014]  [&lt;f9278e10&gt;] ieee80211_subif_start_xmit+0xa/0xe [mac80211]
[  348.530014]  [&lt;c04c769c&gt;] dev_hard_start_xmit+0x1f8/0x267
[  348.530014]  [&lt;c04c7261&gt;] ?  validate_xmit_skb.isra.120.part.121+0x10/0x253
[  348.530014]  [&lt;c04defc6&gt;] sch_direct_xmit+0x8b/0x1b3
[  348.530014]  [&lt;c04c7a9c&gt;] __dev_queue_xmit+0x2c8/0x513
[  348.530014]  [&lt;c04c7cfb&gt;] dev_queue_xmit+0xa/0xc
[  348.530014]  [&lt;f91bfc7a&gt;] batadv_send_skb_packet+0xd6/0xec [batman_adv]
[  348.530014]  [&lt;f91bfdc4&gt;] batadv_send_unicast_skb+0x15/0x4a [batman_adv]
[  348.530014]  [&lt;f91b5938&gt;] batadv_dat_send_data+0x27e/0x310 [batman_adv]
[  348.530014]  [&lt;f91c30b5&gt;] ? batadv_tt_global_hash_find.isra.11+0x8/0xa [batman_adv]
[  348.530014]  [&lt;f91b63f3&gt;] batadv_dat_snoop_outgoing_arp_request+0x208/0x23d [batman_adv]
[  348.530014]  [&lt;f91c0cd9&gt;] batadv_interface_tx+0x206/0x385 [batman_adv]
[  348.530014]  [&lt;c04c769c&gt;] dev_hard_start_xmit+0x1f8/0x267
[  348.530014]  [&lt;c04c7261&gt;] ?  validate_xmit_skb.isra.120.part.121+0x10/0x253
[  348.530014]  [&lt;c04defc6&gt;] sch_direct_xmit+0x8b/0x1b3
[  348.530014]  [&lt;c04c7a9c&gt;] __dev_queue_xmit+0x2c8/0x513
[  348.530014]  [&lt;f80cbd2a&gt;] ? igb_xmit_frame+0x57/0x72 [igb]
[  348.530014]  [&lt;c04c7cfb&gt;] dev_queue_xmit+0xa/0xc
[  348.530014]  [&lt;f843a326&gt;] br_dev_queue_push_xmit+0xeb/0xfb [bridge]
[  348.530014]  [&lt;f843a35f&gt;] br_forward_finish+0x29/0x74 [bridge]
[  348.530014]  [&lt;f843a23b&gt;] ? deliver_clone+0x3b/0x3b [bridge]
[  348.530014]  [&lt;f843a714&gt;] __br_forward+0x89/0xe7 [bridge]
[  348.530014]  [&lt;f843a336&gt;] ? br_dev_queue_push_xmit+0xfb/0xfb [bridge]
[  348.530014]  [&lt;f843a234&gt;] deliver_clone+0x34/0x3b [bridge]
[  348.530014]  [&lt;f843a68b&gt;] ? br_flood+0x95/0x95 [bridge]
[  348.530014]  [&lt;f843a66d&gt;] br_flood+0x77/0x95 [bridge]
[  348.530014]  [&lt;f843a809&gt;] br_flood_forward+0x13/0x1a [bridge]
[  348.530014]  [&lt;f843a68b&gt;] ? br_flood+0x95/0x95 [bridge]
[  348.530014]  [&lt;f843b877&gt;] br_handle_frame_finish+0x392/0x3db [bridge]
[  348.530014]  [&lt;c04e9b2b&gt;] ? nf_iterate+0x2b/0x6b
[  348.530014]  [&lt;f843baa6&gt;] br_handle_frame+0x1e6/0x240 [bridge]
[  348.530014]  [&lt;f843b4e5&gt;] ? br_handle_local_finish+0x6a/0x6a [bridge]
[  348.530014]  [&lt;c04c4ba0&gt;] __netif_receive_skb_core+0x43a/0x66b
[  348.530014]  [&lt;f843b8c0&gt;] ? br_handle_frame_finish+0x3db/0x3db [bridge]
[  348.530014]  [&lt;c023cea4&gt;] ? resched_curr+0x19/0x37
[  348.530014]  [&lt;c0240707&gt;] ? check_preempt_wakeup+0xbf/0xfe
[  348.530014]  [&lt;c0255dec&gt;] ? ktime_get_with_offset+0x5c/0xfc
[  348.530014]  [&lt;c04c4fc1&gt;] __netif_receive_skb+0x47/0x55
[  348.530014]  [&lt;c04c57ba&gt;] netif_receive_skb_internal+0x40/0x5a
[  348.530014]  [&lt;c04c61ef&gt;] napi_gro_receive+0x3a/0x94
[  348.530014]  [&lt;f80ce8d5&gt;] igb_poll+0x6fd/0x9ad [igb]
[  348.530014]  [&lt;c0242bd8&gt;] ? swake_up_locked+0x14/0x26
[  348.530014]  [&lt;c04c5d29&gt;] net_rx_action+0xde/0x250
[  348.530014]  [&lt;c022a743&gt;] __do_softirq+0x8a/0x163
[  348.530014]  [&lt;c022a6b9&gt;] ? __hrtimer_tasklet_trampoline+0x19/0x19
[  348.530014]  [&lt;c021100f&gt;] do_softirq_own_stack+0x26/0x2c
[  348.530014]  &lt;IRQ&gt;
[  348.530014]  [&lt;c022a957&gt;] irq_exit+0x31/0x6f
[  348.530014]  [&lt;c0210eb2&gt;] do_IRQ+0x8d/0xa0
[  348.530014]  [&lt;c058152c&gt;] common_interrupt+0x2c/0x40
[  348.530014] Code: e7 8c 00 66 81 ff 88 00 75 12 85 d2 75 0e b2 c3 b8 83 e9 29 f9 e8 a7 5f f9 c6 eb 74 66 81 e3 8c 005
[  348.530014] EIP: [&lt;f929245d&gt;] ieee80211_mps_set_frame_flags+0x40/0xaa [mac80211] SS:ESP 0068:f6409a40
[  348.530014] CR2: 0000000000020040
[  348.530014] ---[ end trace 48556ac26779732e ]---
[  348.530014] Kernel panic - not syncing: Fatal exception in interrupt
[  348.530014] Kernel Offset: disabled

Reported-by: Fred Veldini &lt;fred.veldini@gmail.com&gt;
Tested-by: Fred Veldini &lt;fred.veldini@gmail.com&gt;
Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit fe7a7c57629e8dcbc0e297363a9b2366d67a6dc5 upstream.

Currently, the mesh paths associated with a nexthop station are cleaned
up in the following code path:

    __sta_info_destroy_part1
    synchronize_net()
    __sta_info_destroy_part2
     -&gt; cleanup_single_sta
       -&gt; mesh_sta_cleanup
         -&gt; mesh_plink_deactivate
           -&gt; mesh_path_flush_by_nexthop

However, there are a couple of problems here:

1) the paths aren't flushed at all if the MPM is running in userspace
   (e.g. when using wpa_supplicant or authsae)

2) there is no synchronize_rcu between removing the path and readers
   accessing the nexthop, which means the following race is possible:

CPU0                            CPU1
~~~~                            ~~~~
                                sta_info_destroy_part1()
                                synchronize_net()
rcu_read_lock()
mesh_nexthop_resolve()
  mpath = mesh_path_lookup()
                                [...] -&gt; mesh_path_flush_by_nexthop()
  sta = rcu_dereference(
    mpath-&gt;next_hop)
                                kfree(sta)
  access sta &lt;-- CRASH

Fix both of these by unconditionally flushing paths before destroying
the sta, and by adding a synchronize_net() after path flush to ensure
no active readers can still dereference the sta.

Fixes this crash:

[  348.529295] BUG: unable to handle kernel paging request at 00020040
[  348.530014] IP: [&lt;f929245d&gt;] ieee80211_mps_set_frame_flags+0x40/0xaa [mac80211]
[  348.530014] *pde = 00000000
[  348.530014] Oops: 0000 [#1] PREEMPT
[  348.530014] Modules linked in: drbg ansi_cprng ctr ccm ppp_generic slhc ipt_MASQUERADE nf_nat_masquerade_ipv4 8021q ]
[  348.530014] CPU: 0 PID: 20597 Comm: wget Tainted: G           O 4.6.0-rc5-wt=V1 #1
[  348.530014] Hardware name: To Be Filled By O.E.M./To be filled by O.E.M., BIOS 080016  11/07/2014
[  348.530014] task: f64fa280 ti: f4f9c000 task.ti: f4f9c000
[  348.530014] EIP: 0060:[&lt;f929245d&gt;] EFLAGS: 00010246 CPU: 0
[  348.530014] EIP is at ieee80211_mps_set_frame_flags+0x40/0xaa [mac80211]
[  348.530014] EAX: f4ce63e0 EBX: 00000088 ECX: f3788416 EDX: 00020008
[  348.530014] ESI: 00000000 EDI: 00000088 EBP: f6409a4c ESP: f6409a40
[  348.530014]  DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068
[  348.530014] CR0: 80050033 CR2: 00020040 CR3: 33190000 CR4: 00000690
[  348.530014] Stack:
[  348.530014]  00000000 f4ce63e0 f5f9bd80 f6409a64 f9291d80 0000ce67 f5d51e00 f4ce63e0
[  348.530014]  f3788416 f6409a80 f9291dc1 f4ce8320 f4ce63e0 f5d51e00 f4ce63e0 f4ce8320
[  348.530014]  f6409a98 f9277f6f 00000000 00000000 0000007c 00000000 f6409b2c f9278dd1
[  348.530014] Call Trace:
[  348.530014]  [&lt;f9291d80&gt;] mesh_nexthop_lookup+0xbb/0xc8 [mac80211]
[  348.530014]  [&lt;f9291dc1&gt;] mesh_nexthop_resolve+0x34/0xd8 [mac80211]
[  348.530014]  [&lt;f9277f6f&gt;] ieee80211_xmit+0x92/0xc1 [mac80211]
[  348.530014]  [&lt;f9278dd1&gt;] __ieee80211_subif_start_xmit+0x807/0x83c [mac80211]
[  348.530014]  [&lt;c04df012&gt;] ? sch_direct_xmit+0xd7/0x1b3
[  348.530014]  [&lt;c022a8c6&gt;] ? __local_bh_enable_ip+0x5d/0x7b
[  348.530014]  [&lt;f956870c&gt;] ? nf_nat_ipv4_out+0x4c/0xd0 [nf_nat_ipv4]
[  348.530014]  [&lt;f957e036&gt;] ? iptable_nat_ipv4_fn+0xf/0xf [iptable_nat]
[  348.530014]  [&lt;c04c6f45&gt;] ? netif_skb_features+0x14d/0x30a
[  348.530014]  [&lt;f9278e10&gt;] ieee80211_subif_start_xmit+0xa/0xe [mac80211]
[  348.530014]  [&lt;c04c769c&gt;] dev_hard_start_xmit+0x1f8/0x267
[  348.530014]  [&lt;c04c7261&gt;] ?  validate_xmit_skb.isra.120.part.121+0x10/0x253
[  348.530014]  [&lt;c04defc6&gt;] sch_direct_xmit+0x8b/0x1b3
[  348.530014]  [&lt;c04c7a9c&gt;] __dev_queue_xmit+0x2c8/0x513
[  348.530014]  [&lt;c04c7cfb&gt;] dev_queue_xmit+0xa/0xc
[  348.530014]  [&lt;f91bfc7a&gt;] batadv_send_skb_packet+0xd6/0xec [batman_adv]
[  348.530014]  [&lt;f91bfdc4&gt;] batadv_send_unicast_skb+0x15/0x4a [batman_adv]
[  348.530014]  [&lt;f91b5938&gt;] batadv_dat_send_data+0x27e/0x310 [batman_adv]
[  348.530014]  [&lt;f91c30b5&gt;] ? batadv_tt_global_hash_find.isra.11+0x8/0xa [batman_adv]
[  348.530014]  [&lt;f91b63f3&gt;] batadv_dat_snoop_outgoing_arp_request+0x208/0x23d [batman_adv]
[  348.530014]  [&lt;f91c0cd9&gt;] batadv_interface_tx+0x206/0x385 [batman_adv]
[  348.530014]  [&lt;c04c769c&gt;] dev_hard_start_xmit+0x1f8/0x267
[  348.530014]  [&lt;c04c7261&gt;] ?  validate_xmit_skb.isra.120.part.121+0x10/0x253
[  348.530014]  [&lt;c04defc6&gt;] sch_direct_xmit+0x8b/0x1b3
[  348.530014]  [&lt;c04c7a9c&gt;] __dev_queue_xmit+0x2c8/0x513
[  348.530014]  [&lt;f80cbd2a&gt;] ? igb_xmit_frame+0x57/0x72 [igb]
[  348.530014]  [&lt;c04c7cfb&gt;] dev_queue_xmit+0xa/0xc
[  348.530014]  [&lt;f843a326&gt;] br_dev_queue_push_xmit+0xeb/0xfb [bridge]
[  348.530014]  [&lt;f843a35f&gt;] br_forward_finish+0x29/0x74 [bridge]
[  348.530014]  [&lt;f843a23b&gt;] ? deliver_clone+0x3b/0x3b [bridge]
[  348.530014]  [&lt;f843a714&gt;] __br_forward+0x89/0xe7 [bridge]
[  348.530014]  [&lt;f843a336&gt;] ? br_dev_queue_push_xmit+0xfb/0xfb [bridge]
[  348.530014]  [&lt;f843a234&gt;] deliver_clone+0x34/0x3b [bridge]
[  348.530014]  [&lt;f843a68b&gt;] ? br_flood+0x95/0x95 [bridge]
[  348.530014]  [&lt;f843a66d&gt;] br_flood+0x77/0x95 [bridge]
[  348.530014]  [&lt;f843a809&gt;] br_flood_forward+0x13/0x1a [bridge]
[  348.530014]  [&lt;f843a68b&gt;] ? br_flood+0x95/0x95 [bridge]
[  348.530014]  [&lt;f843b877&gt;] br_handle_frame_finish+0x392/0x3db [bridge]
[  348.530014]  [&lt;c04e9b2b&gt;] ? nf_iterate+0x2b/0x6b
[  348.530014]  [&lt;f843baa6&gt;] br_handle_frame+0x1e6/0x240 [bridge]
[  348.530014]  [&lt;f843b4e5&gt;] ? br_handle_local_finish+0x6a/0x6a [bridge]
[  348.530014]  [&lt;c04c4ba0&gt;] __netif_receive_skb_core+0x43a/0x66b
[  348.530014]  [&lt;f843b8c0&gt;] ? br_handle_frame_finish+0x3db/0x3db [bridge]
[  348.530014]  [&lt;c023cea4&gt;] ? resched_curr+0x19/0x37
[  348.530014]  [&lt;c0240707&gt;] ? check_preempt_wakeup+0xbf/0xfe
[  348.530014]  [&lt;c0255dec&gt;] ? ktime_get_with_offset+0x5c/0xfc
[  348.530014]  [&lt;c04c4fc1&gt;] __netif_receive_skb+0x47/0x55
[  348.530014]  [&lt;c04c57ba&gt;] netif_receive_skb_internal+0x40/0x5a
[  348.530014]  [&lt;c04c61ef&gt;] napi_gro_receive+0x3a/0x94
[  348.530014]  [&lt;f80ce8d5&gt;] igb_poll+0x6fd/0x9ad [igb]
[  348.530014]  [&lt;c0242bd8&gt;] ? swake_up_locked+0x14/0x26
[  348.530014]  [&lt;c04c5d29&gt;] net_rx_action+0xde/0x250
[  348.530014]  [&lt;c022a743&gt;] __do_softirq+0x8a/0x163
[  348.530014]  [&lt;c022a6b9&gt;] ? __hrtimer_tasklet_trampoline+0x19/0x19
[  348.530014]  [&lt;c021100f&gt;] do_softirq_own_stack+0x26/0x2c
[  348.530014]  &lt;IRQ&gt;
[  348.530014]  [&lt;c022a957&gt;] irq_exit+0x31/0x6f
[  348.530014]  [&lt;c0210eb2&gt;] do_IRQ+0x8d/0xa0
[  348.530014]  [&lt;c058152c&gt;] common_interrupt+0x2c/0x40
[  348.530014] Code: e7 8c 00 66 81 ff 88 00 75 12 85 d2 75 0e b2 c3 b8 83 e9 29 f9 e8 a7 5f f9 c6 eb 74 66 81 e3 8c 005
[  348.530014] EIP: [&lt;f929245d&gt;] ieee80211_mps_set_frame_flags+0x40/0xaa [mac80211] SS:ESP 0068:f6409a40
[  348.530014] CR2: 0000000000020040
[  348.530014] ---[ end trace 48556ac26779732e ]---
[  348.530014] Kernel panic - not syncing: Fatal exception in interrupt
[  348.530014] Kernel Offset: disabled

Reported-by: Fred Veldini &lt;fred.veldini@gmail.com&gt;
Tested-by: Fred Veldini &lt;fred.veldini@gmail.com&gt;
Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mac80211: fix fast_tx header alignment</title>
<updated>2016-07-27T16:47:27+00:00</updated>
<author>
<name>Felix Fietkau</name>
<email>nbd@nbd.name</email>
</author>
<published>2016-05-19T15:34:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9dcbb4d9fdae96d9320f5c794229a2c7e522cc5f'/>
<id>9dcbb4d9fdae96d9320f5c794229a2c7e522cc5f</id>
<content type='text'>
commit 6fe04128f158c5ad27e7504bfdf1b12e63331bc9 upstream.

The header field is defined as u8[] but also accessed as struct
ieee80211_hdr. Enforce an alignment of 2 to prevent unnecessary
unaligned accesses, which can be very harmful for performance on many
platforms.

Fixes: e495c24731a2 ("mac80211: extend fast-xmit for more ciphers")
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 6fe04128f158c5ad27e7504bfdf1b12e63331bc9 upstream.

The header field is defined as u8[] but also accessed as struct
ieee80211_hdr. Enforce an alignment of 2 to prevent unnecessary
unaligned accesses, which can be very harmful for performance on many
platforms.

Fixes: e495c24731a2 ("mac80211: extend fast-xmit for more ciphers")
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
</feed>
