Commit Graph

2600 Commits

Author SHA1 Message Date
Rameshkumar Sundaram f0e3d26c63 UPSTREAM: nl80211: Parse NL80211_ATTR_HE_BSS_COLOR as a part of nl80211_parse_beacon
NL80211_ATTR_HE_BSS_COLOR attribute can be included in both
NL80211_CMD_START_AP and NL80211_CMD_SET_BEACON commands.

Move he_bss_color from cfg80211_ap_settings to cfg80211_beacon_data
and parse NL80211_ATTR_HE_BSS_COLOR as a part of nl80211_parse_beacon()
to have bss color settings parsed for both start ap and set beacon
commands.
Add a new flag he_bss_color_valid to indicate whether
NL80211_ATTR_HE_BSS_COLOR attribute is included.

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Link: https://lore.kernel.org/r/1649867295-7204-2-git-send-email-quic_ramess@quicinc.com
[fix build ...]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 233160029
(cherry picked from commit 3d48cb74816d8468f0235ce9a867a2d7b9832693)
Change-Id: Iceef7d7927fa3bbb49ced1583461a87b151f20e4
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-06-01 09:32:35 -07:00
Muna Sinada 20b85fc84c UPSTREAM: cfg80211: support disabling EHT mode
Allow userspace to disable EHT mode during association.

Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
Link: https://lore.kernel.org/r/20220323224636.20211-1-quic_alokad@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 233160029
(cherry picked from commit 36f8423597000bd7d5e48b7b306e1d0958e72359)
Change-Id: I06d3c8895590df47980b4f3fce96a0f8d1292be2
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-06-01 09:32:35 -07:00
Dimitri John Ledkov 7a7dd66fa1 UPSTREAM: cfg80211: declare MODULE_FIRMWARE for regulatory.db
Add MODULE_FIRMWARE declarations for regulatory.db and
regulatory.db.p7s such that userspace tooling can discover and include
these files.

Cc: stable@vger.kernel.org
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Link: https://lore.kernel.org/r/20220414125004.267819-1-dimitri.ledkov@canonical.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 233160029
(cherry picked from commit 7bc7981eeebe1b8e603ad2ffc5e84f4df76920dd)
Change-Id: I475dab9c2759f3e9add66352acda7aa75a945f52
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-06-01 09:32:35 -07:00
Johannes Berg fea05e64a3 UPSTREAM: nl80211: rework internal_flags usage
Since internal_flags is only 8 bits, we can only have one
more internal flag. However, we can obviously never use all
of possible the combinations, in fact, we only use 14 of
them (including no flags).

Since we want more flags for MLO (multi-link operation) in
the future, refactor the code to use a flags selector, so
wrap all of the .internal_flags assignments in a IFLAGS()
macro which selects the combination according to the pre-
defined list of combinations.

When we need a new combination, we'll have to add it, but
again we will never use all possible combinations.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20220414140402.70ddf8af3eb0.I2cc38cb6a10bb4c3863ec9ee97edbcc70a07aa4b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 233160029
(cherry picked from commit 2182db91e0016ca2b451426290c3b368ba9f6fdc)
Change-Id: I6ca31b633ce0af9829d70a377906115d23d1c4ad
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-06-01 09:32:35 -07:00
Johannes Berg d58d5c6aaa UPSTREAM: nl80211: don't hold RTNL in color change request
It's not necessary to hold the RTNL across color change
requests, since all the inner locking needs only the
wiphy mutex which we already hold as well.

Fixes: 0d2ab3aea5 ("nl80211: add support for BSS coloring")
Link: https://lore.kernel.org/r/20220414140402.32e03e8c261b.I5e7dc6bc563a129b938c43298da6bb4e812400a5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 233160029
(cherry picked from commit 1b550a0bebfc0b69d6ec08fe6eb58953a8aec48a)
Change-Id: Ic03ef23eb9b1ff97b01a3fb8f227e84004a17d2d
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-06-01 09:32:34 -07:00
Johannes Berg b428445e8d UPSTREAM: cfg80211: remove cfg80211_get_chan_state()
We haven't used this function for years, since commit c781944b71
("cfg80211: Remove unused cfg80211_can_use_iftype_chan()") which
itself removed a function unused since commit 97dc94f1d9
("cfg80211: remove channel_switch combination check"), almost eight
years ago.

Also remove the now unused enum cfg80211_chan_mode and some struct
members that were only used for this function.

Link: https://lore.kernel.org/r/20220412220958.1a191dca19d7.Ide4448f02d0e2f1ca2992971421ffc1933a5370a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 233160029
(cherry picked from commit 34c9a0e71cbb316f360919353273b185c2780cd7)
Change-Id: I287a54e33da467c5b3a128a7ed6eaade37f456bf
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-06-01 09:32:34 -07:00
Johannes Berg 925b0dbfe4 UPSTREAM: nl80211: show SSID for P2P_GO interfaces
There's no real reason not to send the SSID to userspace
when it requests information about P2P_GO, it is, in that
respect, exactly the same as AP interfaces. Fix that.

Fixes: 44905265bc ("nl80211: don't expose wdev->ssid for most interfaces")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20220318134656.14354ae223f0.Ia25e85a512281b92e1645d4160766a4b1a471597@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 233160029
(cherry picked from commit a75971bc2b8453630e9f85e0beaa4da8db8277a3)
Change-Id: Idfa7dcd16317073ce90081b7110bfc0c659898e5
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-05-26 01:57:48 +00:00
Paul Zhang da01931c1c BACKPORT: FROMLIST: cfg80211: parse RNR IE about MLD params for MBSSID feature
In order to reconstruct frame for MBSSID feature, per the description of
the Reduced Neighbor Report(RNR) element about MLD parameters subfield in
section 9.4.2.170 of Draft P802.11be_D1.4, the RNR IE is modified:
1\ If the reported AP is affiliated with the same MLD of the reporting AP,
the TBTT information is skipped;
2\ If the reported AP is affiliated with the same MLD of the nontransmitted
BSSID, the TBTT information is copied and the MLD ID is changed to 0.

Signed-off-by: Paul Zhang <quic_paulz@quicinc.com>

