<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/net/wireless/sysfs.c, branch v4.19.121</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.19.121</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.19.121'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2018-06-29T07:49:28Z</updated>
<entry>
<title>cfg80211: track time using boottime</title>
<updated>2018-06-29T07:49:28Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2018-06-18T15:11:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=fe0984d38938249f3f11fc558a8845fc6f8a0105'/>
<id>urn:sha1:fe0984d38938249f3f11fc558a8845fc6f8a0105</id>
<content type='text'>
The cfg80211 layer uses get_seconds() to read the current time
in its supend handling. This function is deprecated because of the 32-bit
time_t overflow, and it can cause unexpected behavior when the time
changes due to settimeofday() calls or leap second updates.

In many cases, we want to use monotonic time instead, however cfg80211
explicitly tracks the time spent in suspend, so this changes the
driver over to use ktime_get_boottime_seconds(), which is slightly
slower, but not used in a fastpath here.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>cfg80211: check rdev resume callback only for registered wiphy</title>
<updated>2017-03-29T07:11:29Z</updated>
<author>
<name>Arend Van Spriel</name>
<email>arend.vanspriel@broadcom.com</email>
</author>
<published>2017-03-28T08:11:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b3ef5520c1eabb56064474043c7c55a1a65b8708'/>
<id>urn:sha1:b3ef5520c1eabb56064474043c7c55a1a65b8708</id>
<content type='text'>
We got the following use-after-free KASAN report:

 BUG: KASAN: use-after-free in wiphy_resume+0x591/0x5a0 [cfg80211]
	 at addr ffff8803fc244090
 Read of size 8 by task kworker/u16:24/2587
 CPU: 6 PID: 2587 Comm: kworker/u16:24 Tainted: G    B 4.9.13-debug+
 Hardware name: Dell Inc. XPS 15 9550/0N7TVV, BIOS 1.2.19 12/22/2016
 Workqueue: events_unbound async_run_entry_fn
  ffff880425d4f9d8 ffffffffaeedb541 ffff88042b80ef00 ffff8803fc244088
  ffff880425d4fa00 ffffffffae84d7a1 ffff880425d4fa98 ffff8803fc244080
  ffff88042b80ef00 ffff880425d4fa88 ffffffffae84da3a ffffffffc141f7d9
 Call Trace:
  [&lt;ffffffffaeedb541&gt;] dump_stack+0x85/0xc4
  [&lt;ffffffffae84d7a1&gt;] kasan_object_err+0x21/0x70
  [&lt;ffffffffae84da3a&gt;] kasan_report_error+0x1fa/0x500
  [&lt;ffffffffc141f7d9&gt;] ? cfg80211_bss_age+0x39/0xc0 [cfg80211]
  [&lt;ffffffffc141f83a&gt;] ? cfg80211_bss_age+0x9a/0xc0 [cfg80211]
  [&lt;ffffffffae48d46d&gt;] ? trace_hardirqs_on+0xd/0x10
  [&lt;ffffffffc13fb1c0&gt;] ? wiphy_suspend+0xc70/0xc70 [cfg80211]
  [&lt;ffffffffae84def1&gt;] __asan_report_load8_noabort+0x61/0x70
  [&lt;ffffffffc13fb100&gt;] ? wiphy_suspend+0xbb0/0xc70 [cfg80211]
  [&lt;ffffffffc13fb751&gt;] ? wiphy_resume+0x591/0x5a0 [cfg80211]
  [&lt;ffffffffc13fb751&gt;] wiphy_resume+0x591/0x5a0 [cfg80211]
  [&lt;ffffffffc13fb1c0&gt;] ? wiphy_suspend+0xc70/0xc70 [cfg80211]
  [&lt;ffffffffaf3b206e&gt;] dpm_run_callback+0x6e/0x4f0
  [&lt;ffffffffaf3b31b2&gt;] device_resume+0x1c2/0x670
  [&lt;ffffffffaf3b367d&gt;] async_resume+0x1d/0x50
  [&lt;ffffffffae3ee84e&gt;] async_run_entry_fn+0xfe/0x610
  [&lt;ffffffffae3d0666&gt;] process_one_work+0x716/0x1a50
  [&lt;ffffffffae3d05c9&gt;] ? process_one_work+0x679/0x1a50
  [&lt;ffffffffafdd7b6d&gt;] ? _raw_spin_unlock_irq+0x3d/0x60
  [&lt;ffffffffae3cff50&gt;] ? pwq_dec_nr_in_flight+0x2b0/0x2b0
  [&lt;ffffffffae3d1a80&gt;] worker_thread+0xe0/0x1460
  [&lt;ffffffffae3d19a0&gt;] ? process_one_work+0x1a50/0x1a50
  [&lt;ffffffffae3e54c2&gt;] kthread+0x222/0x2e0
  [&lt;ffffffffae3e52a0&gt;] ? kthread_park+0x80/0x80
  [&lt;ffffffffae3e52a0&gt;] ? kthread_park+0x80/0x80
  [&lt;ffffffffae3e52a0&gt;] ? kthread_park+0x80/0x80
  [&lt;ffffffffafdd86aa&gt;] ret_from_fork+0x2a/0x40
 Object at ffff8803fc244088, in cache kmalloc-1024 size: 1024
 Allocated:
 PID = 71
  save_stack_trace+0x1b/0x20
  save_stack+0x46/0xd0
  kasan_kmalloc+0xad/0xe0
  kasan_slab_alloc+0x12/0x20
  __kmalloc_track_caller+0x134/0x360
  kmemdup+0x20/0x50
  brcmf_cfg80211_attach+0x10b/0x3a90 [brcmfmac]
  brcmf_bus_start+0x19a/0x9a0 [brcmfmac]
  brcmf_pcie_setup+0x1f1a/0x3680 [brcmfmac]
  brcmf_fw_request_nvram_done+0x44c/0x11b0 [brcmfmac]
  request_firmware_work_func+0x135/0x280
  process_one_work+0x716/0x1a50
  worker_thread+0xe0/0x1460
  kthread+0x222/0x2e0
  ret_from_fork+0x2a/0x40
 Freed:
 PID = 2568
  save_stack_trace+0x1b/0x20
  save_stack+0x46/0xd0
  kasan_slab_free+0x71/0xb0
  kfree+0xe8/0x2e0
  brcmf_cfg80211_detach+0x62/0xf0 [brcmfmac]
  brcmf_detach+0x14a/0x2b0 [brcmfmac]
  brcmf_pcie_remove+0x140/0x5d0 [brcmfmac]
  brcmf_pcie_pm_leave_D3+0x198/0x2e0 [brcmfmac]
  pci_pm_resume+0x186/0x220
  dpm_run_callback+0x6e/0x4f0
  device_resume+0x1c2/0x670
  async_resume+0x1d/0x50
  async_run_entry_fn+0xfe/0x610
  process_one_work+0x716/0x1a50
  worker_thread+0xe0/0x1460
  kthread+0x222/0x2e0
  ret_from_fork+0x2a/0x40
 Memory state around the buggy address:
  ffff8803fc243f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
  ffff8803fc244000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 &gt;ffff8803fc244080: fc fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                          ^
  ffff8803fc244100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
  ffff8803fc244180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb

