2019-05-19 13:08:20 +01:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-17 15:49:02 +01:00
|
|
|
|
2014-09-03 15:24:58 +03:00
|
|
|
|
2018-06-09 09:14:42 +03:00
|
|
|
|
2026-03-18 14:39:15 +02:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
2010-11-16 19:56:49 -08:00
|
|
|
|
|
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 17:04:11 +09:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-08-19 16:08:22 +08:00
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
2009-10-07 17:09:06 +04:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
2007-09-20 13:09:35 -04:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
2009-05-02 00:37:21 -04:00
|
|
|
|
2009-07-27 12:01:53 +02:00
|
|
|
|
2012-06-27 17:19:42 +03:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wifi: cfg80211: Add debugfs support for multi-radio wiphy
In multi-radio wiphy architecture, where a single wiphy can have
multiple radios tied to it, radio specific configuration parameters
and global wiphy parameters are maintained for the entire physical
device and common to all radios. But, each radio in a wiphy can have
different values for each radio configuration parameter, like RTS
threshold. With the current debugfs directory structure, the values
of global wiphy configuration parameters can be viewed, but, values
of individual radio configuration parameters cannot be viewed, as
radio specific configuration parameters are not maintained, separately.
To address this, in addition to maintaining global wiphy configuration
parameters common to all radios, create separate debugfs directories
for each radio in a wiphy to maintain parameters corresponding to that
radio in this directory.
In implementation, maintain a dentry structure in wiphy_radio_cfg, a
structure containing radio configurations of a wiphy. This struct is
maintained to denote per-radio configurations of a wiphy. Create
separate directories representing each radio within phy#X directory in
debugfs during wiphy registration.
Sample directory structure with this change:
ls /sys/kernel/debug/ieee80211/phy0/radio
radio0/ radio1/ radio2/
Signed-off-by: Roopni Devanathan <quic_rdevanat@quicinc.com>
Link: https://patch.msgid.link/20251024044649.483557-2-quic_rdevanat@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2025-10-24 10:16:48 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-28 16:22:06 -07:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2013-05-08 21:45:15 +02:00
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2009-08-07 16:17:38 +02:00
|
|
|
|
2009-02-21 00:04:21 -05:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-11-25 15:13:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-21 14:10:27 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2007-09-20 13:09:35 -04:00
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2007-09-20 13:09:35 -04:00
|
|
|
|
2013-05-08 21:45:15 +02:00
|
|
|
|
2009-02-21 00:04:25 -05:00
|
|
|
|
2023-08-28 13:59:32 +02:00
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
|
|
|
|
|
2007-09-20 13:09:35 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-21 00:04:26 -05:00
|
|
|
|
|
|
|
|
|
2014-04-21 12:53:03 +08:00
|
|
|
|
2012-12-03 18:23:37 +01:00
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2009-02-21 00:04:26 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2009-02-21 00:04:26 -05:00
|
|
|
|
2013-05-08 21:45:15 +02:00
|
|
|
|
2009-02-21 00:04:26 -05:00
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
|
|
|
|
|
2009-02-21 00:04:26 -05:00
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2009-02-21 00:04:26 -05:00
|
|
|
|
|
|
|
|
|
2014-10-22 12:23:00 -07:00
|
|
|
|
|
|
|
|
|
2007-09-20 13:09:35 -04:00
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2014-10-22 12:23:00 -07:00
|
|
|
|
2007-09-20 13:09:35 -04:00
|
|
|
|
2013-05-08 21:45:15 +02:00
|
|
|
|
2008-05-08 14:30:18 -07:00
|
|
|
|
2018-04-03 14:33:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-11 14:46:52 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-08 14:30:18 -07:00
|
|
|
|
2023-08-28 13:59:32 +02:00
|
|
|
|
2014-10-22 12:23:00 -07:00
|
|
|
|
2010-10-11 14:46:52 -04:00
|
|
|
|
2008-05-08 14:30:18 -07:00
|
|
|
|
2014-10-22 12:23:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 14:49:24 +02:00
|
|
|
|
2014-10-22 12:23:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-09-20 13:09:35 -04:00
|
|
|
|
|
|
|
|
|
2009-03-24 09:35:46 +01:00
|
|
|
|
2007-09-20 13:09:35 -04:00
|
|
|
|
2025-01-12 08:07:05 +00:00
|
|
|
|
2007-09-20 13:09:35 -04:00
|
|
|
|
2014-05-26 13:52:25 +02:00
|
|
|
|
2007-09-20 13:09:35 -04:00
|
|
|
|
2009-03-24 09:35:46 +01:00
|
|
|
|
2007-09-20 13:09:35 -04:00
|
|
|
|
|
|
|
|
|
2009-07-14 00:33:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-11-19 00:56:28 +01:00
|
|
|
|
2009-07-14 00:33:35 +02:00
|
|
|
|
|
|
|
|
|
2016-05-03 16:52:04 +03:00
|
|
|
|
2012-06-15 18:00:00 +02:00
|
|
|
|
|
|
|
|
|
2025-02-28 11:20:56 +01:00
|
|
|
|
2009-07-14 00:33:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-02-28 11:20:56 +01:00
|
|
|
|
2009-07-14 00:33:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-03 16:52:04 +03:00
|
|
|
|
|
|
|
|
|
2009-07-14 00:33:35 +02:00
|
|
|
|
2012-06-15 18:00:00 +02:00
|
|
|
|
|
|
|
|
|
2025-02-28 11:20:56 +01:00
|
|
|
|
2009-07-14 00:33:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-02-28 11:20:56 +01:00
|
|
|
|
2009-07-14 00:33:35 +02:00
|
|
|
|
2010-08-05 17:45:15 +02:00
|
|
|
|
|
|
|
|
|
2009-07-14 00:33:35 +02:00
|
|
|
|
|
|
|
|
|
2024-11-22 09:42:25 +01:00
|
|
|
|
|
|
|
|
|
2018-10-27 09:31:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 14:49:24 +02:00
|
|
|
|
2018-10-27 09:31:24 +02:00
|
|
|
|
|
|
|
|
|
2009-07-14 00:33:35 +02:00
|
|
|
|
|
|
|
|
|
2010-08-05 17:45:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-10-27 09:31:24 +02:00
|
|
|
|
2023-06-06 14:49:24 +02:00
|
|
|
|
2018-10-27 09:31:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-05 17:45:15 +02:00
|
|
|
|
2009-07-14 00:33:35 +02:00
|
|
|
|
|
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
|
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
2024-11-22 09:42:25 +01:00
|
|
|
|
|
|
|
|
|
2012-06-27 17:19:42 +03:00
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
|
|
|
|
|
2013-03-19 15:04:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2013-03-19 15:04:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-10-20 20:08:22 +01:00
|
|
|
|
2013-03-19 15:04:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-10-20 20:08:22 +01:00
|
|
|
|
2013-03-19 15:04:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-09 21:35:19 +03:00
|
|
|
|
2020-09-18 11:33:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-05 17:10:13 +03:00
|
|
|
|
cfg80211: send scan results from work queue
Due to the previous commit, when a scan finishes, it is in theory
possible to hit the following sequence:
1. interface starts being removed
2. scan is cancelled by driver and cfg80211 is notified
3. scan done work is scheduled
4. interface is removed completely, rdev->scan_req is freed,
event sent to userspace but scan done work remains pending
5. new scan is requested on another virtual interface
6. scan done work runs, freeing the still-running scan
To fix this situation, hang on to the scan done message and block
new scans while that is the case, and only send the message from
the work function, regardless of whether the scan_req is already
freed from interface removal. This makes step 5 above impossible
and changes step 6 to be
5. scan done work runs, sending the scan done message
As this can't work for wext, so we send the message immediately,
but this shouldn't be an issue since we still return -EBUSY.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-01-22 11:14:19 +02:00
|
|
|
|
2014-01-22 11:14:18 +02:00
|
|
|
|
2013-03-19 15:04:07 +01:00
|
|
|
|
|
|
|
|
|
2016-09-20 17:31:13 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-18 14:39:15 +02:00
|
|
|
|
|
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2016-09-20 17:31:13 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-10-20 20:08:22 +01:00
|
|
|
|
2016-09-20 17:31:13 +03:00
|
|
|
|
|
|
|
|
|
2026-03-18 14:39:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-20 17:31:13 +03:00
|
|
|
|
2016-10-20 20:08:22 +01:00
|
|
|
|
2016-09-20 17:31:13 +03:00
|
|
|
|
2026-01-07 14:22:53 +02:00
|
|
|
|
|
|
|
|
|
2016-09-20 17:31:13 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-18 14:39:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-04-20 14:38:47 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-30 14:19:04 +02:00
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
2014-04-30 14:19:04 +02:00
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
|
|
|
|
|
2014-04-30 14:19:04 +02:00
|
|
|
|
2013-03-19 15:04:07 +01:00
|
|
|
|
2026-03-18 14:39:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-03 16:52:04 +03:00
|
|
|
|
2012-06-16 00:19:54 +02:00
|
|
|
|
2012-06-15 18:00:00 +02:00
|
|
|
|
2012-06-16 00:19:54 +02:00
|
|
|
|
|
|
|
|
|
2026-03-18 14:39:17 +02:00
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2026-03-18 14:39:17 +02:00
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2026-03-18 14:39:17 +02:00
|
|
|
|
2012-06-16 00:19:54 +02:00
|
|
|
|
|
|
|
|
|
2013-03-19 15:04:07 +01:00
|
|
|
|
2012-06-16 00:19:54 +02:00
|
|
|
|
2016-09-20 17:31:13 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-04-20 14:38:47 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-16 00:19:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-30 14:19:04 +02:00
|
|
|
|
|
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
2014-04-30 14:19:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-30 14:24:44 +03:00
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
2019-08-30 14:24:44 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
|
|
|
|
|
2009-07-07 03:56:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-11-22 09:42:25 +01:00
|
|
|
|
|
|
|
|
|
2009-08-21 14:51:05 +02:00
|
|
|
|
2009-07-07 03:56:11 +02:00
|
|
|
|
|
|
|
|
|
2014-03-24 17:57:27 +01:00
|
|
|
|
|
|
|
|
|
2017-04-26 07:43:41 +02:00
|
|
|
|
2014-03-24 17:57:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-01 14:09:51 +01:00
|
|
|
|
cfg80211: fix locking in netlink owner interface destruction
Harald Arnesen reported [1] a deadlock at reboot time, and after
he captured a stack trace a picture developed of what's going on:
The distribution he's using is using iwd (not wpa_supplicant) to
manage wireless. iwd will usually use the "socket owner" option
when it creates new interfaces, so that they're automatically
destroyed when it quits (unexpectedly or otherwise). This is also
done by wpa_supplicant, but it doesn't do it for the normal one,
only for additional ones, which is different with iwd.
Anyway, during shutdown, iwd quits while the netdev is still UP,
i.e. IFF_UP is set. This causes the stack trace that Linus so
nicely transcribed from the pictures:
cfg80211_destroy_iface_wk() takes wiphy_lock
-> cfg80211_destroy_ifaces()
->ieee80211_del_iface
->ieeee80211_if_remove
->cfg80211_unregister_wdev
->unregister_netdevice_queue
->dev_close_many
->__dev_close_many
->raw_notifier_call_chain
->cfg80211_netdev_notifier_call
and that last call tries to take wiphy_lock again.
In commit a05829a7222e ("cfg80211: avoid holding the RTNL when
calling the driver") I had taken into account the possibility of
recursing from cfg80211 into cfg80211_netdev_notifier_call() via
the network stack, but only for NETDEV_UNREGISTER, not for what
happens here, NETDEV_GOING_DOWN and NETDEV_DOWN notifications.
Additionally, while this worked still back in commit 78f22b6a3a92
("cfg80211: allow userspace to take ownership of interfaces"), it
missed another corner case: unregistering a netdev will cause
dev_close() to be called, and thus stop wireless operations (e.g.
disconnecting), but there are some types of virtual interfaces in
wifi that don't have a netdev - for that we need an additional
call to cfg80211_leave().
So, to fix this mess, change cfg80211_destroy_ifaces() to not
require the wiphy_lock(), but instead make it acquire it, but
only after it has actually closed all the netdevs on the list,
and then call cfg80211_leave() as well before removing them
from the driver, to fix the second issue. The locking change in
this requires modifying the nl80211 call to not get the wiphy
lock passed in, but acquire it by itself after flushing any
potentially pending destruction requests.
[1] https://lore.kernel.org/r/09464e67-f3de-ac09-28a3-e27b7914ee7d@skogtun.org
Cc: stable@vger.kernel.org # 5.12
Reported-by: Harald Arnesen <harald@skogtun.org>
Fixes: 776a39b8196d ("cfg80211: call cfg80211_destroy_ifaces() with wiphy lock held")
Fixes: 78f22b6a3a92 ("cfg80211: allow userspace to take ownership of interfaces")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Tested-by: Harald Arnesen <harald@skogtun.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-04-27 11:49:52 +02:00
|
|
|
|
2026-03-18 14:39:17 +02:00
|
|
|
|
|
|
|
|
|
cfg80211: fix locking in netlink owner interface destruction
Harald Arnesen reported [1] a deadlock at reboot time, and after
he captured a stack trace a picture developed of what's going on:
The distribution he's using is using iwd (not wpa_supplicant) to
manage wireless. iwd will usually use the "socket owner" option
when it creates new interfaces, so that they're automatically
destroyed when it quits (unexpectedly or otherwise). This is also
done by wpa_supplicant, but it doesn't do it for the normal one,
only for additional ones, which is different with iwd.
Anyway, during shutdown, iwd quits while the netdev is still UP,
i.e. IFF_UP is set. This causes the stack trace that Linus so
nicely transcribed from the pictures:
cfg80211_destroy_iface_wk() takes wiphy_lock
-> cfg80211_destroy_ifaces()
->ieee80211_del_iface
->ieeee80211_if_remove
->cfg80211_unregister_wdev
->unregister_netdevice_queue
->dev_close_many
->__dev_close_many
->raw_notifier_call_chain
->cfg80211_netdev_notifier_call
and that last call tries to take wiphy_lock again.
In commit a05829a7222e ("cfg80211: avoid holding the RTNL when
calling the driver") I had taken into account the possibility of
recursing from cfg80211 into cfg80211_netdev_notifier_call() via
the network stack, but only for NETDEV_UNREGISTER, not for what
happens here, NETDEV_GOING_DOWN and NETDEV_DOWN notifications.
Additionally, while this worked still back in commit 78f22b6a3a92
("cfg80211: allow userspace to take ownership of interfaces"), it
missed another corner case: unregistering a netdev will cause
dev_close() to be called, and thus stop wireless operations (e.g.
disconnecting), but there are some types of virtual interfaces in
wifi that don't have a netdev - for that we need an additional
call to cfg80211_leave().
So, to fix this mess, change cfg80211_destroy_ifaces() to not
require the wiphy_lock(), but instead make it acquire it, but
only after it has actually closed all the netdevs on the list,
and then call cfg80211_leave() as well before removing them
from the driver, to fix the second issue. The locking change in
this requires modifying the nl80211 call to not get the wiphy
lock passed in, but acquire it by itself after flushing any
potentially pending destruction requests.
[1] https://lore.kernel.org/r/09464e67-f3de-ac09-28a3-e27b7914ee7d@skogtun.org
Cc: stable@vger.kernel.org # 5.12
Reported-by: Harald Arnesen <harald@skogtun.org>
Fixes: 776a39b8196d ("cfg80211: call cfg80211_destroy_ifaces() with wiphy lock held")
Fixes: 78f22b6a3a92 ("cfg80211: allow userspace to take ownership of interfaces")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Tested-by: Harald Arnesen <harald@skogtun.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-04-27 11:49:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-11-22 09:42:25 +01:00
|
|
|
|
|
|
|
|
|
2022-07-06 09:57:42 +02:00
|
|
|
|
cfg80211: fix locking in netlink owner interface destruction
Harald Arnesen reported [1] a deadlock at reboot time, and after
he captured a stack trace a picture developed of what's going on:
The distribution he's using is using iwd (not wpa_supplicant) to
manage wireless. iwd will usually use the "socket owner" option
when it creates new interfaces, so that they're automatically
destroyed when it quits (unexpectedly or otherwise). This is also
done by wpa_supplicant, but it doesn't do it for the normal one,
only for additional ones, which is different with iwd.
Anyway, during shutdown, iwd quits while the netdev is still UP,
i.e. IFF_UP is set. This causes the stack trace that Linus so
nicely transcribed from the pictures:
cfg80211_destroy_iface_wk() takes wiphy_lock
-> cfg80211_destroy_ifaces()
->ieee80211_del_iface
->ieeee80211_if_remove
->cfg80211_unregister_wdev
->unregister_netdevice_queue
->dev_close_many
->__dev_close_many
->raw_notifier_call_chain
->cfg80211_netdev_notifier_call
and that last call tries to take wiphy_lock again.
In commit a05829a7222e ("cfg80211: avoid holding the RTNL when
calling the driver") I had taken into account the possibility of
recursing from cfg80211 into cfg80211_netdev_notifier_call() via
the network stack, but only for NETDEV_UNREGISTER, not for what
happens here, NETDEV_GOING_DOWN and NETDEV_DOWN notifications.
Additionally, while this worked still back in commit 78f22b6a3a92
("cfg80211: allow userspace to take ownership of interfaces"), it
missed another corner case: unregistering a netdev will cause
dev_close() to be called, and thus stop wireless operations (e.g.
disconnecting), but there are some types of virtual interfaces in
wifi that don't have a netdev - for that we need an additional
call to cfg80211_leave().
So, to fix this mess, change cfg80211_destroy_ifaces() to not
require the wiphy_lock(), but instead make it acquire it, but
only after it has actually closed all the netdevs on the list,
and then call cfg80211_leave() as well before removing them
from the driver, to fix the second issue. The locking change in
this requires modifying the nl80211 call to not get the wiphy
lock passed in, but acquire it by itself after flushing any
potentially pending destruction requests.
[1] https://lore.kernel.org/r/09464e67-f3de-ac09-28a3-e27b7914ee7d@skogtun.org
Cc: stable@vger.kernel.org # 5.12
Reported-by: Harald Arnesen <harald@skogtun.org>
Fixes: 776a39b8196d ("cfg80211: call cfg80211_destroy_ifaces() with wiphy lock held")
Fixes: 78f22b6a3a92 ("cfg80211: allow userspace to take ownership of interfaces")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Tested-by: Harald Arnesen <harald@skogtun.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-04-27 11:49:52 +02:00
|
|
|
|
|
|
|
|
|
2014-03-24 17:57:27 +01:00
|
|
|
|
|
|
|
|
|
2026-03-18 14:39:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-24 17:57:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 14:49:32 +02:00
|
|
|
|
|
|
|
|
|
2014-12-15 13:25:39 +02:00
|
|
|
|
|
|
|
|
|
2017-04-21 13:05:00 +01:00
|
|
|
|
2014-12-15 13:25:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-21 13:05:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-12-15 13:25:39 +02:00
|
|
|
|
|
|
|
|
|
2017-02-27 17:04:35 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-06 21:00:03 +02:00
|
|
|
|
|
|
|
|
|
2024-11-22 09:42:25 +01:00
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
2024-11-22 09:42:25 +01:00
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-13 17:20:32 +01:00
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
|
|
|
|
|
2024-05-06 21:00:03 +02:00
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
2014-10-22 12:23:00 -07:00
|
|
|
|
|
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2013-05-08 21:49:02 +02:00
|
|
|
|
2010-10-11 14:46:52 -04:00
|
|
|
|
|
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
2009-07-07 03:56:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-12-03 09:20:44 +01:00
|
|
|
|
2015-12-16 22:43:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-12-19 02:03:29 +01:00
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
|
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2013-05-08 21:49:02 +02:00
|
|
|
|
2007-04-26 20:50:35 -07:00
|
|
|
|
2012-12-03 18:23:37 +01:00
|
|
|
|
2010-10-11 14:46:52 -04:00
|
|
|
|
2013-05-08 21:49:02 +02:00
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-04 22:23:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-11 14:46:52 -04:00
|
|
|
|
2014-10-22 12:23:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 09:58:27 +01:00
|
|
|
|
|
|
|
|
|
2014-10-22 12:23:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 09:58:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-22 12:23:00 -07:00
|
|
|
|
2010-10-11 14:46:52 -04:00
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2016-05-03 16:52:04 +03:00
|
|
|
|
2012-10-26 14:49:25 -07:00
|
|
|
|
|
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
|
|
|
|
|
2017-04-21 13:05:00 +01:00
|
|
|
|
2023-06-06 14:49:33 +02:00
|
|
|
|
2013-02-08 18:16:19 +01:00
|
|
|
|
|
|
|
|
|
2009-09-29 23:27:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-19 10:40:14 +08:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2014-03-24 17:57:27 +01:00
|
|
|
|
2023-06-06 14:49:32 +02:00
|
|
|
|
2017-04-28 13:40:28 +01:00
|
|
|
|
2017-02-27 17:04:35 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-04 12:04:20 +02:00
|
|
|
|
|
|
|
|
|
2021-10-25 13:31:12 +02:00
|
|
|
|
2025-03-18 11:13:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-24 17:57:27 +01:00
|
|
|
|
2009-11-19 00:56:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-08-12 23:33:20 +02:00
|
|
|
|
2009-07-14 00:33:35 +02:00
|
|
|
|
|
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2021-06-16 23:28:26 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
2021-06-16 23:28:26 +03:00
|
|
|
|
2019-06-10 13:02:19 -07:00
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-30 14:24:44 +03:00
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
|
|
|
|
|
2021-11-29 14:11:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
2009-08-18 19:51:57 +02:00
|
|
|
|
|
|
|
|
|
2009-04-20 18:39:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-21 22:50:47 +01:00
|
|
|
|
2009-04-20 18:39:05 +02:00
|
|
|
|
2014-05-09 14:11:46 +03:00
|
|
|
|
|
|
|
|
|
2015-10-12 09:51:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2014-10-22 12:23:00 -07:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2024-09-17 19:32:39 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-13 10:58:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-17 19:32:39 +05:30
|
|
|
|
2011-05-13 10:58:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-17 19:32:39 +05:30
|
|
|
|
2011-05-13 10:58:57 +02:00
|
|
|
|
2013-01-08 14:04:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-13 10:58:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-17 19:32:39 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-08 14:04:07 +01:00
|
|
|
|
|
|
|
|
|
2011-05-13 10:58:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-27 11:07:21 +02:00
|
|
|
|
2011-05-13 10:58:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-17 19:32:39 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-16 00:19:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-01-07 13:51:57 +02:00
|
|
|
|
|
|
|
|
|
2016-09-20 17:31:13 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-10-21 14:25:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-13 10:58:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-10-18 10:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-13 10:58:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-17 19:32:39 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-04-13 20:30:00 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
2014-04-21 12:53:03 +08:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2016-04-12 15:56:15 +02:00
|
|
|
|
2008-01-24 19:38:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-08-29 16:26:43 -07:00
|
|
|
|
|
|
|
|
|
2012-06-27 09:23:48 +02:00
|
|
|
|
2013-06-03 17:25:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-13 10:48:55 +02:00
|
|
|
|
2012-06-27 09:23:48 +02:00
|
|
|
|
2014-11-19 12:54:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-04-20 14:38:47 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-13 10:48:55 +02:00
|
|
|
|
2016-09-20 17:31:13 +03:00
|
|
|
|
2016-09-20 17:31:15 +03:00
|
|
|
|
2017-02-08 15:00:34 +02:00
|
|
|
|
|
|
|
|
|
2016-09-20 17:31:13 +03:00
|
|
|
|
|
|
|
|
|
wifi: cfg80211: separately store HT, VHT and HE capabilities for NAN
In NAN, unlike in other modes, there is only one set of (HT, VHT, HE)
capabilities that is used for all channels (and bands) used in the NAN
data path.
This set of capabilities will have to be a special one, for example - have
the minimum of (HT-for-5 GHz, HT-for-2.4 GHz), careful handling of the
bits that have a different meaning for each band, etc.
While we could use the exiting sband/iftype capabilities, and require
identical capabilities for all bands (makes no sense since this means
that we will have VHT capabilities in the 2.4 GHz slot),
or require that only one of the sbands will be set,
or have logic to extract the minimum and handle the conflicting bits -
it seems simpler to add a dedicated set of capabilities which is special
for NAN, and is band agnostic, to be populated by the driver.
That way we also let the driver decide how it wants to handle the
conflicting bits.
Add this special set of these capabilities to wiphy:nan_capabilities, to be
populated by the driver.
Send it to user space.
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260219114327.4b6f3e4a81b4.I45422adc0df3ad4101d857a92e83f0de5cf241e1@changeid
Link: https://patch.msgid.link/20260318123926.206536-5-miriam.rachel.korenblit@intel.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2026-03-18 14:39:18 +02:00
|
|
|
|
2026-05-05 19:46:13 +03:00
|
|
|
|
wifi: cfg80211: separately store HT, VHT and HE capabilities for NAN
In NAN, unlike in other modes, there is only one set of (HT, VHT, HE)
capabilities that is used for all channels (and bands) used in the NAN
data path.
This set of capabilities will have to be a special one, for example - have
the minimum of (HT-for-5 GHz, HT-for-2.4 GHz), careful handling of the
bits that have a different meaning for each band, etc.
While we could use the exiting sband/iftype capabilities, and require
identical capabilities for all bands (makes no sense since this means
that we will have VHT capabilities in the 2.4 GHz slot),
or require that only one of the sbands will be set,
or have logic to extract the minimum and handle the conflicting bits -
it seems simpler to add a dedicated set of capabilities which is special
for NAN, and is band agnostic, to be populated by the driver.
That way we also let the driver decide how it wants to handle the
conflicting bits.
Add this special set of these capabilities to wiphy:nan_capabilities, to be
populated by the driver.
Send it to user space.
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260219114327.4b6f3e4a81b4.I45422adc0df3ad4101d857a92e83f0de5cf241e1@changeid
Link: https://patch.msgid.link/20260318123926.206536-5-miriam.rachel.korenblit@intel.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2026-03-18 14:39:18 +02:00
|
|
|
|
|
|
|
|
|
2016-10-18 10:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cfg80211: add peer measurement with FTM initiator API
Add a new "peer measurement" API, that can be used to measure
certain things related to a peer. Right now, only implement
FTM (flight time measurement) over it, but the idea is that
it'll be extensible to also support measuring the necessary
things to calculate e.g. angle-of-arrival for WiGig.
The API is structured to have a generic list of peers and
channels to measure with/on, and then for each of those a
set of measurements (again, only FTM right now) to perform.
Results are sent to the requesting socket, including a final
complete message.
Closing the controlling netlink socket will abort a running
measurement.
v3:
- add a bit to report "final" for partial results
- remove list keeping etc. and just unicast out the results
to the requester (big code reduction ...)
- also send complete message unicast, and as a result
remove the multicast group
- separate out struct cfg80211_pmsr_ftm_request_peer
from struct cfg80211_pmsr_request_peer
- document timeout == 0 if no timeout
- disallow setting timeout nl80211 attribute to 0,
must not include attribute for no timeout
- make MAC address randomization optional
- change num bursts exponent default to 0 (1 burst, rather
rather than the old default of 15==don't care)
v4:
- clarify NL80211_ATTR_TIMEOUT documentation
v5:
- remove unnecessary nl80211 multicast/family changes
- remove partial results bit/flag, final is sufficient
- add max_bursts_exponent, max_ftms_per_burst to capability
- rename "frames per burst" -> "FTMs per burst"
v6:
- rename cfg80211_pmsr_free_wdev() to cfg80211_pmsr_wdev_down()
and call it in leave, so the device can't go down with any
pending measurements
v7:
- wording fixes (Lior)
- fix ftm.max_bursts_exponent to allow having the limit of 0 (Lior)
v8:
- copyright statements
- minor coding style fixes
- fix error path leak
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-09-10 13:29:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-31 13:12:38 +02:00
|
|
|
|
cfg80211: add peer measurement with FTM initiator API
Add a new "peer measurement" API, that can be used to measure
certain things related to a peer. Right now, only implement
FTM (flight time measurement) over it, but the idea is that
it'll be extensible to also support measuring the necessary
things to calculate e.g. angle-of-arrival for WiGig.
The API is structured to have a generic list of peers and
channels to measure with/on, and then for each of those a
set of measurements (again, only FTM right now) to perform.
Results are sent to the requesting socket, including a final
complete message.
Closing the controlling netlink socket will abort a running
measurement.
v3:
- add a bit to report "final" for partial results
- remove list keeping etc. and just unicast out the results
to the requester (big code reduction ...)
- also send complete message unicast, and as a result
remove the multicast group
- separate out struct cfg80211_pmsr_ftm_request_peer
from struct cfg80211_pmsr_request_peer
- document timeout == 0 if no timeout
- disallow setting timeout nl80211 attribute to 0,
must not include attribute for no timeout
- make MAC address randomization optional
- change num bursts exponent default to 0 (1 burst, rather
rather than the old default of 15==don't care)
v4:
- clarify NL80211_ATTR_TIMEOUT documentation
v5:
- remove unnecessary nl80211 multicast/family changes
- remove partial results bit/flag, final is sufficient
- add max_bursts_exponent, max_ftms_per_burst to capability
- rename "frames per burst" -> "FTMs per burst"
v6:
- rename cfg80211_pmsr_free_wdev() to cfg80211_pmsr_wdev_down()
and call it in leave, so the device can't go down with any
pending measurements
v7:
- wording fixes (Lior)
- fix ftm.max_bursts_exponent to allow having the limit of 0 (Lior)
v8:
- copyright statements
- minor coding style fixes
- fix error path leak
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-09-10 13:29:12 +02:00
|
|
|
|
|
|
|
|
|
2020-01-31 13:12:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cfg80211: add peer measurement with FTM initiator API
Add a new "peer measurement" API, that can be used to measure
certain things related to a peer. Right now, only implement
FTM (flight time measurement) over it, but the idea is that
it'll be extensible to also support measuring the necessary
things to calculate e.g. angle-of-arrival for WiGig.
The API is structured to have a generic list of peers and
channels to measure with/on, and then for each of those a
set of measurements (again, only FTM right now) to perform.
Results are sent to the requesting socket, including a final
complete message.
Closing the controlling netlink socket will abort a running
measurement.
v3:
- add a bit to report "final" for partial results
- remove list keeping etc. and just unicast out the results
to the requester (big code reduction ...)
- also send complete message unicast, and as a result
remove the multicast group
- separate out struct cfg80211_pmsr_ftm_request_peer
from struct cfg80211_pmsr_request_peer
- document timeout == 0 if no timeout
- disallow setting timeout nl80211 attribute to 0,
must not include attribute for no timeout
- make MAC address randomization optional
- change num bursts exponent default to 0 (1 burst, rather
rather than the old default of 15==don't care)
v4:
- clarify NL80211_ATTR_TIMEOUT documentation
v5:
- remove unnecessary nl80211 multicast/family changes
- remove partial results bit/flag, final is sufficient
- add max_bursts_exponent, max_ftms_per_burst to capability
- rename "frames per burst" -> "FTMs per burst"
v6:
- rename cfg80211_pmsr_free_wdev() to cfg80211_pmsr_wdev_down()
and call it in leave, so the device can't go down with any
pending measurements
v7:
- wording fixes (Lior)
- fix ftm.max_bursts_exponent to allow having the limit of 0 (Lior)
v8:
- copyright statements
- minor coding style fixes
- fix error path leak
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-09-10 13:29:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-05-29 08:40:27 +02:00
|
|
|
|
cfg80211: add peer measurement with FTM initiator API
Add a new "peer measurement" API, that can be used to measure
certain things related to a peer. Right now, only implement
FTM (flight time measurement) over it, but the idea is that
it'll be extensible to also support measuring the necessary
things to calculate e.g. angle-of-arrival for WiGig.
The API is structured to have a generic list of peers and
channels to measure with/on, and then for each of those a
set of measurements (again, only FTM right now) to perform.
Results are sent to the requesting socket, including a final
complete message.
Closing the controlling netlink socket will abort a running
measurement.
v3:
- add a bit to report "final" for partial results
- remove list keeping etc. and just unicast out the results
to the requester (big code reduction ...)
- also send complete message unicast, and as a result
remove the multicast group
- separate out struct cfg80211_pmsr_ftm_request_peer
from struct cfg80211_pmsr_request_peer
- document timeout == 0 if no timeout
- disallow setting timeout nl80211 attribute to 0,
must not include attribute for no timeout
- make MAC address randomization optional
- change num bursts exponent default to 0 (1 burst, rather
rather than the old default of 15==don't care)
v4:
- clarify NL80211_ATTR_TIMEOUT documentation
v5:
- remove unnecessary nl80211 multicast/family changes
- remove partial results bit/flag, final is sufficient
- add max_bursts_exponent, max_ftms_per_burst to capability
- rename "frames per burst" -> "FTMs per burst"
v6:
- rename cfg80211_pmsr_free_wdev() to cfg80211_pmsr_wdev_down()
and call it in leave, so the device can't go down with any
pending measurements
v7:
- wording fixes (Lior)
- fix ftm.max_bursts_exponent to allow having the limit of 0 (Lior)
v8:
- copyright statements
- minor coding style fixes
- fix error path leak
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-09-10 13:29:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-12-15 19:26:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-28 11:51:26 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-11-07 12:39:33 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-20 12:02:33 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-18 11:18:45 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-02 20:37:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-09 13:08:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-22 10:19:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-20 12:02:33 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-08-29 16:26:43 -07:00
|
|
|
|
|
|
|
|
|
2010-08-12 15:38:38 +02:00
|
|
|
|
2008-08-29 16:26:43 -07:00
|
|
|
|
|
|
|
|
|
2008-01-24 19:38:38 +01:00
|
|
|
|
2011-05-13 10:58:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-04-13 20:30:00 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-24 19:38:38 +01:00
|
|
|
|
2016-04-12 15:56:15 +02:00
|
|
|
|
2023-08-28 09:54:39 +02:00
|
|
|
|
2018-06-09 09:14:42 +03:00
|
|
|
|
2020-05-28 21:34:42 +02:00
|
|
|
|
2018-06-09 09:14:42 +03:00
|
|
|
|
2008-01-24 19:38:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-02 09:32:32 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-01 23:22:47 -07:00
|
|
|
|
2012-07-02 09:32:32 +03:00
|
|
|
|
|
|
|
|
|
2020-06-01 23:22:47 -07:00
|
|
|
|
|
|
|
|
|
2012-07-02 09:32:32 +03:00
|
|
|
|
2009-01-21 15:13:48 +01:00
|
|
|
|
|
|
|
|
|
2020-05-28 21:34:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-21 14:10:27 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-12 15:56:15 +02:00
|
|
|
|
2011-04-21 14:10:27 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-21 15:13:48 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-24 19:38:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-17 13:56:19 +02:00
|
|
|
|
2008-01-24 19:38:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-24 12:01:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-24 19:38:38 +01:00
|
|
|
|
|
|
|
|
|
2023-08-28 09:54:39 +02:00
|
|
|
|
2022-08-16 11:26:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-06-09 09:14:42 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 21:34:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-16 11:26:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-06-09 09:14:42 +03:00
|
|
|
|
|
|
|
|
|
2020-05-28 21:34:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-24 19:38:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-28 10:56:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-27 09:23:48 +02:00
|
|
|
|
2013-06-03 17:25:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-27 09:23:48 +02:00
|
|
|
|
2011-05-04 15:37:28 +02:00
|
|
|
|
2022-05-23 18:55:58 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-15 13:53:10 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:
Single allocations: kmalloc(sizeof(TYPE), ...)
are replaced with: kmalloc_obj(TYPE, ...)
Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with: kmalloc_objs(TYPE, COUNT, ...)
Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)
(where TYPE may also be *VAR)
The resulting allocations no longer return "void *", instead returning
"TYPE *".
Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-20 23:49:23 -08:00
|
|
|
|
Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses
Conversion performed via this Coccinelle script:
// SPDX-License-Identifier: GPL-2.0-only
// Options: --include-headers-for-types --all-includes --include-headers --keep-comments
virtual patch
@gfp depends on patch && !(file in "tools") && !(file in "samples")@
identifier ALLOC = {kmalloc_obj,kmalloc_objs,kmalloc_flex,
kzalloc_obj,kzalloc_objs,kzalloc_flex,
kvmalloc_obj,kvmalloc_objs,kvmalloc_flex,
kvzalloc_obj,kvzalloc_objs,kvzalloc_flex};
@@
ALLOC(...
- , GFP_KERNEL
)
$ make coccicheck MODE=patch COCCI=gfp.cocci
Build and boot tested x86_64 with Fedora 42's GCC and Clang:
Linux version 6.19.0+ (user@host) (gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7), GNU ld version 2.44-12.fc42) #1 SMP PREEMPT_DYNAMIC 1970-01-01
Linux version 6.19.0+ (user@host) (clang version 20.1.8 (Fedora 20.1.8-4.fc42), LLD 20.1.8) #1 SMP PREEMPT_DYNAMIC 1970-01-01
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-21 23:46:04 -08:00
|
|
|
|
2025-06-15 13:53:10 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-24 19:38:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-26 17:14:38 +02:00
|
|
|
|
|
|
|
|
|
2025-08-17 21:04:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-26 20:03:45 +02:00
|
|
|
|
2023-06-06 14:49:24 +02:00
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2010-08-30 17:36:40 -04:00
|
|
|
|
2023-06-06 14:49:24 +02:00
|
|
|
|
2013-09-26 20:03:45 +02:00
|
|
|
|
2010-08-30 17:36:40 -04:00
|
|
|
|
|
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
2010-01-17 15:49:02 +01:00
|
|
|
|
2009-08-07 16:17:38 +02:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
2019-07-03 09:01:42 +02:00
|
|
|
|
|
|
|
|
|
wifi: cfg80211: Add debugfs support for multi-radio wiphy
In multi-radio wiphy architecture, where a single wiphy can have
multiple radios tied to it, radio specific configuration parameters
and global wiphy parameters are maintained for the entire physical
device and common to all radios. But, each radio in a wiphy can have
different values for each radio configuration parameter, like RTS
threshold. With the current debugfs directory structure, the values
of global wiphy configuration parameters can be viewed, but, values
of individual radio configuration parameters cannot be viewed, as
radio specific configuration parameters are not maintained, separately.
To address this, in addition to maintaining global wiphy configuration
parameters common to all radios, create separate debugfs directories
for each radio in a wiphy to maintain parameters corresponding to that
radio in this directory.
In implementation, maintain a dentry structure in wiphy_radio_cfg, a
structure containing radio configurations of a wiphy. This struct is
maintained to denote per-radio configurations of a wiphy. Create
separate directories representing each radio within phy#X directory in
debugfs during wiphy registration.
Sample directory structure with this change:
ls /sys/kernel/debug/ieee80211/phy0/radio
radio0/ radio1/ radio2/
Signed-off-by: Roopni Devanathan <quic_rdevanat@quicinc.com>
Link: https://patch.msgid.link/20251024044649.483557-2-quic_rdevanat@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2025-10-24 10:16:48 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2014-08-13 16:04:51 +03:00
|
|
|
|
|
|
|
|
|
2023-06-06 14:49:24 +02:00
|
|
|
|
2014-08-13 16:04:51 +03:00
|
|
|
|
2021-06-18 13:41:46 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-11-11 22:15:29 +01:00
|
|
|
|
2025-11-10 14:03:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-03-09 22:07:42 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-16 10:41:04 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-12 14:00:59 +02:00
|
|
|
|
|
|
|
|
|
2013-09-26 20:03:45 +02:00
|
|
|
|
2021-06-16 23:28:26 +03:00
|
|
|
|
2013-09-26 20:03:45 +02:00
|
|
|
|
2021-06-16 23:28:26 +03:00
|
|
|
|
|
|
|
|
|
2013-09-26 20:03:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-10 16:50:29 +02:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
|
|
|
|
|
2014-04-21 12:53:03 +08:00
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2021-06-16 23:28:26 +03:00
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 13:59:33 +02:00
|
|
|
|
|
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-06 21:00:03 +02:00
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 13:59:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
2014-04-21 12:53:03 +08:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2013-05-08 21:45:15 +02:00
|
|
|
|
|
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2013-05-08 21:45:15 +02:00
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2013-05-08 21:45:15 +02:00
|
|
|
|
|
|
|
|
|
2021-06-16 23:28:26 +03:00
|
|
|
|
|
|
|
|
|
2013-06-04 19:21:08 +02:00
|
|
|
|
2011-08-12 14:00:59 +02:00
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2014-05-26 13:52:25 +02:00
|
|
|
|
2011-08-12 14:00:59 +02:00
|
|
|
|
|
|
|
|
|
2016-05-03 16:52:04 +03:00
|
|
|
|
2009-08-18 19:51:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-27 12:59:03 +01:00
|
|
|
|
2010-01-17 15:49:02 +01:00
|
|
|
|
|
|
|
|
|
2007-04-26 20:51:12 -07:00
|
|
|
|
2012-07-12 11:49:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-11-12 14:22:02 -08:00
|
|
|
|
2009-08-07 16:17:38 +02:00
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2023-06-06 14:49:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
|
|
|
|
|
2023-08-28 13:59:33 +02:00
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2013-05-08 21:45:15 +02:00
|
|
|
|
2009-07-13 13:24:44 +02:00
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-06-20 00:25:42 +08:00
|
|
|
|
2026-02-11 11:20:24 +03:00
|
|
|
|
2009-07-13 13:24:44 +02:00
|
|
|
|
|
|
|
|
|
2013-02-08 18:16:19 +01:00
|
|
|
|
2021-11-29 14:11:24 +01:00
|
|
|
|
2014-03-24 17:57:27 +01:00
|
|
|
|
2017-02-27 17:04:35 +05:30
|
|
|
|
|
|
|
|
|
2020-06-04 12:04:20 +02:00
|
|
|
|
2021-11-29 14:11:24 +01:00
|
|
|
|
2012-04-04 15:05:25 +02:00
|
|
|
|
|
|
|
|
|
2024-05-23 12:02:13 +02:00
|
|
|
|
|
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2009-02-10 21:25:55 +01:00
|
|
|
|
2012-10-26 14:49:25 -07:00
|
|
|
|
2025-03-06 12:37:59 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-06-16 23:28:26 +03:00
|
|
|
|
2012-10-26 14:49:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2013-02-01 01:49:58 +01:00
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2021-09-27 13:11:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-07-07 03:56:12 +02:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-15 13:53:10 +05:30
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-22 22:46:31 +02:00
|
|
|
|
|
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
2014-04-21 12:53:03 +08:00
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
2021-06-16 23:28:26 +03:00
|
|
|
|
2019-08-30 14:24:44 +03:00
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
2021-03-22 22:46:31 +02:00
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
2021-01-22 16:19:42 +01:00
|
|
|
|
|
|
|
|
|
2012-06-16 00:19:54 +02:00
|
|
|
|
2014-04-21 12:53:03 +08:00
|
|
|
|
2023-08-16 15:38:04 +02:00
|
|
|
|
2022-04-14 16:50:57 +02:00
|
|
|
|
2012-06-16 00:19:54 +02:00
|
|
|
|
|
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2012-06-16 00:19:54 +02:00
|
|
|
|
2016-08-03 16:58:35 -05:00
|
|
|
|
|
|
|
|
|
2021-01-22 16:19:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-16 00:19:54 +02:00
|
|
|
|
2021-01-22 16:19:42 +01:00
|
|
|
|
2012-06-16 00:19:54 +02:00
|
|
|
|
2026-07-06 23:24:18 +08:00
|
|
|
|
2012-06-16 00:19:54 +02:00
|
|
|
|
2018-10-01 14:09:17 +02:00
|
|
|
|
|
|
|
|
|
2012-06-16 00:19:54 +02:00
|
|
|
|
|
|
|
|
|
2013-03-19 15:04:07 +01:00
|
|
|
|
2012-06-16 00:19:54 +02:00
|
|
|
|
2016-09-20 17:31:13 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-04-20 14:38:47 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-16 00:19:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-10 10:02:31 +01:00
|
|
|
|
2018-10-01 14:09:17 +02:00
|
|
|
|
2020-08-06 23:18:13 -07:00
|
|
|
|
2019-11-26 11:05:44 +01:00
|
|
|
|
2018-10-01 14:09:17 +02:00
|
|
|
|
2023-08-16 15:38:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-22 16:17:42 +02:00
|
|
|
|
2021-01-22 16:19:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-14 16:50:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-22 16:19:42 +01:00
|
|
|
|
2022-04-14 16:50:57 +02:00
|
|
|
|
|
|
|
|
|
2012-06-16 00:19:54 +02:00
|
|
|
|
2018-10-01 14:09:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-22 16:19:42 +01:00
|
|
|
|
2018-10-01 14:09:17 +02:00
|
|
|
|
2012-06-16 00:19:54 +02:00
|
|
|
|
|
|
|
|
|
2014-01-21 00:00:56 +01:00
|
|
|
|
2009-10-02 05:15:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-29 12:47:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2012-06-29 12:47:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-18 14:39:17 +02:00
|
|
|
|
|
|
|
|
|
2013-02-28 10:55:25 +01:00
|
|
|
|
|
|
|
|
|
2017-04-21 13:05:00 +01:00
|
|
|
|
2013-02-28 10:55:25 +01:00
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2013-12-05 11:21:26 +02:00
|
|
|
|
cfg80211: add peer measurement with FTM initiator API
Add a new "peer measurement" API, that can be used to measure
certain things related to a peer. Right now, only implement
FTM (flight time measurement) over it, but the idea is that
it'll be extensible to also support measuring the necessary
things to calculate e.g. angle-of-arrival for WiGig.
The API is structured to have a generic list of peers and
channels to measure with/on, and then for each of those a
set of measurements (again, only FTM right now) to perform.
Results are sent to the requesting socket, including a final
complete message.
Closing the controlling netlink socket will abort a running
measurement.
v3:
- add a bit to report "final" for partial results
- remove list keeping etc. and just unicast out the results
to the requester (big code reduction ...)
- also send complete message unicast, and as a result
remove the multicast group
- separate out struct cfg80211_pmsr_ftm_request_peer
from struct cfg80211_pmsr_request_peer
- document timeout == 0 if no timeout
- disallow setting timeout nl80211 attribute to 0,
must not include attribute for no timeout
- make MAC address randomization optional
- change num bursts exponent default to 0 (1 burst, rather
rather than the old default of 15==don't care)
v4:
- clarify NL80211_ATTR_TIMEOUT documentation
v5:
- remove unnecessary nl80211 multicast/family changes
- remove partial results bit/flag, final is sufficient
- add max_bursts_exponent, max_ftms_per_burst to capability
- rename "frames per burst" -> "FTMs per burst"
v6:
- rename cfg80211_pmsr_free_wdev() to cfg80211_pmsr_wdev_down()
and call it in leave, so the device can't go down with any
pending measurements
v7:
- wording fixes (Lior)
- fix ftm.max_bursts_exponent to allow having the limit of 0 (Lior)
v8:
- copyright statements
- minor coding style fixes
- fix error path leak
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-09-10 13:29:12 +02:00
|
|
|
|
|
|
|
|
|
2025-11-21 17:40:21 +01:00
|
|
|
|
2021-11-29 14:11:24 +01:00
|
|
|
|
2021-10-23 11:10:50 +02:00
|
|
|
|
2013-02-28 10:55:25 +01:00
|
|
|
|
|
|
|
|
|
2023-08-29 12:18:56 +02:00
|
|
|
|
2013-02-28 10:55:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-21 13:05:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-28 10:55:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-15 17:44:01 +02:00
|
|
|
|
|
|
|
|
|
2013-02-28 10:55:25 +01:00
|
|
|
|
|
|
|
|
|
2023-08-29 12:18:56 +02:00
|
|
|
|
2013-02-28 10:55:25 +01:00
|
|
|
|
|
|
|
|
|
2013-07-30 10:11:25 +02:00
|
|
|
|
2025-11-27 15:41:23 +05:30
|
|
|
|
2013-02-28 10:55:25 +01:00
|
|
|
|
2014-11-03 10:33:18 +01:00
|
|
|
|
2023-08-29 12:18:56 +02:00
|
|
|
|
2014-11-03 10:33:18 +01:00
|
|
|
|
2014-10-31 14:16:12 +01:00
|
|
|
|
2026-01-07 14:04:51 +02:00
|
|
|
|
|
|
|
|
|
2016-09-20 17:31:13 +03:00
|
|
|
|
2026-01-07 14:04:51 +02:00
|
|
|
|
2014-10-31 14:16:12 +01:00
|
|
|
|
2026-04-20 14:38:47 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-31 14:16:12 +01:00
|
|
|
|
|
|
|
|
|
2026-03-18 14:39:17 +02:00
|
|
|
|
2014-10-31 14:16:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-09 10:57:47 +01:00
|
|
|
|
2014-10-31 14:16:12 +01:00
|
|
|
|
|
|
|
|
|
2013-02-28 10:55:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-18 14:39:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-27 15:41:23 +05:30
|
|
|
|
|
|
|
|
|
2014-04-09 15:11:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-27 15:41:23 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-09 15:11:01 +02:00
|
|
|
|
2026-03-18 14:39:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:
Single allocations: kmalloc(sizeof(TYPE), ...)
are replaced with: kmalloc_obj(TYPE, ...)
Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with: kmalloc_objs(TYPE, COUNT, ...)
Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)
(where TYPE may also be *VAR)
The resulting allocations no longer return "void *", instead returning
"TYPE *".
Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-20 23:49:23 -08:00
|
|
|
|
2014-04-09 15:11:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-27 15:41:23 +05:30
|
|
|
|
2014-04-09 15:11:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-27 15:41:23 +05:30
|
|
|
|
2014-04-09 15:11:01 +02:00
|
|
|
|
cfg80211: initialize wdev data earlier
There's a race condition in the netdev registration in that
NETDEV_REGISTER actually happens after the netdev is available,
and so if we initialize things only there, we might get called
with an uninitialized wdev through nl80211 - not using a wdev
but using a netdev interface index.
I found this while looking into a syzbot report, but it doesn't
really seem to be related, and unfortunately there's no repro
for it (yet). I can't (yet) explain how it managed to get into
cfg80211_release_pmsr() from nl80211_netlink_notify() without
the wdev having been initialized, as the latter only iterates
the wdevs that are linked into the rdev, which even without the
change here happened after init.
However, looking at this, it seems fairly clear that the init
needs to be done earlier, otherwise we might even re-init on a
netns move, when data might still be pending.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20201009135821.fdcbba3aad65.Ie9201d91dbcb7da32318812effdc1561aeaf4cdc@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-10-09 13:58:22 +02:00
|
|
|
|
2018-09-13 14:12:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cfg80211: add peer measurement with FTM initiator API
Add a new "peer measurement" API, that can be used to measure
certain things related to a peer. Right now, only implement
FTM (flight time measurement) over it, but the idea is that
it'll be extensible to also support measuring the necessary
things to calculate e.g. angle-of-arrival for WiGig.
The API is structured to have a generic list of peers and
channels to measure with/on, and then for each of those a
set of measurements (again, only FTM right now) to perform.
Results are sent to the requesting socket, including a final
complete message.
Closing the controlling netlink socket will abort a running
measurement.
v3:
- add a bit to report "final" for partial results
- remove list keeping etc. and just unicast out the results
to the requester (big code reduction ...)
- also send complete message unicast, and as a result
remove the multicast group
- separate out struct cfg80211_pmsr_ftm_request_peer
from struct cfg80211_pmsr_request_peer
- document timeout == 0 if no timeout
- disallow setting timeout nl80211 attribute to 0,
must not include attribute for no timeout
- make MAC address randomization optional
- change num bursts exponent default to 0 (1 burst, rather
rather than the old default of 15==don't care)
v4:
- clarify NL80211_ATTR_TIMEOUT documentation
v5:
- remove unnecessary nl80211 multicast/family changes
- remove partial results bit/flag, final is sufficient
- add max_bursts_exponent, max_ftms_per_burst to capability
- rename "frames per burst" -> "FTMs per burst"
v6:
- rename cfg80211_pmsr_free_wdev() to cfg80211_pmsr_wdev_down()
and call it in leave, so the device can't go down with any
pending measurements
v7:
- wording fixes (Lior)
- fix ftm.max_bursts_exponent to allow having the limit of 0 (Lior)
v8:
- copyright statements
- minor coding style fixes
- fix error path leak
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-09-10 13:29:12 +02:00
|
|
|
|
|
|
|
|
|
2026-07-03 13:55:23 +05:30
|
|
|
|
2018-09-13 14:12:03 +02:00
|
|
|
|
cfg80211: initialize wdev data earlier
There's a race condition in the netdev registration in that
NETDEV_REGISTER actually happens after the netdev is available,
and so if we initialize things only there, we might get called
with an uninitialized wdev through nl80211 - not using a wdev
but using a netdev interface index.
I found this while looking into a syzbot report, but it doesn't
really seem to be related, and unfortunately there's no repro
for it (yet). I can't (yet) explain how it managed to get into
cfg80211_release_pmsr() from nl80211_netlink_notify() without
the wdev having been initialized, as the latter only iterates
the wdevs that are linked into the rdev, which even without the
change here happened after init.
However, looking at this, it seems fairly clear that the init
needs to be done earlier, otherwise we might even re-init on a
netns move, when data might still be pending.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20201009135821.fdcbba3aad65.Ie9201d91dbcb7da32318812effdc1561aeaf4cdc@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-10-09 13:58:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-16 15:38:04 +02:00
|
|
|
|
|
|
|
|
|
cfg80211: initialize wdev data earlier
There's a race condition in the netdev registration in that
NETDEV_REGISTER actually happens after the netdev is available,
and so if we initialize things only there, we might get called
with an uninitialized wdev through nl80211 - not using a wdev
but using a netdev interface index.
I found this while looking into a syzbot report, but it doesn't
really seem to be related, and unfortunately there's no repro
for it (yet). I can't (yet) explain how it managed to get into
cfg80211_release_pmsr() from nl80211_netlink_notify() without
the wdev having been initialized, as the latter only iterates
the wdevs that are linked into the rdev, which even without the
change here happened after init.
However, looking at this, it seems fairly clear that the init
needs to be done earlier, otherwise we might even re-init on a
netns move, when data might still be pending.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20201009135821.fdcbba3aad65.Ie9201d91dbcb7da32318812effdc1561aeaf4cdc@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-10-09 13:58:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-09 10:25:42 +02:00
|
|
|
|
|
|
|
|
|
cfg80211: initialize wdev data earlier
There's a race condition in the netdev registration in that
NETDEV_REGISTER actually happens after the netdev is available,
and so if we initialize things only there, we might get called
with an uninitialized wdev through nl80211 - not using a wdev
but using a netdev interface index.
I found this while looking into a syzbot report, but it doesn't
really seem to be related, and unfortunately there's no repro
for it (yet). I can't (yet) explain how it managed to get into
cfg80211_release_pmsr() from nl80211_netlink_notify() without
the wdev having been initialized, as the latter only iterates
the wdevs that are linked into the rdev, which even without the
change here happened after init.
However, looking at this, it seems fairly clear that the init
needs to be done earlier, otherwise we might even re-init on a
netns move, when data might still be pending.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20201009135821.fdcbba3aad65.Ie9201d91dbcb7da32318812effdc1561aeaf4cdc@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-10-09 13:58:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-07-06 23:24:18 +08:00
|
|
|
|
cfg80211: initialize wdev data earlier
There's a race condition in the netdev registration in that
NETDEV_REGISTER actually happens after the netdev is available,
and so if we initialize things only there, we might get called
with an uninitialized wdev through nl80211 - not using a wdev
but using a netdev interface index.
I found this while looking into a syzbot report, but it doesn't
really seem to be related, and unfortunately there's no repro
for it (yet). I can't (yet) explain how it managed to get into
cfg80211_release_pmsr() from nl80211_netlink_notify() without
the wdev having been initialized, as the latter only iterates
the wdevs that are linked into the rdev, which even without the
change here happened after init.
However, looking at this, it seems fairly clear that the init
needs to be done earlier, otherwise we might even re-init on a
netns move, when data might still be pending.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20201009135821.fdcbba3aad65.Ie9201d91dbcb7da32318812effdc1561aeaf4cdc@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-10-09 13:58:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-09-13 14:12:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-22 16:19:42 +01:00
|
|
|
|
2018-10-01 14:18:31 +02:00
|
|
|
|
2021-06-08 11:32:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-10-01 14:18:31 +02:00
|
|
|
|
2018-09-13 14:12:03 +02:00
|
|
|
|
|
|
|
|
|
2021-01-22 16:19:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-01 19:20:50 +01:00
|
|
|
|
2021-01-22 16:19:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-01 19:20:50 +01:00
|
|
|
|
2021-01-22 16:19:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-08 12:38:53 +03:00
|
|
|
|
2013-05-28 01:30:21 +00:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2013-05-28 01:30:21 +00:00
|
|
|
|
2009-07-01 21:26:45 +02:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2017-04-21 13:05:00 +01:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2009-07-01 21:26:45 +02:00
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2014-04-21 12:53:03 +08:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2009-07-01 21:26:45 +02:00
|
|
|
|
2008-09-16 14:55:09 +02:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2009-10-02 05:15:28 +00:00
|
|
|
|
|
|
|
|
|
cfg80211: initialize wdev data earlier
There's a race condition in the netdev registration in that
NETDEV_REGISTER actually happens after the netdev is available,
and so if we initialize things only there, we might get called
with an uninitialized wdev through nl80211 - not using a wdev
but using a netdev interface index.
I found this while looking into a syzbot report, but it doesn't
really seem to be related, and unfortunately there's no repro
for it (yet). I can't (yet) explain how it managed to get into
cfg80211_release_pmsr() from nl80211_netlink_notify() without
the wdev having been initialized, as the latter only iterates
the wdevs that are linked into the rdev, which even without the
change here happened after init.
However, looking at this, it seems fairly clear that the init
needs to be done earlier, otherwise we might even re-init on a
netns move, when data might still be pending.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20201009135821.fdcbba3aad65.Ie9201d91dbcb7da32318812effdc1561aeaf4cdc@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-10-09 13:58:22 +02:00
|
|
|
|
|
|
|
|
|
2025-02-28 11:20:56 +01:00
|
|
|
|
cfg80211: initialize wdev data earlier
There's a race condition in the netdev registration in that
NETDEV_REGISTER actually happens after the netdev is available,
and so if we initialize things only there, we might get called
with an uninitialized wdev through nl80211 - not using a wdev
but using a netdev interface index.
I found this while looking into a syzbot report, but it doesn't
really seem to be related, and unfortunately there's no repro
for it (yet). I can't (yet) explain how it managed to get into
cfg80211_release_pmsr() from nl80211_netlink_notify() without
the wdev having been initialized, as the latter only iterates
the wdevs that are linked into the rdev, which even without the
change here happened after init.
However, looking at this, it seems fairly clear that the init
needs to be done earlier, otherwise we might even re-init on a
netns move, when data might still be pending.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20201009135821.fdcbba3aad65.Ie9201d91dbcb7da32318812effdc1561aeaf4cdc@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-10-09 13:58:22 +02:00
|
|
|
|
|
|
|
|
|
2009-10-02 05:15:28 +00:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2024-11-22 09:42:25 +01:00
|
|
|
|
|
|
|
|
|
2021-01-22 16:19:42 +01:00
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2021-01-22 16:19:42 +01:00
|
|
|
|
|
|
|
|
|
2009-08-17 12:25:37 +02:00
|
|
|
|
2021-01-22 16:19:42 +01:00
|
|
|
|
|
|
|
|
|
2009-08-17 12:25:37 +02:00
|
|
|
|
2021-02-01 19:20:50 +01:00
|
|
|
|
2024-11-22 09:42:25 +01:00
|
|
|
|
|
|
|
|
|
2021-01-22 16:19:42 +01:00
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2009-04-19 21:24:32 +02:00
|
|
|
|
2026-03-18 14:39:17 +02:00
|
|
|
|
2026-07-06 23:24:18 +08:00
|
|
|
|
2024-11-22 09:42:25 +01:00
|
|
|
|
2026-07-06 23:24:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-08-20 21:36:16 +02:00
|
|
|
|
|
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2012-06-29 12:47:01 +02:00
|
|
|
|
2025-06-09 21:35:19 +03:00
|
|
|
|
2020-09-18 11:33:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-05 17:10:13 +03:00
|
|
|
|
cfg80211: send scan results from work queue
Due to the previous commit, when a scan finishes, it is in theory
possible to hit the following sequence:
1. interface starts being removed
2. scan is cancelled by driver and cfg80211 is notified
3. scan done work is scheduled
4. interface is removed completely, rdev->scan_req is freed,
event sent to userspace but scan done work remains pending
5. new scan is requested on another virtual interface
6. scan done work runs, freeing the still-running scan
To fix this situation, hang on to the scan done message and block
new scans while that is the case, and only send the message from
the work function, regardless of whether the scan_req is already
freed from interface removal. This makes step 5 above impossible
and changes step 6 to be
5. scan done work runs, sending the scan done message
As this can't work for wext, so we send the message immediately,
but this shouldn't be an issue since we still return -EBUSY.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-01-22 11:14:19 +02:00
|
|
|
|
2014-01-22 11:14:18 +02:00
|
|
|
|
2013-05-08 21:45:15 +02:00
|
|
|
|
2017-04-21 13:05:00 +01:00
|
|
|
|
|
|
|
|
|
2018-09-08 19:21:28 +08:00
|
|
|
|
2017-04-21 13:05:00 +01:00
|
|
|
|
2013-05-08 21:45:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2013-05-08 21:45:15 +02:00
|
|
|
|
2009-04-19 21:24:32 +02:00
|
|
|
|
|
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2012-07-12 22:19:48 +02:00
|
|
|
|
2009-07-01 21:26:56 +02:00
|
|
|
|
2010-12-03 09:20:44 +01:00
|
|
|
|
2009-07-01 21:26:56 +02:00
|
|
|
|
cfg80211: rework key operation
This reworks the key operation in cfg80211, and now only
allows, from userspace, configuring keys (via nl80211)
after the connection has been established (in managed
mode), the IBSS been joined (in IBSS mode), at any time
(in AP[_VLAN] modes) or never for all the other modes.
In order to do shared key authentication correctly, it
is now possible to give a WEP key to the AUTH command.
To configure static WEP keys, these are given to the
CONNECT or IBSS_JOIN command directly, for a userspace
SME it is assumed it will configure it properly after
the connection has been established.
Since mac80211 used to check the default key in IBSS
mode to see whether or not the network is protected,
it needs an update in that area, as well as an update
to make use of the WEP key passed to auth() for shared
key authentication.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-08 14:22:54 +02:00
|
|
|
|
2009-04-19 21:24:32 +02:00
|
|
|
|
2009-07-01 21:26:56 +02:00
|
|
|
|
cfg80211: rework key operation
This reworks the key operation in cfg80211, and now only
allows, from userspace, configuring keys (via nl80211)
after the connection has been established (in managed
mode), the IBSS been joined (in IBSS mode), at any time
(in AP[_VLAN] modes) or never for all the other modes.
In order to do shared key authentication correctly, it
is now possible to give a WEP key to the AUTH command.
To configure static WEP keys, these are given to the
CONNECT or IBSS_JOIN command directly, for a userspace
SME it is assumed it will configure it properly after
the connection has been established.
Since mac80211 used to check the default key in IBSS
mode to see whether or not the network is protected,
it needs an update in that area, as well as an update
to make use of the WEP key passed to auth() for shared
key authentication.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-08 14:22:54 +02:00
|
|
|
|
2009-04-19 21:24:32 +02:00
|
|
|
|
2010-12-03 09:20:44 +01:00
|
|
|
|
2010-12-16 17:37:49 -08:00
|
|
|
|
2010-12-03 09:20:44 +01:00
|
|
|
|
2010-12-16 17:37:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-14 16:50:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-12-16 17:37:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-07-01 21:26:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-08-18 19:51:57 +02:00
|
|
|
|
2011-01-31 15:52:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-19 12:57:13 +03:00
|
|
|
|
|
|
|
|
|
2017-02-13 20:53:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-22 16:19:43 +01:00
|
|
|
|
2009-07-01 21:26:45 +02:00
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
2019-07-22 12:44:50 +05:30
|
|
|
|
|
|
|
|
|
2009-07-07 03:56:13 +02:00
|
|
|
|
2019-05-08 14:55:33 +05:30
|
|
|
|
2021-06-16 23:28:26 +03:00
|
|
|
|
2014-02-27 11:07:21 +02:00
|
|
|
|
2026-03-18 14:39:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-02 13:01:41 +02:00
|
|
|
|
2014-04-21 12:53:04 +08:00
|
|
|
|
|
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
2016-01-27 13:29:34 +01:00
|
|
|
|
|
|
|
|
|
2014-04-21 12:53:04 +08:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-07-14 00:33:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 13:59:32 +02:00
|
|
|
|
2009-07-14 00:33:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-06 21:00:03 +02:00
|
|
|
|
|
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-13 17:20:32 +01:00
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-06 21:00:03 +02:00
|
|
|
|
|
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 13:59:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-06 21:00:03 +02:00
|
|
|
|
|
|
|
|
|
2023-08-28 13:59:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
|
|
|
|
|
2025-05-09 07:51:14 +02:00
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-06 21:00:03 +02:00
|
|
|
|
|
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
2025-04-05 10:17:26 +02:00
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-04-05 10:17:26 +02:00
|
|
|
|
2023-06-06 14:49:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 13:59:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-04-05 10:17:26 +02:00
|
|
|
|
2023-08-28 13:59:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-24 21:28:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-10-28 12:58:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-07-14 00:33:35 +02:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2008-09-09 23:19:48 -07:00
|
|
|
|
|
|
|
|
|
2009-07-14 00:33:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-09-09 23:19:48 -07:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-09-20 13:09:35 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
2008-09-09 23:19:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-31 00:35:07 +05:30
|
|
|
|
2013-03-20 20:22:54 +08:00
|
|
|
|
|
|
|
|
|
2009-11-25 15:13:00 +01:00
|
|
|
|
2013-03-20 20:22:54 +08:00
|
|
|
|
2009-11-25 15:13:00 +01:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
2009-11-25 15:13:00 +01:00
|
|
|
|
|
|
|
|
|
2008-09-09 23:19:48 -07:00
|
|
|
|
|
|
|
|
|
2015-01-28 10:03:26 +08:00
|
|
|
|
2007-09-20 13:09:35 -04:00
|
|
|
|
|
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-07-14 00:33:35 +02:00
|
|
|
|
|
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
2015-10-15 11:22:58 +02:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
2010-06-18 09:38:54 +02:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
2007-09-20 13:09:35 -04:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|
2008-09-09 23:19:48 -07:00
|
|
|
|
2009-07-14 00:33:35 +02:00
|
|
|
|
2009-11-25 15:13:00 +01:00
|
|
|
|
2007-04-23 12:20:05 -07:00
|
|
|
|
|
|
|
|
|