Bug: 231937090
Link: https://lore.kernel.org/linux-wireless/1649335871-9173-1-git-send-email-quic_paulz@quicinc.com
Change-Id: I2bae85b813a2351a62d2788f0e76f13407d11645
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-05-10 15:27:08 +00:00
Greg Kroah-Hartman ec1a28c7c0 Merge 5.15.35 into android13-5.15
Changes in 5.15.35
	drm/amd/display: Add pstate verification and recovery for DCN31
	drm/amd/display: Fix p-state allow debug index on dcn31
	hamradio: defer 6pack kfree after unregister_netdev
	hamradio: remove needs_free_netdev to avoid UAF
	cpuidle: PSCI: Move the `has_lpi` check to the beginning of the function
	ACPI: processor idle: Check for architectural support for LPI
	ACPI: processor idle: Allow playing dead in C3 state
	ACPI: processor: idle: fix lockup regression on 32-bit ThinkPad T40
	btrfs: remove unused parameter nr_pages in add_ra_bio_pages()
	btrfs: remove no longer used counter when reading data page
	btrfs: remove unused variable in btrfs_{start,write}_dirty_block_groups()
	soc: qcom: aoss: Expose send for generic usecase
	dt-bindings: net: qcom,ipa: add optional qcom,qmp property
	net: ipa: request IPA register values be retained
	btrfs: release correct delalloc amount in direct IO write path
	ALSA: core: Add snd_card_free_on_error() helper
	ALSA: sis7019: Fix the missing error handling
	ALSA: ali5451: Fix the missing snd_card_free() call at probe error
	ALSA: als300: Fix the missing snd_card_free() call at probe error
	ALSA: als4000: Fix the missing snd_card_free() call at probe error
	ALSA: atiixp: Fix the missing snd_card_free() call at probe error
	ALSA: au88x0: Fix the missing snd_card_free() call at probe error
	ALSA: aw2: Fix the missing snd_card_free() call at probe error
	ALSA: azt3328: Fix the missing snd_card_free() call at probe error
	ALSA: bt87x: Fix the missing snd_card_free() call at probe error
	ALSA: ca0106: Fix the missing snd_card_free() call at probe error
	ALSA: cmipci: Fix the missing snd_card_free() call at probe error
	ALSA: cs4281: Fix the missing snd_card_free() call at probe error
	ALSA: cs5535audio: Fix the missing snd_card_free() call at probe error
	ALSA: echoaudio: Fix the missing snd_card_free() call at probe error
	ALSA: emu10k1x: Fix the missing snd_card_free() call at probe error
	ALSA: ens137x: Fix the missing snd_card_free() call at probe error
	ALSA: es1938: Fix the missing snd_card_free() call at probe error
	ALSA: es1968: Fix the missing snd_card_free() call at probe error
	ALSA: fm801: Fix the missing snd_card_free() call at probe error
	ALSA: galaxy: Fix the missing snd_card_free() call at probe error
	ALSA: hdsp: Fix the missing snd_card_free() call at probe error
	ALSA: hdspm: Fix the missing snd_card_free() call at probe error
	ALSA: ice1724: Fix the missing snd_card_free() call at probe error
	ALSA: intel8x0: Fix the missing snd_card_free() call at probe error
	ALSA: intel_hdmi: Fix the missing snd_card_free() call at probe error
	ALSA: korg1212: Fix the missing snd_card_free() call at probe error
	ALSA: lola: Fix the missing snd_card_free() call at probe error
	ALSA: lx6464es: Fix the missing snd_card_free() call at probe error
	ALSA: maestro3: Fix the missing snd_card_free() call at probe error
	ALSA: oxygen: Fix the missing snd_card_free() call at probe error
	ALSA: riptide: Fix the missing snd_card_free() call at probe error
	ALSA: rme32: Fix the missing snd_card_free() call at probe error
	ALSA: rme9652: Fix the missing snd_card_free() call at probe error
	ALSA: rme96: Fix the missing snd_card_free() call at probe error
	ALSA: sc6000: Fix the missing snd_card_free() call at probe error
	ALSA: sonicvibes: Fix the missing snd_card_free() call at probe error
	ALSA: via82xx: Fix the missing snd_card_free() call at probe error
	ALSA: usb-audio: Cap upper limits of buffer/period bytes for implicit fb
	ALSA: nm256: Don't call card private_free at probe error path
	drm/msm: Add missing put_task_struct() in debugfs path
	firmware: arm_scmi: Remove clear channel call on the TX channel
	memory: atmel-ebi: Fix missing of_node_put in atmel_ebi_probe
	Revert "ath11k: mesh: add support for 256 bitmap in blockack frames in 11ax"
	firmware: arm_scmi: Fix sorting of retrieved clock rates
	media: rockchip/rga: do proper error checking in probe
	SUNRPC: Fix the svc_deferred_event trace class
	net/sched: flower: fix parsing of ethertype following VLAN header
	veth: Ensure eth header is in skb's linear part
	gpiolib: acpi: use correct format characters
	cifs: release cached dentries only if mount is complete
	net: mdio: don't defer probe forever if PHY IRQ provider is missing
	mlxsw: i2c: Fix initialization error flow
	net/sched: fix initialization order when updating chain 0 head
	net: dsa: felix: suppress -EPROBE_DEFER errors
	net: ethernet: stmmac: fix altr_tse_pcs function when using a fixed-link
	net/sched: taprio: Check if socket flags are valid
	cfg80211: hold bss_lock while updating nontrans_list
	netfilter: nft_socket: make cgroup match work in input too
	drm/msm: Fix range size vs end confusion
	drm/msm/dsi: Use connector directly in msm_dsi_manager_connector_init()
	drm/msm/dp: add fail safe mode outside of event_mutex context
	net/smc: Fix NULL pointer dereference in smc_pnet_find_ib()
	scsi: pm80xx: Mask and unmask upper interrupt vectors 32-63
	scsi: pm80xx: Enable upper inbound, outbound queues
	scsi: iscsi: Move iscsi_ep_disconnect()
	scsi: iscsi: Fix offload conn cleanup when iscsid restarts
	scsi: iscsi: Fix endpoint reuse regression
	scsi: iscsi: Fix conn cleanup and stop race during iscsid restart
	scsi: iscsi: Fix unbound endpoint error handling
	sctp: Initialize daddr on peeled off socket
	netfilter: nf_tables: nft_parse_register can return a negative value
	ALSA: ad1889: Fix the missing snd_card_free() call at probe error
	ALSA: mtpav: Don't call card private_free at probe error path
	io_uring: move io_uring_rsrc_update2 validation
	io_uring: verify that resv2 is 0 in io_uring_rsrc_update2
	io_uring: verify pad field is 0 in io_get_ext_arg
	testing/selftests/mqueue: Fix mq_perf_tests to free the allocated cpu set
	ALSA: usb-audio: Increase max buffer size
	ALSA: usb-audio: Limit max buffer and period sizes per time
	perf tools: Fix misleading add event PMU debug message
	macvlan: Fix leaking skb in source mode with nodst option
	net: ftgmac100: access hardware register after clock ready
	nfc: nci: add flush_workqueue to prevent uaf
	cifs: potential buffer overflow in handling symlinks
	dm mpath: only use ktime_get_ns() in historical selector
	vfio/pci: Fix vf_token mechanism when device-specific VF drivers are used
	net: bcmgenet: Revert "Use stronger register read/writes to assure ordering"
	block: fix offset/size check in bio_trim()
	drm/amd: Add USBC connector ID
	btrfs: fix fallocate to use file_modified to update permissions consistently
	btrfs: do not warn for free space inode in cow_file_range
	drm/amdgpu: conduct a proper cleanup of PDB bo
	drm/amdgpu/gmc: use PCI BARs for APUs in passthrough
	drm/amd/display: fix audio format not updated after edid updated
	drm/amd/display: FEC check in timing validation
	drm/amd/display: Update VTEM Infopacket definition
	drm/amdkfd: Fix Incorrect VMIDs passed to HWS
	drm/amdgpu/vcn: improve vcn dpg stop procedure
	drm/amdkfd: Check for potential null return of kmalloc_array()
	Drivers: hv: vmbus: Deactivate sysctl_record_panic_msg by default in isolated guests
	PCI: hv: Propagate coherence from VMbus device to PCI device
	Drivers: hv: vmbus: Prevent load re-ordering when reading ring buffer
	scsi: target: tcmu: Fix possible page UAF
	scsi: lpfc: Fix queue failures when recovering from PCI parity error
	scsi: ibmvscsis: Increase INITIAL_SRP_LIMIT to 1024
	net: micrel: fix KS8851_MLL Kconfig
	ata: libata-core: Disable READ LOG DMA EXT for Samsung 840 EVOs
	gpu: ipu-v3: Fix dev_dbg frequency output
	regulator: wm8994: Add an off-on delay for WM8994 variant
	arm64: alternatives: mark patch_alternative() as `noinstr`
	tlb: hugetlb: Add more sizes to tlb_remove_huge_tlb_entry
	net: axienet: setup mdio unconditionally
	Drivers: hv: balloon: Disable balloon and hot-add accordingly
	net: usb: aqc111: Fix out-of-bounds accesses in RX fixup
	myri10ge: fix an incorrect free for skb in myri10ge_sw_tso
	spi: cadence-quadspi: fix protocol setup for non-1-1-X operations
	drm/amd/display: Enable power gating before init_pipes
	drm/amd/display: Revert FEC check in validation
	drm/amd/display: Fix allocate_mst_payload assert on resume
	drbd: set QUEUE_FLAG_STABLE_WRITES
	scsi: mpt3sas: Fail reset operation if config request timed out
	scsi: mvsas: Add PCI ID of RocketRaid 2640
	scsi: megaraid_sas: Target with invalid LUN ID is deleted during scan
	drivers: net: slip: fix NPD bug in sl_tx_timeout()
	io_uring: zero tag on rsrc removal
	io_uring: use nospec annotation for more indexes
	perf/imx_ddr: Fix undefined behavior due to shift overflowing the constant
	mm/secretmem: fix panic when growing a memfd_secret
	mm, page_alloc: fix build_zonerefs_node()
	mm: fix unexpected zeroed page mapping with zram swap
	mm: kmemleak: take a full lowmem check in kmemleak_*_phys()
	KVM: x86/mmu: Resolve nx_huge_pages when kvm.ko is loaded
	SUNRPC: Fix NFSD's request deferral on RDMA transports
	memory: renesas-rpc-if: fix platform-device leak in error path
	gcc-plugins: latent_entropy: use /dev/urandom
	cifs: verify that tcon is valid before dereference in cifs_kill_sb
	ath9k: Properly clear TX status area before reporting to mac80211
	ath9k: Fix usage of driver-private space in tx_info
	btrfs: fix root ref counts in error handling in btrfs_get_root_ref
	btrfs: mark resumed async balance as writing
	ALSA: hda/realtek: Add quirk for Clevo PD50PNT
	ALSA: hda/realtek: add quirk for Lenovo Thinkpad X12 speakers
	ALSA: pcm: Test for "silence" field in struct "pcm_format_data"
	nl80211: correctly check NL80211_ATTR_REG_ALPHA2 size
	ipv6: fix panic when forwarding a pkt with no in6 dev
	drm/amd/display: don't ignore alpha property on pre-multiplied mode
	drm/amdgpu: Enable gfxoff quirk on MacBook Pro
	x86/tsx: Use MSR_TSX_CTRL to clear CPUID bits
	x86/tsx: Disable TSX development mode at boot
	genirq/affinity: Consider that CPUs on nodes can be unbalanced
	tick/nohz: Use WARN_ON_ONCE() to prevent console saturation
	ARM: davinci: da850-evm: Avoid NULL pointer dereference
	dm integrity: fix memory corruption when tag_size is less than digest size
	i2c: dev: check return value when calling dev_set_name()
	smp: Fix offline cpu check in flush_smp_call_function_queue()
	i2c: pasemi: Wait for write xfers to finish
	dt-bindings: net: snps: remove duplicate name
	timers: Fix warning condition in __run_timers()
	dma-direct: avoid redundant memory sync for swiotlb
	drm/i915: Sunset igpu legacy mmap support based on GRAPHICS_VER_FULL
	cpu/hotplug: Remove the 'cpu' member of cpuhp_cpu_state
	soc: qcom: aoss: Fix missing put_device call in qmp_get
	net: ipa: fix a build dependency
	cpufreq: intel_pstate: ITMT support for overclocked system
	ax25: add refcount in ax25_dev to avoid UAF bugs
	ax25: fix reference count leaks of ax25_dev
	ax25: fix UAF bugs of net_device caused by rebinding operation
	ax25: Fix refcount leaks caused by ax25_cb_del()
	ax25: fix UAF bug in ax25_send_control()
	ax25: fix NPD bug in ax25_disconnect
	ax25: Fix NULL pointer dereferences in ax25 timers
	ax25: Fix UAF bugs in ax25 timers
	Linux 5.15.35

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I0dd9eaea7f977df42b0a5b9cb9043c879f62718b
2022-04-24 16:58:59 +02:00
Johannes Berg cab64cb82f nl80211: correctly check NL80211_ATTR_REG_ALPHA2 size
commit 6624bb34b4eb19f715db9908cca00122748765d7 upstream.

We need this to be at least two bytes, so we can access
alpha2[0] and alpha2[1]. It may be three in case some
userspace used NUL-termination since it was NLA_STRING
(and we also push it out with NUL-termination).

Cc: stable@vger.kernel.org
Reported-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220411114201.fd4a31f06541.Ie7ff4be2cf348d8cc28ed0d626fc54becf7ea799@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-20 09:34:19 +02:00
Rameshkumar Sundaram 5a52384a51 cfg80211: hold bss_lock while updating nontrans_list
[ Upstream commit a5199b5626cd6913cf8776a835bc63d40e0686ad ]

Synchronize additions to nontrans_list of transmitting BSS with
bss_lock to avoid races. Also when cfg80211_add_nontrans_list() fails
__cfg80211_unlink_bss() needs bss_lock to be held (has lockdep assert
on bss_lock). So protect the whole block with bss_lock to avoid
races and warnings. Found during code review.

Fixes: 0b8fb8235b ("cfg80211: Parsing of Multiple BSSID information in scanning")
Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Link: https://lore.kernel.org/r/1649668071-9370-1-git-send-email-quic_ramess@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-20 09:34:10 +02:00
Avraham Stern 19d067c10b cfg80211: don't add non transmitted BSS to 6GHz scanned channels
[ Upstream commit 5666ee154f4696c011dfa8544aaf5591b6b87515 ]

When adding 6GHz channels to scan request based on reported
co-located APs, don't add channels that have only APs with
"non-transmitted" BSSes if they only match the wildcard SSID since
they will be found by probing the "transmitted" BSS.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20220202104617.f6ddf099f934.I231e55885d3644f292d00dfe0f42653269f2559e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-13 20:59:03 +02:00
Greg Kroah-Hartman 167b1e671c This is the 5.15.30 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmI10PsACgkQONu9yGCS
 aT56QQ//XqSGySJCOmks+UIQ3DYsMSt4CS9z1bvpQzqVV+orPfO5eCqVL1Cj+Qyf
 uNo9Oejp2TY39QrcSXvxsUbZVL8qWd38cVejUbv6/kK70+76OxW6N0hFq/Yww5eV
 7zFys+S8aHswmhaUZMAv6vpYziOpP0khW1F8gRm377ILsAwLxwKHmcXaArci3MsM
 iXbhY1eFuv6JvIzDOV/yH+mL2lMfoFfMzICrEGvW7J+piq+fPT3qK/neLn9424CI
 zaLscnGJja2g1MxBEFXpeN4X+nNSH8OUE4fG43rnlbKdQMysI8RovZyMEzcEmsjB
 CwtK36HwBF4XrK/u1nO0fBEKtiG8IeUB4DluVP2ti/o1MbfHqV13q56OruHj9osq
 wPEnLWyghY4vkb8k2iZzMp93dGcItjkxQJemVU3zh447HOAX6wmfD7DQbsSPE2+Q
 3Lv2zzUIRCyV37MbpsIPpGUg56WaDsmMlH5U6ci0UPgFanfz8TlmuiL8vQj1Pseu
 3pLKMUCJ1aFVKT7RhB7rb1uzl/5UhbfPL5aGf2f8PdxJzzZSeWm4FH02VHiqfCAu
 PrMiZDLBkqKg27QeVj5Yds8EgDXTSK+C3PlO8qwbI9GCGZf5msLiruxC65wTQGxt
 SUT+VORG2h0e1LpoevPgoV+Ma+ucow/fpnvbSJn7yQ9w8C/8svs=
 =6Po/
 -----END PGP SIGNATURE-----