What is happening is that brcmf_pcie_resume() detects a device that
is no longer responsive and it decides to unbind resulting in a
wiphy_unregister() and wiphy_free() call. Now the wiphy instance
remains allocated, because PM needs to call wiphy_resume() for it.
However, brcmfmac already does a kfree() for the struct
cfg80211_registered_device::ops field. Change the checks in
wiphy_resume() to only access the struct cfg80211_registered_device::ops
if the wiphy instance is still registered at this time.

Cc: stable@vger.kernel.org # 4.10.x, 4.9.x
Reported-by: Daniel J Blueman &lt;daniel@quora.org&gt;
Reviewed-by: Hante Meuleman &lt;hante.meuleman@broadcom.com&gt;
Reviewed-by: Pieter-Paul Giesberts &lt;pieter-paul.giesberts@broadcom.com&gt;
Reviewed-by: Franky Lin &lt;franky.lin@broadcom.com&gt;
Signed-off-by: Arend van Spriel &lt;arend.vanspriel@broadcom.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>cfg80211: sysfs: use wiphy_name()</title>
<updated>2017-01-04T07:24:49Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2017-01-04T07:24:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5ec71dd7f1b63da20fefebabf1e66cb530b9eb4d'/>
<id>urn:sha1:5ec71dd7f1b63da20fefebabf1e66cb530b9eb4d</id>
<content type='text'>
Instead of open-coding dev_name(), use the wiphy_name() inline
to make the code easier to understand. While at it, clean up
some coding style.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>cfg80211: process events caused by suspend before suspending</title>
<updated>2016-10-26T05:59:52Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2016-10-26T05:56:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e1957dba5b54b9c9b1d16f9d5f3f8d41d82bee41'/>
<id>urn:sha1:e1957dba5b54b9c9b1d16f9d5f3f8d41d82bee41</id>
<content type='text'>
When suspending without WoWLAN, cfg80211 will ask drivers to
disconnect. Even when the driver does this synchronously, and
immediately returns with a notification, cfg80211 schedules
the handling thereof to a workqueue, and may then call back
into the driver when the driver was already suspended/ing.

