<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/net/wireless/sysfs.c, branch v6.1.168</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-06-21T12:35:31+00:00</updated>
<entry>
<title>wifi: cfg80211: fully move wiphy work to unbound workqueue</title>
<updated>2024-06-21T12:35:31+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2024-05-22T10:41:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=96c950d6b022c7db14c7c570bb75a2804666a1a4'/>
<id>urn:sha1:96c950d6b022c7db14c7c570bb75a2804666a1a4</id>
<content type='text'>
[ Upstream commit e296c95eac655008d5a709b8cf54d0018da1c916 ]

Previously I had moved the wiphy work to the unbound
system workqueue, but missed that when it restarts and
during resume it was still using the normal system
workqueue. Fix that.

Fixes: 91d20ab9d9ca ("wifi: cfg80211: use system_unbound_wq for wiphy work")
Reviewed-by: Miriam Rachel Korenblit &lt;miriam.rachel.korenblit@intel.com&gt;
Link: https://msgid.link/20240522124126.7ca959f2cbd3.I3e2a71ef445d167b84000ccf934ea245aef8d395@changeid
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>wifi: cfg80211: add flush functions for wiphy work</title>
<updated>2023-11-20T10:51:51+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2023-08-28T11:59:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=697fb94e3e8d2d87183bd401006f6041612477b7'/>
<id>urn:sha1:697fb94e3e8d2d87183bd401006f6041612477b7</id>
<content type='text'>
[ Upstream commit 56cfb8ce1f7f6c4e5ca571a2ec0880e131cd0311 ]

There may be sometimes reasons to actually run the work
if it's pending, add flush functions for both regular and
delayed wiphy work that will do this.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Stable-dep-of: eadfb54756ae ("wifi: mac80211: move sched-scan stop work to wiphy work")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>wifi: cfg80211: add a work abstraction with special semantics</title>
<updated>2023-10-10T20:00:39+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2023-06-06T12:49:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3fcc6d7d5f40dad56dee7bde787b7e23edd4b93c'/>
<id>urn:sha1:3fcc6d7d5f40dad56dee7bde787b7e23edd4b93c</id>
<content type='text'>
[ Upstream commit a3ee4dc84c4e9d14cb34dad095fd678127aca5b6 ]

Add a work abstraction at the cfg80211 level that will always
hold the wiphy_lock() for any work executed and therefore also
can be canceled safely (without waiting) while holding that.
This improves on what we do now as with the new wiphy works we
don't have to worry about locking while cancelling them safely.

Also, don't let such works run while the device is suspended,
since they'll likely need to interact with the device. Flush
them before suspend though.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Stable-dep-of: 37c20b2effe9 ("wifi: cfg80211: fix cqm_config access race")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>cfg80211: shut down interfaces on failed resume</title>
<updated>2021-06-09T14:09:20+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2021-06-08T09:32:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=65bec836da8394b1d56bdec2c478dcac21cf12a4'/>
<id>urn:sha1:65bec836da8394b1d56bdec2c478dcac21cf12a4</id>
<content type='text'>
If resume fails, we should shut down all interfaces as the
hardware is probably dead. This was/is already done now in
mac80211, but we need to change that due to locking issues,
so move it here and do it without the wiphy lock held.

Cc: stable@vger.kernel.org
Fixes: 2fe8ef106238 ("cfg80211: change netdev registration/unregistration semantics")
Link: https://lore.kernel.org/r/20210608113226.d564ca69de7c.I2e3c3e5d410b72a4f63bade4fb075df041b3d92f@changeid
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>cfg80211: remove unused callback</title>
<updated>2021-02-12T07:52:25+00:00</updated>
<author>
<name>Matteo Croce</name>
<email>mcroce@microsoft.com</email>
</author>
<published>2021-02-08T11:33:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=258afa78661178d16288537ffe8ef863c7e5918a'/>
<id>urn:sha1:258afa78661178d16288537ffe8ef863c7e5918a</id>
<content type='text'>
The ieee80211 class registers a callback which actually does nothing.
Given that the callback is optional, and all its accesses are protected
by a NULL check, remove it entirely.

Signed-off-by: Matteo Croce &lt;mcroce@microsoft.com&gt;
Link: https://lore.kernel.org/r/20210208113356.4105-1-mcroce@linux.microsoft.com
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>cfg80211: avoid holding the RTNL when calling the driver</title>
<updated>2021-01-26T10:55:50+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2021-01-22T15:19:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a05829a7222e9d10c416dd2dbbf3929fe6646b89'/>
<id>urn:sha1:a05829a7222e9d10c416dd2dbbf3929fe6646b89</id>
<content type='text'>
Currently, _everything_ in cfg80211 holds the RTNL, and if you
have a slow USB device (or a few) you can get some bad lock
contention on that.

Fix that by re-adding a mutex to each wiphy/rdev as we had at
some point, so we have locking for the wireless_dev lists and
all the other things in there, and also so that drivers still
don't have to worry too much about it (they still won't get
parallel calls for a single device).

Then, we can restrict the RTNL to a few cases where we add or
remove interfaces and really need the added protection. Some
of the global list management still also uses the RTNL, since
we need to have it anyway for netdev management, but we only
hold the RTNL for very short periods of time here.

Link: https://lore.kernel.org/r/20210122161942.81df9f5e047a.I4a8e1a60b18863ea8c5e6d3a0faeafb2d45b2f40@changeid
Tested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt; [marvell driver issues]
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 432</title>
<updated>2019-06-05T15:37:16+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-06-01T08:08:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=28c61a66abd6925b574adfd48811254bb6a211b2'/>
<id>urn:sha1:28c61a66abd6925b574adfd48811254bb6a211b2</id>
<content type='text'>
Based on 1 normalized pattern(s):

  this file is gplv2 as found in copying

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190531190114.657082701@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>cfg80211: track time using boottime</title>
<updated>2018-06-29T07:49:28+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2018-06-18T15:11:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/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:29+00:00</updated>
<author>
<name>Arend Van Spriel</name>
<email>arend.vanspriel@broadcom.com</email>
</author>
<published>2017-03-28T08:11:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/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:49+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2017-01-04T07:24:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/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>
</feed>