Merge 5.15.30 into android13-5.15

Changes in 5.15.30
	Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0"
	arm64: dts: rockchip: fix rk3399-puma-haikou USB OTG mode
	xfrm: Check if_id in xfrm_migrate
	xfrm: Fix xfrm migrate issues when address family changes
	arm64: dts: rockchip: fix rk3399-puma eMMC HS400 signal integrity
	arm64: dts: rockchip: align pl330 node name with dtschema
	arm64: dts: rockchip: reorder rk3399 hdmi clocks
	arm64: dts: agilex: use the compatible "intel,socfpga-agilex-hsotg"
	ARM: dts: rockchip: reorder rk322x hmdi clocks
	ARM: dts: rockchip: fix a typo on rk3288 crypto-controller
	mac80211: refuse aggregations sessions before authorized
	MIPS: smp: fill in sibling and core maps earlier
	ARM: 9178/1: fix unmet dependency on BITREVERSE for HAVE_ARCH_BITREVERSE
	Bluetooth: hci_core: Fix leaking sent_cmd skb
	can: rcar_canfd: rcar_canfd_channel_probe(): register the CAN device when fully ready
	atm: firestream: check the return value of ioremap() in fs_init()
	iwlwifi: don't advertise TWT support
	drm/vrr: Set VRR capable prop only if it is attached to connector
	nl80211: Update bss channel on channel switch for P2P_CLIENT
	tcp: make tcp_read_sock() more robust
	sfc: extend the locking on mcdi->seqno
	bnx2: Fix an error message
	kselftest/vm: fix tests build with old libc
	x86/module: Fix the paravirt vs alternative order
	ice: Fix race condition during interface enslave
	Linux 5.15.30

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Icf3c6ca9fb4bb75435d3964e12c0fcb42397b50b
2022-03-19 14:36:07 +01:00
Sreeramya Soratkal f5a425f5d5 nl80211: Update bss channel on channel switch for P2P_CLIENT
[ Upstream commit e50b88c4f076242358b66ddb67482b96947438f2 ]

The wdev channel information is updated post channel switch only for
the station mode and not for the other modes. Due to this, the P2P client
still points to the old value though it moved to the new channel
when the channel change is induced from the P2P GO.

Update the bss channel after CSA channel switch completion for P2P client
interface as well.