Fix this by processing all events caused by cfg80211_leave_all()
directly after that function returns. The driver still needs to
do the right thing here and wait for the firmware response, but
that is - at least - true for mwifiex where this occurred.

Reported-by: Amitkumar Karwar &lt;akarwar@marvell.com&gt;
Tested-by: Amitkumar Karwar &lt;akarwar@marvell.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>cfg80211: remove unnecessary pointer-of</title>
<updated>2016-09-15T14:46:20Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2016-09-15T08:57:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ec53c832ee90b86414ca243d0e6fdbb9cf5e413b'/>
<id>urn:sha1:ec53c832ee90b86414ca243d0e6fdbb9cf5e413b</id>
<content type='text'>
For an array, there's no need to use &amp;array, so just use the
plain wiphy-&gt;addresses[i].addr here to silence smatch.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>cfg80211: make wdev_list accessible to drivers</title>
<updated>2016-05-12T09:16:40Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2016-05-03T13:52:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=53873f134d285191ef6435882d55837093a36c53'/>
<id>urn:sha1:53873f134d285191ef6435882d55837093a36c53</id>
<content type='text'>
There's no harm in having drivers read the list, since they can
use RCU protection or RTNL locking; allow this to not require
each and every driver to also implement its own bookkeeping.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>cfg80211: Switch to PM ops</title>
<updated>2015-05-20T13:00:12Z</updated>
<author>
<name>Lars-Peter Clausen</name>
<email>lars@metafoo.de</email>
</author>
<published>2015-05-16T12:35:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=262918d847c0f66a0ec05db9de7571ed72e422af'/>
<id>urn:sha1:262918d847c0f66a0ec05db9de7571ed72e422af</id>
<content type='text'>
Use dev_pm_ops instead of the legacy suspend/resume callbacks for the wiphy
class suspend and resume operations.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>net: wireless: convert class code to use dev_groups</title>
<updated>2013-07-25T23:34:40Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2013-07-24T22:05:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f0bc99c84349ce87af5b35839d19bfb17bb9b27f'/>
<id>urn:sha1:f0bc99c84349ce87af5b35839d19bfb17bb9b27f</id>
<content type='text'>
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead.  This converts the networking wireless class
code to use the correct field.

Reviewed-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Cc: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>cfg80211: fix compilation warning for cfg80211_leave_all()</title>
<updated>2013-06-24T13:57:32Z</updated>
<author>
<name>Arend van Spriel</name>
<email>arend@broadcom.com</email>
</author>
<published>2013-06-23T10:51:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a33d402610d2d3a422136defe8237f4ddfb69fd9'/>
<id>urn:sha1:a33d402610d2d3a422136defe8237f4ddfb69fd9</id>
<content type='text'>
The following compilation issue popped up moving from v3.10-rc1 to
v3.10-rc6 after merging wireless-testing.

net/wireless/sysfs.c:86:13: error: 'cfg80211_leave_all' defined
but not used [-Werror=unused-function]

The function is only called when CONFIG_PM is enabled. Moving the
function under CONFIG_PM as well.

Signed-off-by: Arend van Spriel &lt;arend@broadcom.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>cfg80211: make WoWLAN configuration available to drivers</title>
<updated>2013-05-27T13:10:58Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2013-05-15T07:30:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6abb9cb99f33b20c2f32f18a3ae9cc7543e46edb'/>
<id>urn:sha1:6abb9cb99f33b20c2f32f18a3ae9cc7543e46edb</id>
<content type='text'>
Make the current WoWLAN configuration available to drivers
at runtime. This isn't really useful for the normal WoWLAN
behaviour and accessing it can also be racy, but drivers
may use it for testing the WoWLAN device behaviour while
the host stays up &amp; running to observe the device.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
</feed>