Signed-off-by: Sreeramya Soratkal <quic_ssramya@quicinc.com>
Link: https://lore.kernel.org/r/1646114600-31479-1-git-send-email-quic_ssramya@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-03-19 13:47:49 +01:00
Greg Kroah-Hartman 16f06ae351 Merge 5.15.27 into android-5.15
Changes in 5.15.27
	mac80211_hwsim: report NOACK frames in tx_status
	mac80211_hwsim: initialize ieee80211_tx_info at hw_scan_work
	i2c: bcm2835: Avoid clock stretching timeouts
	ASoC: rt5668: do not block workqueue if card is unbound
	ASoC: rt5682: do not block workqueue if card is unbound
	regulator: core: fix false positive in regulator_late_cleanup()
	Input: clear BTN_RIGHT/MIDDLE on buttonpads
	btrfs: get rid of warning on transaction commit when using flushoncommit
	KVM: arm64: vgic: Read HW interrupt pending state from the HW
	block: loop:use kstatfs.f_bsize of backing file to set discard granularity
	tipc: fix a bit overflow in tipc_crypto_key_rcv()
	cifs: do not use uninitialized data in the owner/group sid
	cifs: fix double free race when mount fails in cifs_get_root()
	HID: amd_sfh: Handle amd_sfh work buffer in PM ops
	HID: amd_sfh: Add functionality to clear interrupts
	HID: amd_sfh: Add interrupt handler to process interrupts
	cifs: modefromsids must add an ACE for authenticated users
	selftests/seccomp: Fix seccomp failure by adding missing headers
	drm/amd/pm: correct UMD pstate clocks for Dimgrey Cavefish and Beige Goby
	selftests/ftrace: Do not trace do_softirq because of PREEMPT_RT
	dmaengine: shdma: Fix runtime PM imbalance on error
	i2c: cadence: allow COMPILE_TEST
	i2c: imx: allow COMPILE_TEST
	i2c: qup: allow COMPILE_TEST
	net: usb: cdc_mbim: avoid altsetting toggling for Telit FN990
	block-map: add __GFP_ZERO flag for alloc_page in function bio_copy_kern
	usb: gadget: don't release an existing dev->buf
	usb: gadget: clear related members when goto fail
	exfat: reuse exfat_inode_info variable instead of calling EXFAT_I()
	exfat: fix i_blocks for files truncated over 4 GiB
	tracing: Add test for user space strings when filtering on string pointers
	arm64: Mark start_backtrace() notrace and NOKPROBE_SYMBOL
	serial: stm32: prevent TDR register overwrite when sending x_char
	ext4: drop ineligible txn start stop APIs
	ext4: simplify updating of fast commit stats
	ext4: fast commit may not fallback for ineligible commit
	ext4: fast commit may miss file actions
	sched/fair: Fix fault in reweight_entity
	ata: pata_hpt37x: fix PCI clock detection
	drm/amdgpu: check vm ready by amdgpu_vm->evicting flag
	tracing: Add ustring operation to filtering string pointers
	ipv6: fix skb drops in igmp6_event_query() and igmp6_event_report()
	NFSD: Have legacy NFSD WRITE decoders use xdr_stream_subsegment()
	NFSD: Fix zero-length NFSv3 WRITEs
	io_uring: fix no lock protection for ctx->cq_extra
	tools/resolve_btf_ids: Close ELF file on error
	mtd: spi-nor: Fix mtd size for s3an flashes
	MIPS: fix local_{add,sub}_return on MIPS64
	signal: In get_signal test for signal_group_exit every time through the loop
	PCI: mediatek-gen3: Disable DVFSRC voltage request
	PCI: rcar: Check if device is runtime suspended instead of __clk_is_enabled()
	PCI: dwc: Do not remap invalid res
	PCI: aardvark: Fix checking for MEM resource type
	KVM: VMX: Don't unblock vCPU w/ Posted IRQ if IRQs are disabled in guest
	KVM: s390: Ensure kvm_arch_no_poll() is read once when blocking vCPU
	KVM: VMX: Read Posted Interrupt "control" exactly once per loop iteration
	KVM: X86: Ensure that dirty PDPTRs are loaded
	KVM: x86: Handle 32-bit wrap of EIP for EMULTYPE_SKIP with flat code seg
	KVM: x86: Exit to userspace if emulation prepared a completion callback
	i3c: fix incorrect address slot lookup on 64-bit
	i3c/master/mipi-i3c-hci: Fix a potentially infinite loop in 'hci_dat_v1_get_index()'
	tracing: Do not let synth_events block other dyn_event systems during create
	Input: ti_am335x_tsc - set ADCREFM for X configuration
	Input: ti_am335x_tsc - fix STEPCONFIG setup for Z2
	PCI: mvebu: Check for errors from pci_bridge_emul_init() call
	PCI: mvebu: Do not modify PCI IO type bits in conf_write
	PCI: mvebu: Fix support for bus mastering and PCI_COMMAND on emulated bridge
	PCI: mvebu: Fix configuring secondary bus of PCIe Root Port via emulated bridge
	PCI: mvebu: Setup PCIe controller to Root Complex mode
	PCI: mvebu: Fix support for PCI_BRIDGE_CTL_BUS_RESET on emulated bridge
	PCI: mvebu: Fix support for PCI_EXP_DEVCTL on emulated bridge
	PCI: mvebu: Fix support for PCI_EXP_RTSTA on emulated bridge
	PCI: mvebu: Fix support for DEVCAP2, DEVCTL2 and LNKCTL2 registers on emulated bridge
	NFSD: Fix verifier returned in stable WRITEs
	Revert "nfsd: skip some unnecessary stats in the v4 case"
	nfsd: fix crash on COPY_NOTIFY with special stateid
	x86/hyperv: Properly deal with empty cpumasks in hyperv_flush_tlb_multi()
	drm/i915: don't call free_mmap_offset when purging
	SUNRPC: Fix sockaddr handling in the svc_xprt_create_error trace point
	SUNRPC: Fix sockaddr handling in svcsock_accept_class trace points
	drm/sun4i: dw-hdmi: Fix missing put_device() call in sun8i_hdmi_phy_get
	drm/atomic: Check new_crtc_state->active to determine if CRTC needs disable in self refresh mode
	ntb_hw_switchtec: Fix pff ioread to read into mmio_part_cfg_all
	ntb_hw_switchtec: Fix bug with more than 32 partitions
	drm/amdkfd: Check for null pointer after calling kmemdup
	drm/amdgpu: use spin_lock_irqsave to avoid deadlock by local interrupt
	i3c: master: dw: check return of dw_i3c_master_get_free_pos()
	dma-buf: cma_heap: Fix mutex locking section
	tracing/uprobes: Check the return value of kstrdup() for tu->filename
	tracing/probes: check the return value of kstrndup() for pbuf
	mm: defer kmemleak object creation of module_alloc()
	kasan: fix quarantine conflicting with init_on_free
	selftests/vm: make charge_reserved_hugetlb.sh work with existing cgroup setting
	hugetlbfs: fix off-by-one error in hugetlb_vmdelete_list()
	drm/amdgpu/display: Only set vblank_disable_immediate when PSR is not enabled
	drm/amdgpu: filter out radeon PCI device IDs
	drm/amdgpu: filter out radeon secondary ids as well
	drm/amd/display: Use adjusted DCN301 watermarks
	drm/amd/display: move FPU associated DSC code to DML folder
	ethtool: Fix link extended state for big endian
	octeontx2-af: Optimize KPU1 processing for variable-length headers
	octeontx2-af: Reset PTP config in FLR handler
	octeontx2-af: cn10k: RPM hardware timestamp configuration
	octeontx2-af: cn10k: Use appropriate register for LMAC enable
	octeontx2-af: Adjust LA pointer for cpt parse header
	octeontx2-af: Add KPU changes to parse NGIO as separate layer
	net/mlx5e: IPsec: Refactor checksum code in tx data path
	net/mlx5e: IPsec: Fix crypto offload for non TCP/UDP encapsulated traffic
	bpf: Use u64_stats_t in struct bpf_prog_stats
	bpf: Fix possible race in inc_misses_counter
	drm/amd/display: Update watermark values for DCN301
	drm: mxsfb: Set fallback bus format when the bridge doesn't provide one
	drm: mxsfb: Fix NULL pointer dereference
	riscv/mm: Add XIP_FIXUP for phys_ram_base
	drm/i915/display: split out dpt out of intel_display.c
	drm/i915/display: Move DRRS code its own file
	drm/i915: Disable DRRS on IVB/HSW port != A
	gve: Recording rx queue before sending to napi
	net: dsa: ocelot: seville: utilize of_mdiobus_register
	net: dsa: seville: register the mdiobus under devres
	ibmvnic: don't release napi in __ibmvnic_open()
	of: net: move of_net under net/
	net: ethernet: litex: Add the dependency on HAS_IOMEM
	drm/mediatek: mtk_dsi: Reset the dsi0 hardware
	cifs: protect session channel fields with chan_lock
	cifs: fix confusing unneeded warning message on smb2.1 and earlier
	drm/amd/display: Fix stream->link_enc unassigned during stream removal
	bnxt_en: Fix occasional ethtool -t loopback test failures
	drm/amd/display: For vblank_disable_immediate, check PSR is really used
	PCI: mvebu: Fix device enumeration regression
	net: of: fix stub of_net helpers for CONFIG_NET=n
	ALSA: intel_hdmi: Fix reference to PCM buffer address
	ucounts: Fix systemd LimitNPROC with private users regression
	riscv/efi_stub: Fix get_boot_hartid_from_fdt() return value
	riscv: Fix config KASAN && SPARSEMEM && !SPARSE_VMEMMAP
	riscv: Fix config KASAN && DEBUG_VIRTUAL
	iwlwifi: mvm: check debugfs_dir ptr before use
	ASoC: ops: Shift tested values in snd_soc_put_volsw() by +min
	iommu/vt-d: Fix double list_add when enabling VMD in scalable mode
	iommu/amd: Recover from event log overflow
	drm/i915: s/JSP2/ICP2/ PCH
	drm/amd/display: Reduce dmesg error to a debug print
	xen/netfront: destroy queues before real_num_tx_queues is zeroed
	thermal: core: Fix TZ_GET_TRIP NULL pointer dereference
	mac80211: fix EAPoL rekey fail in 802.3 rx path
	blktrace: fix use after free for struct blk_trace
	ntb: intel: fix port config status offset for SPR
	mm: Consider __GFP_NOWARN flag for oversized kvmalloc() calls
	xfrm: fix MTU regression
	netfilter: fix use-after-free in __nf_register_net_hook()
	bpf, sockmap: Do not ignore orig_len parameter
	xfrm: fix the if_id check in changelink
	xfrm: enforce validity of offload input flags
	e1000e: Correct NVM checksum verification flow
	net: fix up skbs delta_truesize in UDP GRO frag_list
	netfilter: nf_queue: don't assume sk is full socket
	netfilter: nf_queue: fix possible use-after-free
	netfilter: nf_queue: handle socket prefetch
	batman-adv: Request iflink once in batadv-on-batadv check
	batman-adv: Request iflink once in batadv_get_real_netdevice
	batman-adv: Don't expect inter-netns unique iflink indices
	net: ipv6: ensure we call ipv6_mc_down() at most once
	net: dcb: flush lingering app table entries for unregistered devices
	net: ipa: add an interconnect dependency
	net/smc: fix connection leak
	net/smc: fix unexpected SMC_CLC_DECL_ERR_REGRMB error generated by client
	net/smc: fix unexpected SMC_CLC_DECL_ERR_REGRMB error cause by server
	btrfs: fix ENOSPC failure when attempting direct IO write into NOCOW range
	mac80211: fix forwarded mesh frames AC & queue selection
	net: stmmac: fix return value of __setup handler
	mac80211: treat some SAE auth steps as final
	iavf: Fix missing check for running netdev
	net: sxgbe: fix return value of __setup handler
	ibmvnic: register netdev after init of adapter
	net: arcnet: com20020: Fix null-ptr-deref in com20020pci_probe()
	ixgbe: xsk: change !netif_carrier_ok() handling in ixgbe_xmit_zc()
	iavf: Fix deadlock in iavf_reset_task
	efivars: Respect "block" flag in efivar_entry_set_safe()
	auxdisplay: lcd2s: Fix lcd2s_redefine_char() feature
	firmware: arm_scmi: Remove space in MODULE_ALIAS name
	ASoC: cs4265: Fix the duplicated control name
	auxdisplay: lcd2s: Fix memory leak in ->remove()
	auxdisplay: lcd2s: Use proper API to free the instance of charlcd object
	can: gs_usb: change active_channels's type from atomic_t to u8
	iommu/tegra-smmu: Fix missing put_device() call in tegra_smmu_find
	arm64: dts: rockchip: Switch RK3399-Gru DP to SPDIF output
	igc: igc_read_phy_reg_gpy: drop premature return
	ARM: Fix kgdb breakpoint for Thumb2
	mips: setup: fix setnocoherentio() boolean setting
	ARM: 9182/1: mmu: fix returns from early_param() and __setup() functions
	mptcp: Correctly set DATA_FIN timeout when number of retransmits is large
	selftests: mlxsw: tc_police_scale: Make test more robust
	pinctrl: sunxi: Use unique lockdep classes for IRQs
	igc: igc_write_phy_reg_gpy: drop premature return
	ibmvnic: free reset-work-item when flushing
	memfd: fix F_SEAL_WRITE after shmem huge page allocated
	s390/extable: fix exception table sorting
	sched: Fix yet more sched_fork() races
	arm64: dts: juno: Remove GICv2m dma-range
	iommu/amd: Fix I/O page table memory leak
	MIPS: ralink: mt7621: do memory detection on KSEG1
	ARM: dts: switch timer config to common devkit8000 devicetree
	ARM: dts: Use 32KiHz oscillator on devkit8000
	soc: fsl: guts: Revert commit 3c0d64e867
	soc: fsl: guts: Add a missing memory allocation failure check
	soc: fsl: qe: Check of ioremap return value
	netfilter: nf_tables: prefer kfree_rcu(ptr, rcu) variant
	ARM: tegra: Move panels to AUX bus
	can: etas_es58x: change opened_channel_cnt's type from atomic_t to u8
	net: stmmac: enhance XDP ZC driver level switching performance
	net: stmmac: only enable DMA interrupts when ready
	ibmvnic: initialize rc before completing wait
	ibmvnic: define flush_reset_queue helper
	ibmvnic: complete init_done on transport events
	net: chelsio: cxgb3: check the return value of pci_find_capability()
	net: sparx5: Fix add vlan when invalid operation
	iavf: Refactor iavf state machine tracking
	iavf: Add __IAVF_INIT_FAILED state
	iavf: Combine init and watchdog state machines
	iavf: Add trace while removing device
	iavf: Rework mutexes for better synchronisation
	iavf: Add helper function to go from pci_dev to adapter
	iavf: Fix kernel BUG in free_msi_irqs
	iavf: Add waiting so the port is initialized in remove
	iavf: Fix init state closure on remove
	iavf: Fix locking for VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS
	iavf: Fix race in init state
	iavf: Fix __IAVF_RESETTING state usage
	drm/i915/guc/slpc: Correct the param count for unset param
	drm/bridge: ti-sn65dsi86: Properly undo autosuspend
	e1000e: Fix possible HW unit hang after an s0ix exit
	MIPS: ralink: mt7621: use bitwise NOT instead of logical
	nl80211: Handle nla_memdup failures in handle_nan_filter
	drm/amdgpu: fix suspend/resume hang regression
	net: dcb: disable softirqs in dcbnl_flush_dev()
	selftests: mlxsw: resource_scale: Fix return value
	net: stmmac: perserve TX and RX coalesce value during XDP setup
	iavf: do not override the adapter state in the watchdog task (again)
	iavf: missing unlocks in iavf_watchdog_task()
	MAINTAINERS: adjust file entry for of_net.c after movement
	Input: elan_i2c - move regulator_[en|dis]able() out of elan_[en|dis]able_power()
	Input: elan_i2c - fix regulator enable count imbalance after suspend/resume
	Input: samsung-keypad - properly state IOMEM dependency
	HID: add mapping for KEY_DICTATE
	HID: add mapping for KEY_ALL_APPLICATIONS
	tracing/histogram: Fix sorting on old "cpu" value
	tracing: Fix return value of __setup handlers
	btrfs: fix lost prealloc extents beyond eof after full fsync
	btrfs: fix relocation crash due to premature return from btrfs_commit_transaction()
	btrfs: do not WARN_ON() if we have PageError set
	btrfs: qgroup: fix deadlock between rescan worker and remove qgroup
	btrfs: add missing run of delayed items after unlink during log replay
	btrfs: do not start relocation until in progress drops are done
	Revert "xfrm: xfrm_state_mtu should return at least 1280 for ipv6"
	proc: fix documentation and description of pagemap
	KVM: x86/mmu: Passing up the error state of mmu_alloc_shadow_roots()
	hamradio: fix macro redefine warning
	Linux 5.15.27

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ie338dd23e0eb61feb540b4256b5d1840fee4db84
2022-03-17 14:02:09 +01:00
Ilan Peer f3ff03c9a1 UPSTREAM: cfg80211: Support configuration of station EHT capabilities
Add attributes and some code bits to support userspace passing
in EHT capabilities of stations.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Link: https://lore.kernel.org/r/20220214173004.ecf0b3ff9627.Icb4a5f2ec7b41d9008ac4cfc16c59baeb84793d3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: I63ac58dc56e22620cd1ed1082ca851a7a9206409
(cherry picked from commit ea05fd3581d32a0f1098657005c7a9b763798fe8)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:39 -08:00
Ilan Peer 160e88de72 UPSTREAM: cfg80211: add NO-EHT flag to regulatory
This may be necessary in some cases, add a flag and propagate
it, just like the NO-HE that already exists.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
[split off from a combined 320/no-EHT patch]
Link: https://lore.kernel.org/r/20220214173004.dbb85a7b86bb.Ifc1e2daac51c1cc5f895ccfb79faf5eaec3950ec@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: I1622fd73d18616ef05d4975e8a981bc58e98b8b0
(cherry picked from commit 31846b657857e6a73d982604f36a34710d98902c)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:38 -08:00
Sriram R 93637453d1 UPSTREAM: nl80211: add support for 320MHz channel limitation
Add support to advertise drivers or regulatory limitations on 320 MHz
channels to userspace.

Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
Co-authored-by: Karthikeyan Periyasamy <quic_periyasia@quicinc.com>
Signed-off-by: Karthikeyan Periyasamy <quic_periyasia@quicinc.com>
Co-authored-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Link: https://lore.kernel.org/r/1640163883-12696-6-git-send-email-quic_vjakkam@quicinc.com
Link: https://lore.kernel.org/r/20220214163009.175289-3-johannes@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: I2bc918f9ce4f64b675464d6b5ad3eedd2e0fb38a
(cherry picked from commit c2b3d7699fb0ce66538b829af43970acc2f89060)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:38 -08:00
Veerendranath Jakkam 44f32f3f7f UPSTREAM: nl80211: add EHT MCS support
Add support for reporting and calculating EHT bitrates.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Link: https://lore.kernel.org/r/1640163883-12696-7-git-send-email-quic_vjakkam@quicinc.com
Link: https://lore.kernel.org/r/20220214163009.175289-2-johannes@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: Idc8fd87e32e7bd84936f29df3e49e57e1efc3b64
(cherry picked from commit cfb14110acf87b4db62e07ba08a80429f1749f40)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:38 -08:00
Jia Ding 263ab78988 UPSTREAM: cfg80211: Add support for EHT 320 MHz channel width
Add 320 MHz support in the channel def and center frequency validation
with compatible check.

Signed-off-by: Jia Ding <quic_jiad@quicinc.com>
Co-authored-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Co-authored-by: Muna Sinada <quic_msinada@quicinc.com>
Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
Co-authored-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Link: https://lore.kernel.org/r/1640163883-12696-5-git-send-email-quic_vjakkam@quicinc.com
Link: https://lore.kernel.org/r/20220214163009.175289-1-johannes@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: I62a1f7cd17faceea96df4eeb5edf3aa5ef903d2b
(cherry picked from commit 3743bec6120ae0748cb3fda6ff80a690117ef1f3)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:38 -08:00
Ilan Peer 2626768c2a UPSTREAM: cfg80211: Add data structures to capture EHT capabilities
And advertise EHT capabilities to user space when supported.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Link: https://lore.kernel.org/r/20220214173004.6fb70658529f.I2413a37c8f7d2d6d638038a3d95360a3fce0114d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: If6ca3026ba618317a1719c62243c6710c16b8344
(cherry picked from commit 5cd5a8a3e2fb11b1c8a09f062c44c1e228ef987a)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:38 -08:00
Johannes Berg d0026ae78f UPSTREAM: nl80211: accept only HE capability elements with valid size
The kernel (driver code) should be able to assume that a station's
HE capabilities are not badly sized, so reject them if they are.

Link: https://lore.kernel.org/r/20220214172921.80b710d45cb7.Id57ce32f9538a40e36c620fabedbd2c73346ef56@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: I7043f88e1404c0ffc8f1989c13d240b5dcb540c8
(cherry picked from commit a3a20feb32a1c281ccac80dcf615480d3a79a6bf)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:37 -08:00
Avraham Stern 4c4e96fcb0 UPSTREAM: cfg80211: don't add non transmitted BSS to 6GHz scanned channels
When adding 6GHz channels to scan request based on reported
co-located APs, don't add channels that have only APs with
"non-transmitted" BSSes if they only match the wildcard SSID since
they will be found by probing the "transmitted" BSS.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20220202104617.f6ddf099f934.I231e55885d3644f292d00dfe0f42653269f2559e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 220975804
Change-Id: Id198660ab8c3f01f9b66ad183a3ffd372709d60c
(cherry picked from commit 5666ee154f4696c011dfa8544aaf5591b6b87515)
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-03-09 08:52:37 -08:00
Jiasheng Jiang a1e603e5f3 nl80211: Handle nla_memdup failures in handle_nan_filter
[ Upstream commit 6ad27f522cb3b210476daf63ce6ddb6568c0508b ]

As there's potential for failure of the nla_memdup(),
check the return value.

Fixes: a442b761b2 ("cfg80211: add add_nan_func / del_nan_func")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20220301100020.3801187-1-jiasheng@iscas.ac.cn
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-03-08 19:12:52 +01:00
Greg Kroah-Hartman 2ded03fd7c This is the 5.15.25 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmIWFH4ACgkQONu9yGCS
 aT5EUQ//daMcZacDvhetAdGLLIQEt0VAd93rGAUBymg0uo3fSN9CKK15eeEIyRSO
 Lb7gZfGc/NWjJVevn1ClvAFF7UjWZD1kaPwnH6Qzy5Y/gyiKLhC3FEbMXXhdpP9O
 YRbp6T+8jiSoo/eYZo9Pazl1ZIP1SsraJIyxxlvtiY6WGri3YghBfxGw+TjUGSpP
 frHqnnX9UE5RJj7bW/DZMdT/i1GW/TerbSIixfCdPN/IbTTGor2N7Wq8Sa32ESM/
 xfLZj8DPsmT0Vipdcmy3WpDM1VKfICERi9KBgesuHKd9iYdeEW2UvBTQfP1IiyqG
 wgHPmbRz3q6ntEiOmd9QVWG/ANINqNiHdY+7H99lOgQ8V79qmaPF6RaQFWuFmHgv
 glKn+tElbYxprsUNwhsp9R8B4lqEVDHSYxZyRdVSrBGornXnHtOgrqSPWA1ZYis3
 HodshgN0vuiag1fpFn4S4yJtXLyLHt5jKohkZPFXG9x4YqsXmcoiSevxo/RxVg3s
 1IdY725jRZpJp85EJQLoJReRxJZV/z9YGECFQVMmUgZES4ZZdfUKXmKRYhoU22A4
 RLRE+7q1w+wAoKbJ/bFuPrrtCD/rOXF3LYPBtecGuBJte4cgif99cWtsctfSjxcm
 amkWE56oo2OHzsAgH1d6f3LsAbHLNlNNV8w66UelLBiFsAXnvU0=
 =Bgro
 -----END PGP SIGNATURE-----

Merge 5.15.25 into android13-5.15

Changes in 5.15.25
	drm/nouveau/pmu/gm200-: use alternate falcon reset sequence
	fs/proc: task_mmu.c: don't read mapcount for migration entry
	btrfs: zoned: cache reported zone during mount
	scsi: lpfc: Fix mailbox command failure during driver initialization
	HID:Add support for UGTABLET WP5540
	Revert "svm: Add warning message for AVIC IPI invalid target"
	parisc: Show error if wrong 32/64-bit compiler is being used
	serial: parisc: GSC: fix build when IOSAPIC is not set
	parisc: Drop __init from map_pages declaration
	parisc: Fix data TLB miss in sba_unmap_sg
	parisc: Fix sglist access in ccio-dma.c
	mmc: block: fix read single on recovery logic
	mm: don't try to NUMA-migrate COW pages that have other uses
	HID: amd_sfh: Add illuminance mask to limit ALS max value
	HID: i2c-hid: goodix: Fix a lockdep splat
	HID: amd_sfh: Increase sensor command timeout
	HID: amd_sfh: Correct the structure field name
	PCI: hv: Fix NUMA node assignment when kernel boots with custom NUMA topology
	parisc: Add ioread64_lo_hi() and iowrite64_lo_hi()
	btrfs: send: in case of IO error log it
	platform/x86: touchscreen_dmi: Add info for the RWC NANOTE P8 AY07J 2-in-1
	platform/x86: ISST: Fix possible circular locking dependency detected
	kunit: tool: Import missing importlib.abc
	selftests: rtc: Increase test timeout so that all tests run
	kselftest: signal all child processes
	net: ieee802154: at86rf230: Stop leaking skb's
	selftests/zram: Skip max_comp_streams interface on newer kernel
	selftests/zram01.sh: Fix compression ratio calculation
	selftests/zram: Adapt the situation that /dev/zram0 is being used
	selftests: openat2: Print also errno in failure messages
	selftests: openat2: Add missing dependency in Makefile
	selftests: openat2: Skip testcases that fail with EOPNOTSUPP
	selftests: skip mincore.check_file_mmap when fs lacks needed support
	ax25: improve the incomplete fix to avoid UAF and NPD bugs
	pinctrl: bcm63xx: fix unmet dependency on REGMAP for GPIO_REGMAP
	vfs: make freeze_super abort when sync_filesystem returns error
	quota: make dquot_quota_sync return errors from ->sync_fs
	scsi: pm80xx: Fix double completion for SATA devices
	kselftest: Fix vdso_test_abi return status
	scsi: core: Reallocate device's budget map on queue depth change
	scsi: pm8001: Fix use-after-free for aborted TMF sas_task
	scsi: pm8001: Fix use-after-free for aborted SSP/STP sas_task
	drm/amd: Warn users about potential s0ix problems
	nvme: fix a possible use-after-free in controller reset during load
	nvme-tcp: fix possible use-after-free in transport error_recovery work
	nvme-rdma: fix possible use-after-free in transport error_recovery work
	net: sparx5: do not refer to skb after passing it on
	drm/amd: add support to check whether the system is set to s3
	drm/amd: Only run s3 or s0ix if system is configured properly
	drm/amdgpu: fix logic inversion in check
	x86/Xen: streamline (and fix) PV CPU enumeration
	Revert "module, async: async_synchronize_full() on module init iff async is used"
	gcc-plugins/stackleak: Use noinstr in favor of notrace
	random: wake up /dev/random writers after zap
	KVM: x86/xen: Fix runstate updates to be atomic when preempting vCPU
	KVM: x86: nSVM/nVMX: set nested_run_pending on VM entry which is a result of RSM
	KVM: x86: SVM: don't passthrough SMAP/SMEP/PKE bits in !NPT && !gCR0.PG case
	KVM: x86: nSVM: fix potential NULL derefernce on nested migration
	KVM: x86: nSVM: mark vmcb01 as dirty when restoring SMM saved state
	iwlwifi: fix use-after-free
	drm/radeon: Fix backlight control on iMac 12,1
	drm/atomic: Don't pollute crtc_state->mode_blob with error pointers
	drm/amd/pm: correct the sequence of sending gpu reset msg
	drm/amdgpu: skipping SDMA hw_init and hw_fini for S0ix.
	drm/i915/opregion: check port number bounds for SWSCI display power state
	drm/i915: Fix dbuf slice config lookup
	drm/i915: Fix mbus join config lookup
	vsock: remove vsock from connected table when connect is interrupted by a signal
	drm/cma-helper: Set VM_DONTEXPAND for mmap
	drm/i915/gvt: Make DRM_I915_GVT depend on X86
	drm/i915/ttm: tweak priority hint selection
	iwlwifi: pcie: fix locking when "HW not ready"
	iwlwifi: pcie: gen2: fix locking when "HW not ready"
	iwlwifi: mvm: don't send SAR GEO command for 3160 devices
	selftests: netfilter: fix exit value for nft_concat_range
	netfilter: nft_synproxy: unregister hooks on init error path
	selftests: netfilter: disable rp_filter on router
	ipv4: fix data races in fib_alias_hw_flags_set
	ipv6: fix data-race in fib6_info_hw_flags_set / fib6_purge_rt
	ipv6: mcast: use rcu-safe version of ipv6_get_lladdr()
	ipv6: per-netns exclusive flowlabel checks
	Revert "net: ethernet: bgmac: Use devm_platform_ioremap_resource_byname"
	mac80211: mlme: check for null after calling kmemdup
	brcmfmac: firmware: Fix crash in brcm_alt_fw_path
	cfg80211: fix race in netlink owner interface destruction
	net: dsa: lan9303: fix reset on probe
	net: dsa: mv88e6xxx: flush switchdev FDB workqueue before removing VLAN
	net: dsa: lantiq_gswip: fix use after free in gswip_remove()
	net: dsa: lan9303: handle hwaccel VLAN tags
	net: dsa: lan9303: add VLAN IDs to master device
	net: ieee802154: ca8210: Fix lifs/sifs periods
	ping: fix the dif and sdif check in ping_lookup
	bonding: force carrier update when releasing slave
	drop_monitor: fix data-race in dropmon_net_event / trace_napi_poll_hit
	net_sched: add __rcu annotation to netdev->qdisc
	bonding: fix data-races around agg_select_timer
	libsubcmd: Fix use-after-free for realloc(..., 0)
	net/smc: Avoid overwriting the copies of clcsock callback functions
	net: phy: mediatek: remove PHY mode check on MT7531
	atl1c: fix tx timeout after link flap on Mikrotik 10/25G NIC
	tipc: fix wrong publisher node address in link publications
	dpaa2-switch: fix default return of dpaa2_switch_flower_parse_mirror_key
	dpaa2-eth: Initialize mutex used in one step timestamping path
	net: bridge: multicast: notify switchdev driver whenever MC processing gets disabled
	perf bpf: Defer freeing string after possible strlen() on it
	selftests/exec: Add non-regular to TEST_GEN_PROGS
	arm64: Correct wrong label in macro __init_el2_gicv3
	ALSA: usb-audio: revert to IMPLICIT_FB_FIXED_DEV for M-Audio FastTrack Ultra
	ALSA: hda/realtek: Add quirk for Legion Y9000X 2019
	ALSA: hda/realtek: Fix deadlock by COEF mutex
	ALSA: hda: Fix regression on forced probe mask option
	ALSA: hda: Fix missing codec probe on Shenker Dock 15
	ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw()
	ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw_range()
	ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw_sx()
	ASoC: ops: Fix stereo change notifications in snd_soc_put_xr_sx()
	cifs: fix set of group SID via NTSD xattrs
	powerpc/603: Fix boot failure with DEBUG_PAGEALLOC and KFENCE
	powerpc/lib/sstep: fix 'ptesync' build error
	mtd: rawnand: gpmi: don't leak PM reference in error path
	smb3: fix snapshot mount option
	tipc: fix wrong notification node addresses
	scsi: ufs: Remove dead code
	scsi: ufs: Fix a deadlock in the error handler
	ASoC: tas2770: Insert post reset delay
	ASoC: qcom: Actually clear DMA interrupt register for HDMI
	block/wbt: fix negative inflight counter when remove scsi device
	NFS: Remove an incorrect revalidation in nfs4_update_changeattr_locked()
	NFS: LOOKUP_DIRECTORY is also ok with symlinks
	NFS: Do not report writeback errors in nfs_getattr()
	tty: n_tty: do not look ahead for EOL character past the end of the buffer
	block: fix surprise removal for drivers calling blk_set_queue_dying
	mtd: rawnand: qcom: Fix clock sequencing in qcom_nandc_probe()
	mtd: parsers: qcom: Fix kernel panic on skipped partition
	mtd: parsers: qcom: Fix missing free for pparts in cleanup
	mtd: phram: Prevent divide by zero bug in phram_setup()
	mtd: rawnand: brcmnand: Fixed incorrect sub-page ECC status
	HID: elo: fix memory leak in elo_probe
	mtd: rawnand: ingenic: Fix missing put_device in ingenic_ecc_get
	Drivers: hv: vmbus: Fix memory leak in vmbus_add_channel_kobj
	KVM: x86/pmu: Refactoring find_arch_event() to pmc_perf_hw_id()
	KVM: x86/pmu: Don't truncate the PerfEvtSeln MSR when creating a perf event
	KVM: x86/pmu: Use AMD64_RAW_EVENT_MASK for PERF_TYPE_RAW
	ARM: OMAP2+: hwmod: Add of_node_put() before break
	ARM: OMAP2+: adjust the location of put_device() call in omapdss_init_of
	phy: usb: Leave some clocks running during suspend
	staging: vc04_services: Fix RCU dereference check
	phy: phy-mtk-tphy: Fix duplicated argument in phy-mtk-tphy
	irqchip/sifive-plic: Add missing thead,c900-plic match string
	x86/bug: Merge annotate_reachable() into _BUG_FLAGS() asm
	netfilter: conntrack: don't refresh sctp entries in closed state
	ksmbd: fix same UniqueId for dot and dotdot entries
	ksmbd: don't align last entry offset in smb2 query directory
	arm64: dts: meson-gx: add ATF BL32 reserved-memory region
	arm64: dts: meson-g12: add ATF BL32 reserved-memory region
	arm64: dts: meson-g12: drop BL32 region from SEI510/SEI610
	pidfd: fix test failure due to stack overflow on some arches
	selftests: fixup build warnings in pidfd / clone3 tests
	mm: io_uring: allow oom-killer from io_uring_setup
	ACPI: PM: Revert "Only mark EC GPE for wakeup on Intel systems"
	kconfig: let 'shell' return enough output for deep path names
	ata: libata-core: Disable TRIM on M88V29
	soc: aspeed: lpc-ctrl: Block error printing on probe defer cases
	xprtrdma: fix pointer derefs in error cases of rpcrdma_ep_create
	drm/rockchip: dw_hdmi: Do not leave clock enabled in error case
	tracing: Fix tp_printk option related with tp_printk_stop_on_boot
	display/amd: decrease message verbosity about watermarks table failure
	drm/amd/display: Cap pflip irqs per max otg number
	drm/amd/display: fix yellow carp wm clamping
	net: usb: qmi_wwan: Add support for Dell DW5829e
	net: macb: Align the dma and coherent dma masks
	kconfig: fix failing to generate auto.conf
	scsi: lpfc: Fix pt2pt NVMe PRLI reject LOGO loop
	EDAC: Fix calculation of returned address and next offset in edac_align_ptr()
	ucounts: Handle wrapping in is_ucounts_overlimit
	ucounts: In set_cred_ucounts assume new->ucounts is non-NULL
	ucounts: Base set_cred_ucounts changes on the real user
	ucounts: Enforce RLIMIT_NPROC not RLIMIT_NPROC+1
	lib/iov_iter: initialize "flags" in new pipe_buffer
	rlimit: Fix RLIMIT_NPROC enforcement failure caused by capability calls in set_user
	ucounts: Move RLIMIT_NPROC handling after set_user
	net: sched: limit TC_ACT_REPEAT loops
	dmaengine: sh: rcar-dmac: Check for error num after setting mask
	dmaengine: stm32-dmamux: Fix PM disable depth imbalance in stm32_dmamux_probe
	dmaengine: sh: rcar-dmac: Check for error num after dma_set_max_seg_size
	tests: fix idmapped mount_setattr test
	i2c: qcom-cci: don't delete an unregistered adapter
	i2c: qcom-cci: don't put a device tree node before i2c_add_adapter()
	dmaengine: ptdma: Fix the error handling path in pt_core_init()
	copy_process(): Move fd_install() out of sighand->siglock critical section
	scsi: qedi: Fix ABBA deadlock in qedi_process_tmf_resp() and qedi_process_cmd_cleanup_resp()
	ice: enable parsing IPSEC SPI headers for RSS
	i2c: brcmstb: fix support for DSL and CM variants
	lockdep: Correct lock_classes index mapping
	Linux 5.15.25

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ib129a0e11f5e82d67563329a5de1b0aef1d87928
2022-02-23 12:30:26 +01:00
Johannes Berg 241e633cb3 cfg80211: fix race in netlink owner interface destruction
commit f0a6fd1527067da537e9c48390237488719948ed upstream.

My previous fix here to fix the deadlock left a race where
the exact same deadlock (see the original commit referenced
below) can still happen if cfg80211_destroy_ifaces() already
runs while nl80211_netlink_notify() is still marking some
interfaces as nl_owner_dead.

The race happens because we have two loops here - first we
dev_close() all the netdevs, and then we destroy them. If we
also have two netdevs (first one need only be a wdev though)
then we can find one during the first iteration, close it,
and go to the second iteration -- but then find two, and try
to destroy also the one we didn't close yet.

Fix this by only iterating once.

Reported-by: Toke Høiland-Jørgensen <toke@redhat.com>
Fixes: ea6b2098dd ("cfg80211: fix locking in netlink owner interface destruction")
Tested-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/r/20220201130951.22093-1-johannes@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-23 12:03:11 +01:00
Johannes Berg a8e96486c3 UPSTREAM: nl80211: don't kfree() ERR_PTR() value
When parse_acl_data() fails, we get an ERR_PTR() value and
then "goto out;", in this case we'd attempt to kfree() it.
Fix that.

Fixes: 9e263e193af7 ("nl80211: don't put struct cfg80211_ap_settings on stack")
Link: https://lore.kernel.org/r/20210927134402.86c5ae06c952.Ic51e234d998b9045665e5ff8b6db7e29f25d70c0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 05075fe7455a210769b266e62a0040ddc98b2739)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I8df46fe71a5ffdad64e63de26a3c6276b9ee6314
2022-02-21 16:57:13 +01:00
Veerendranath Jakkam 6ebaf9ca4c UPSTREAM: nl80211: Add support to set AP settings flags with single attribute
In previous method each AP settings flag is represented by a top-level
flag attribute and conversion to enum cfg80211_ap_settings_flags had to
be done before sending them to driver. This commit is to make it easier
to define new AP settings flags and sending them to driver.

This commit also deprecate sending of
%NL80211_ATTR_EXTERNAL_AUTH_SUPPORT in %NL80211_CMD_START_AP. But to
maintain backwards compatibility checks for
%NL80211_ATTR_EXTERNAL_AUTH_SUPPORT in %NL80211_CMD_START_AP when
%NL80211_ATTR_AP_SETTINGS_FLAGS not present in %NL80211_CMD_START_AP.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
Link: https://lore.kernel.org/r/1637911519-21306-1-git-send-email-vjakkam@codeaurora.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 215824523
(cherry picked from commit 47301a74bbfa80cef876e646a8c5fec03c20fc8d)
Change-Id: I84d7c859fabcda0c90cb05b0f4d3714b268ba232
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-02-03 10:54:54 -08:00
Lorenzo Bianconi edd3b03740 UPSTREAM: cfg80211: rename offchannel_chain structs to background_chain to avoid confusion with ETSI standard
ETSI standard defines "Offchannel CAC" as:
"Off-Channel CAC is performed by a number of non-continuous checks
spread over a period in time. This period, which is required to
determine the presence of radar signals, is defined as the Off-Channel
CAC Time..
Minimum Off-Channel CAC Time 6 minutes and Maximum Off-Channel CAC Time
4 hours..".
mac80211 implementation refers to a dedicated hw chain used for continuous
radar monitoring. Rename offchannel_* references to background_* in
order to avoid confusion with ETSI standard.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/4204cc1d648d76b44557981713231e030a3bd991.1638190762.git.lorenzo@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 215824523
(cherry picked from commit a95bfb876fa87e2d0fa718ee61a8030ddf162d2b)
Change-Id: I0dbbbd3d3276959cec772ee65d9f57879712e74c
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-02-03 10:54:54 -08:00
Ilan Peer 2706cc9064 UPSTREAM: cfg80211: Add support for notifying association comeback
Thought the underline driver MLME can handle association temporal
rejection with comeback, it is still useful to notify this to
user space, as user space might want to handle the temporal
rejection differently. For example, in case the comeback time
is too long, user space can deauthenticate immediately and try
to associate with a different AP.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211129152938.2467809e8cb3.I45574185b582666bc78eef0c29a4c36b478e5382@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 215824523
(cherry picked from commit a083ee8a4e03348fb90a4b24cbe957b3252c7b04)
Change-Id: I47f7aa2b409f267b82431fd79c205e20e4df4981
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-02-03 10:54:54 -08:00
Johannes Berg d3578b139d UPSTREAM: cfg80211: simplify cfg80211_chandef_valid()
There are a lot of duplicate checks in this function to
check the delta between the control channel and CF1.
With the addition of 320 MHz, this will become even more.
Simplify the code so that the common checks are done
only once for multiple bandwidths.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211129152938.2d0240b07f11.I759e8e990f5386ba2b56ffb2488a8d4e16e22c1b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 215824523
(cherry picked from commit 3bb1ccc4ed8fbc2d26a0cce369313e80e412b4f1)
Change-Id: I404920dc3e613455d933ab84947099d1c696c3fd
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-02-03 10:54:54 -08:00
Finn Behrens 92d558f329 UPSTREAM: nl80211: remove reload flag from regulatory_request
This removes the previously unused reload flag, which was introduced in
1eda919126b4.
The request is handled as NL80211_REGDOM_SET_BY_CORE, which is parsed
unconditionally.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Nathan Chancellor <nathan@kernel.org>
Fixes: 1eda919126b4 ("nl80211: reset regdom when reloading regdb")
Link: https://lore.kernel.org/all/YaZuKYM5bfWe2Urn@archlinux-ax161/
Signed-off-by: Finn Behrens <me@kloenk.de>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/YadvTolO8rQcNCd/@gimli.kloenk.dev
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 215824523
(cherry picked from commit 37d33114240ede043c42463a6347f68ed72d6904)
Change-Id: I26ea2e65f8e853dc8133e56296710aeb4a1c8c01
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-02-03 10:54:53 -08:00
Finn Behrens f3a39c4218 UPSTREAM: nl80211: reset regdom when reloading regdb
Reload the regdom when the regulatory db is reloaded.
Otherwise, the user had to change the regulatoy domain
to a different one and then reset it to the correct
one to have a new regulatory db take effect after a
reload.

Signed-off-by: Finn Behrens <fin@nyantec.com>
Link: https://lore.kernel.org/r/YaIIZfxHgqc/UTA7@gimli.kloenk.dev
[edit commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 215824523
(cherry picked from commit 1eda919126b420fee6b8d546f7f728fbbd4b8f11)
Change-Id: I2e51ae0fa2b44d850ebe3d30c90e69a1a2c92221
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-02-03 10:54:53 -08:00
Johannes Berg ccb91dbf24 UPSTREAM: cfg80211: use ieee80211_bss_get_elem() instead of _get_ie()
Use the structured helper for finding an element instead of
the unstructured ieee80211_bss_get_ie().

Link: https://lore.kernel.org/r/20210930131130.e94709f341c3.I4ddb7fcb40efca27987deda7f9a144a5702ebfae@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 215824523
(cherry picked from commit fb8b53acf60bdfcefc5a583ce2946258f8261108)
Change-Id: I2ce0b62e038bedee306bb29a34d2c6ed262e5d83
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-02-03 10:54:53 -08:00
Lorenzo Bianconi 72059fa373 UPSTREAM: cfg80211: allow continuous radar monitoring on offchannel chain
Allow continuous radar detection on the offchannel chain in order
to switch to the monitored channel whenever the underlying driver
reports a radar pattern on the main channel.

Tested-by: Owen Peng <owen.peng@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/d46217310a49b14ff0e9c002f0a6e0547d70fd2c.1637071350.git.lorenzo@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 215824523
(cherry picked from commit 8415816493b7589e74ff4e1e7eaf3aadc7b73621)
Change-Id: Icd087afa0cd4305fab507f6cef5e4025bdfad70e
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-02-03 10:54:53 -08:00
Lorenzo Bianconi 0493ff880f UPSTREAM: cfg80211: schedule offchan_cac_abort_wk in cfg80211_radar_event
If necessary schedule offchan_cac_abort_wk work in cfg80211_radar_event
routine adding offchan parameter to cfg80211_radar_event signature.
Rename cfg80211_radar_event in __cfg80211_radar_event and introduce
the two following inline helpers:
- cfg80211_radar_event
- cfg80211_offchan_radar_event
Doing so the drv will not need to run cfg80211_offchan_cac_abort() after
radar detection on the offchannel chain.

Tested-by: Owen Peng <owen.peng@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/3ff583e021e3343a3ced54a7b09b5e184d1880dc.1637062727.git.lorenzo@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 215824523
(cherry picked from commit c47240cb46a10c40686ce4e25c64aaed676f71c9)
Change-Id: I10bc3bc1630f25064562fd6e8a9f4ebdc3d7481e
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-02-03 10:54:53 -08:00
liuguoqiang 58ea06f6b2 UPSTREAM: cfg80211: delete redundant free code
When kzalloc failed and rdev->sacn_req or rdev->scan_msg is null, pass a
null pointer to kfree is redundant, delete it and return directly.

Signed-off-by: liuguoqiang <liuguoqiang@uniontech.com>
Link: https://lore.kernel.org/r/20211115092139.24407-1-liuguoqiang@uniontech.com
[remove now unused creq = NULL assigment]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 215824523
(cherry picked from commit 3536672bbdc2e7093333be85c945a63aef4c6bb8)
Change-Id: I650e011e4bb5def81f0af15cff74fbe4fe0424f7
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-02-03 10:54:53 -08:00
Lorenzo Bianconi b03386aee2 UPSTREAM: cfg80211: fix possible NULL pointer dereference in cfg80211_stop_offchan_radar_detection
Fix the following NULL pointer dereference in
cfg80211_stop_offchan_radar_detection routine that occurs when hostapd
is stopped during the CAC on offchannel chain:

Sat Jan  1 0[  779.567851]   ESR = 0x96000005
0:12:50 2000 dae[  779.572346]   EC = 0x25: DABT (current EL), IL = 32 bits
mon.debug hostap[  779.578984]   SET = 0, FnV = 0
d: hostapd_inter[  779.583445]   EA = 0, S1PTW = 0
face_deinit_free[  779.587936] Data abort info:
: num_bss=1 conf[  779.592224]   ISV = 0, ISS = 0x00000005
->num_bss=1
Sat[  779.597403]   CM = 0, WnR = 0
 Jan  1 00:12:50[  779.601749] user pgtable: 4k pages, 39-bit VAs, pgdp=00000000418b2000
 2000 daemon.deb[  779.609601] [0000000000000000] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000
ug hostapd: host[  779.619657] Internal error: Oops: 96000005 [#1] SMP
[  779.770810] CPU: 0 PID: 2202 Comm: hostapd Not tainted 5.10.75 #0
[  779.776892] Hardware name: MediaTek MT7622 RFB1 board (DT)
[  779.782370] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO BTYPE=--)
[  779.788384] pc : cfg80211_chandef_valid+0x10/0x490 [cfg80211]
[  779.794128] lr : cfg80211_check_station_change+0x3190/0x3950 [cfg80211]
[  779.800731] sp : ffffffc01204b7e0
[  779.804036] x29: ffffffc01204b7e0 x28: ffffff80039bdc00
[  779.809340] x27: 0000000000000000 x26: ffffffc008cb3050
[  779.814644] x25: 0000000000000000 x24: 0000000000000002
[  779.819948] x23: ffffff8002630000 x22: ffffff8003e748d0
[  779.825252] x21: 0000000000000cc0 x20: ffffff8003da4a00
[  779.830556] x19: 0000000000000000 x18: ffffff8001bf7ce0
[  779.835860] x17: 00000000ffffffff x16: 0000000000000000
[  779.841164] x15: 0000000040d59200 x14: 00000000000019c0
[  779.846467] x13: 00000000000001c8 x12: 000636b9e9dab1c6
[  779.851771] x11: 0000000000000141 x10: 0000000000000820
[  779.857076] x9 : 0000000000000000 x8 : ffffff8003d7d038
[  779.862380] x7 : 0000000000000000 x6 : ffffff8003d7d038
[  779.867683] x5 : 0000000000000e90 x4 : 0000000000000038
[  779.872987] x3 : 0000000000000002 x2 : 0000000000000004
[  779.878291] x1 : 0000000000000000 x0 : 0000000000000000
[  779.883594] Call trace:
[  779.886039]  cfg80211_chandef_valid+0x10/0x490 [cfg80211]
[  779.891434]  cfg80211_check_station_change+0x3190/0x3950 [cfg80211]
[  779.897697]  nl80211_radar_notify+0x138/0x19c [cfg80211]
[  779.903005]  cfg80211_stop_offchan_radar_detection+0x7c/0x8c [cfg80211]
[  779.909616]  __cfg80211_leave+0x2c/0x190 [cfg80211]
[  779.914490]  cfg80211_register_netdevice+0x1c0/0x6d0 [cfg80211]
[  779.920404]  raw_notifier_call_chain+0x50/0x70
[  779.924841]  call_netdevice_notifiers_info+0x54/0xa0
[  779.929796]  __dev_close_many+0x40/0x100
[  779.933712]  __dev_change_flags+0x98/0x190
[  779.937800]  dev_change_flags+0x20/0x60
[  779.941628]  devinet_ioctl+0x534/0x6d0
[  779.945370]  inet_ioctl+0x1bc/0x230
[  779.948849]  sock_do_ioctl+0x44/0x200
[  779.952502]  sock_ioctl+0x268/0x4c0
[  779.955985]  __arm64_sys_ioctl+0xac/0xd0
[  779.959900]  el0_svc_common.constprop.0+0x60/0x110
[  779.964682]  do_el0_svc+0x1c/0x24
[  779.967990]  el0_svc+0x10/0x1c
[  779.971036]  el0_sync_handler+0x9c/0x120
[  779.974950]  el0_sync+0x148/0x180
[  779.978259] Code: a9bc7bfd 910003fd a90153f3 aa0003f3 (f9400000)
[  779.984344] ---[ end trace 0e67b4f5d6cdeec7 ]---
[  779.996400] Kernel panic - not syncing: Oops: Fatal exception
[  780.002139] SMP: stopping secondary CPUs
[  780.006057] Kernel Offset: disabled
[  780.009537] CPU features: 0x0000002,04002004
[  780.013796] Memory Limit: none

Fixes: b8f5facf286b ("cfg80211: implement APIs for dedicated radar detection HW")
Reported-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
Tested-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/c2e34c065bf8839c5ffa45498ae154021a72a520.1635958796.git.lorenzo@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 215824523
(cherry picked from commit 91e89c77322d2a65ede9f418642942f3c096a63b)
Change-Id: Ic305d4860e92b67dd1dc74dec9ac5deb7a42cf74
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-02-03 10:54:53 -08:00
Lorenzo Bianconi c6e3db4b3c UPSTREAM: cfg80211: move offchan_cac_event to a dedicated work
In order to make cfg80211_offchan_cac_abort() (renamed from
cfg80211_offchan_cac_event) callable in other contexts and
without so much locking restrictions, make it trigger a new
work instead of operating directly.

Do some other renames while at it to clarify.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/6145c3d0f30400a568023f67981981d24c7c6133.1635325205.git.lorenzo@kernel.org
[rewrite commit log]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 215824523
(cherry picked from commit 1507b153198137dfa9cb4bec7c5dee07089ec3af)
Change-Id: I41235223e0211d55760e83b2b2a8b1f3229c5c3c
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-02-03 10:54:52 -08:00
Lorenzo Bianconi 5d0725f5d6 UPSTREAM: cfg80211: implement APIs for dedicated radar detection HW
If a dedicated (off-channel) radar detection hardware (chain)
is available in the hardware/driver, allow this to be used by
calling the NL80211_CMD_RADAR_DETECT command with a new flag
attribute requesting off-channel radar detection is used.

Offchannel CAC (channel availability check) avoids the CAC
downtime when switching to a radar channel or when turning on
the AP.

Drivers advertise support for this using the new feature flag
NL80211_EXT_FEATURE_RADAR_OFFCHAN.

Tested-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/7468e291ef5d05d692c1738d25b8f778d8ea5c3f.1634979655.git.lorenzo@kernel.org
Link: https://lore.kernel.org/r/1e60e60fef00e14401adae81c3d49f3e5f307537.1634979655.git.lorenzo@kernel.org
Link: https://lore.kernel.org/r/85fa50f57fc3adb2934c8d9ca0be30394de6b7e8.1634979655.git.lorenzo@kernel.org
Link: https://lore.kernel.org/r/4b6c08671ad59aae0ac46fc94c02f31b1610eb72.1634979655.git.lorenzo@kernel.org
Link: https://lore.kernel.org/r/241849ccaf2c228873c6f8495bf87b19159ba458.1634979655.git.lorenzo@kernel.org
[remove offchan_mutex, fix cfg80211_stop_offchan_radar_detection(),
 remove gfp_t argument, fix documentation, fix tracing]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 215824523
(cherry picked from commit bc2dfc02836b1133d1bf4d22aa13d48ac98eabef)
Change-Id: Ib1b423534d2383c7b1d186ed7ec085c89151d5ff
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-02-03 10:54:52 -08:00
Srinivasan Raju 290bc8e2f8 UPSTREAM: nl80211: Add LC placeholder band definition to nl80211_band
Define LC band which is a draft under IEEE 802.11bb.
Current NL80211_BAND_LC is a placeholder band and
will be more defined IEEE 802.11bb progresses.

Signed-off-by: Srinivasan Raju <srini.raju@purelifi.com>
Link: https://lore.kernel.org/r/20211018100143.7565-2-srini.raju@purelifi.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 215824523
(cherry picked from commit 63fa04266629b9559d66c4dc18b03e0f9fc04a02)
Change-Id: I61a62aad3449a7f5efad8e18454980d53b7bd010
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-02-03 10:54:52 -08:00
John Crispin ede2a43301 UPSTREAM: nl80211: MBSSID and EMA support in AP mode
Add new attributes to configure support for multiple BSSID
and advanced multi-BSSID advertisements (EMA) in AP mode.

- NL80211_ATTR_MBSSID_CONFIG used for per interface configuration.
- NL80211_ATTR_MBSSID_ELEMS used to MBSSID elements for beacons.

Memory for the elements is allocated dynamically. This change frees
the memory in existing functions which call nl80211_parse_beacon(),
a comment is added to indicate the new references to do the same.

Signed-off-by: John Crispin <john@phrozen.org>
Co-developed-by: Aloka Dixit <alokad@codeaurora.org>
Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
Link: https://lore.kernel.org/r/20210916025437.29138-2-alokad@codeaurora.org
[don't leave ERR_PTR hanging around]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 215824523
(cherry picked from commit dc1e3cb8da8b414b37208b2fb6755fef8122504b)
Change-Id: I446257c295df9eb840b4e113b646559120c71f31
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-02-03 10:54:52 -08:00
Johannes Berg 42c6a8abb7 UPSTREAM: nl80211: don't put struct cfg80211_ap_settings on stack
This struct has grown quite a bit, so dynamically allocate
it instead of putting it on the stack.

Link: https://lore.kernel.org/r/20210923161836.5813d881eae3.I0fc0f83905b0bfa332c4f1505e00c13abfca3545@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 215824523
(cherry picked from commit 9e263e193af73d2509dc3102a680a11130f44e20)
Change-Id: I7f3a24c9cbe28bcde3e15b7e92f3e7a7c1f02987
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-02-03 10:54:51 -08:00
Subrat Mishra e021381788 UPSTREAM: cfg80211: AP mode driver offload for FILS association crypto
Add a driver FILS crypto offload extended capability flag to indicate
that the driver running in AP mode is capable of handling encryption
and decryption of (Re)Association request and response frames.
Add a command to set FILS AAD data to driver.

This feature is supported on drivers running in AP mode only.
This extended capability is exchanged with hostapd during cfg80211
init. If the driver indicates this capability, then before sending the
Authentication response frame, hostapd sets FILS AAD data to the
driver. This allows the driver to decrypt (Re)Association Request
frame and encrypt (Re)Association Response frame. FILS Key derivation
will still be done in hostapd.

Signed-off-by: Subrat Mishra <subratm@codeaurora.org>
Link: https://lore.kernel.org/r/1631685143-13530-1-git-send-email-subratm@codeaurora.org
[fix whitespace]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 215824523
(cherry picked from commit e306784a8de08868d0ecbf78dd42a0051d0e14ce)
Change-Id: I3ab2a3c5a31deef0ae44da3eca4b82c91c46e453
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2022-02-03 10:54:51 -08:00
Ilan Peer 0783716ba2 cfg80211: Acquire wiphy mutex on regulatory work
[ Upstream commit e08ebd6d7b90ae81f21425ca39136f5b2272580f ]

The function cfg80211_reg_can_beacon_relax() expects wiphy
mutex to be held when it is being called. However, when
reg_leave_invalid_chans() is called the mutex is not held.
Fix it by acquiring the lock before calling the function.

Fixes: a05829a722 ("cfg80211: avoid holding the RTNL when calling the driver")
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211202152831.527686cda037.I40ad9372a47cbad53b4aae7b5a6ccc0dc3fddf8b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-12-22 09:32:42 +01:00
Nguyen Dinh Phi 5a9b671c8d cfg80211: call cfg80211_stop_ap when switch from P2P_GO type
commit 563fbefed46ae4c1f70cffb8eb54c02df480b2c2 upstream.

If the userspace tools switch from NL80211_IFTYPE_P2P_GO to
NL80211_IFTYPE_ADHOC via send_msg(NL80211_CMD_SET_INTERFACE), it
does not call the cleanup cfg80211_stop_ap(), this leads to the
initialization of in-use data. For example, this path re-init the
sdata->assigned_chanctx_list while it is still an element of
assigned_vifs list, and makes that linked list corrupt.

Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com>
Reported-by: syzbot+bbf402b783eeb6d908db@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20211027173722.777287-1-phind.uet@gmail.com
Cc: stable@vger.kernel.org
Fixes: ac800140c2 ("cfg80211: .stop_ap when interface is going down")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-25 09:48:46 +01:00
Johannes Berg 1d17f61791 nl80211: fix radio statistics in survey dump
[ Upstream commit ce6b69749961426c6d822215ded9e67154e1ad4f ]

Even if userspace specifies the NL80211_ATTR_SURVEY_RADIO_STATS
attribute, we cannot get the statistics because we're not really
parsing the incoming attributes properly any more.

Fix this by passing the attrbuf to nl80211_prepare_wdev_dump()
and filling it there, if given, and using a local version only
if no output is desired.

Since I'm touching it anyway, make nl80211_prepare_wdev_dump()
static.

Fixes: 50508d941c ("cfg80211: use parallel_ops for genl")
Reported-by: Jan Fuchs <jf@simonwunderlich.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Tested-by: Sven Eckelmann <sven@narfation.org>
Link: https://lore.kernel.org/r/20211029092539.2851b4799386.If9736d4575ee79420cbec1bd930181e1d53c7317@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-25 09:48:34 +01:00
Johannes Berg cfaf703383 cfg80211: always free wiphy specific regdomain
[ Upstream commit e53e9828a8d2c6545e01ff9711f1221f2fd199ce ]

In the (somewhat unlikely) event that we allocate a wiphy, then
add a regdomain to it, and then fail registration, we leak the
regdomain. Fix this by just always freeing it at the end, in the
normal cases we'll free (and NULL) it during wiphy_unregister().
This happened when the wiphy settings were bad, and since they
can be controlled by userspace with hwsim, syzbot was able to
find this issue.

Reported-by: syzbot+1638e7c770eef6b6c0d0@syzkaller.appspotmail.com
Fixes: 3e0c3ff36c ("cfg80211: allow multiple driver regulatory_hints()")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20210927131105.68b70cef4674.I4b9f0aa08c2af28555963b9fe3d34395bb72e0cc@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-18 19:16:26 +01:00
Janusz Dziedzic 689a0a9f50 cfg80211: correct bridge/4addr mode check
Without the patch we fail:

$ sudo brctl addbr br0
$ sudo brctl addif br0 wlp1s0
$ sudo iw wlp1s0 set 4addr on
command failed: Device or resource busy (-16)

Last command failed but iface was already in 4addr mode.

Fixes: ad4bb6f888 ("cfg80211: disallow bridging managed/adhoc interfaces")
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
Link: https://lore.kernel.org/r/20211024201546.614379-1-janusz.dziedzic@gmail.com
[add fixes tag, fix indentation, edit commit log]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2021-10-25 15:23:20 +02:00
Johannes Berg 09b1d5dc6c cfg80211: fix management registrations locking
The management registrations locking was broken, the list was
locked for each wdev, but cfg80211_mgmt_registrations_update()
iterated it without holding all the correct spinlocks, causing
list corruption.

Rather than trying to fix it with fine-grained locking, just
move the lock to the wiphy/rdev (still need the list on each
wdev), we already need to hold the wdev lock to change it, so
there's no contention on the lock in any case. This trivially
fixes the bug since we hold one wdev's lock already, and now
will hold the lock that protects all lists.

Cc: stable@vger.kernel.org
Reported-by: Jouni Malinen <j@w1.fi>
Fixes: 6cd536fe62 ("cfg80211: change internal management frame registration API")
Link: https://lore.kernel.org/r/20211025133111.5cf733eab0f4.I7b0abb0494ab712f74e2efcd24bb31ac33f7eee9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2021-10-25 15:20:22 +02:00