linux/drivers
Baochen Qiang 9abf199943 wifi: ath11k: fix NULL pointer dereference in ath11k_mac_get_eirp_power()
Commit 39dc8b8ea3 ("wifi: mac80211: pass parsed TPE data to drivers") breaks
ath11k, leading to kernel crash:

BUG: kernel NULL pointer dereference, address: 0000000000000018
RIP: 0010:ath11k_mac_get_eirp_power.isra.0+0x5b/0x80 [ath11k]
Call Trace:
 <TASK>
 ath11k_mac_fill_reg_tpc_info+0x3d6/0x800 [ath11k]
 ath11k_mac_vdev_start_restart+0x412/0x4d0 [ath11k]
 ath11k_mac_op_sta_state+0x7bc/0xbb0 [ath11k]
 drv_sta_state+0xf1/0x5f0 [mac80211]
 sta_info_insert_rcu+0x28d/0x530 [mac80211]
 sta_info_insert+0xf/0x20 [mac80211]
 ieee80211_prep_connection+0x3b4/0x4c0 [mac80211]
 ieee80211_mgd_auth+0x363/0x600 [mac80211]

The issue scenario is, AP advertises power spectral density (PSD) values in its
transmit power envelope (TPE) IE and supports 160 MHz bandwidth in 6 GHz. When
connecting to this AP, in ath11k_mac_parse_tx_pwr_env(), the local variable
psd is true and then reg_tpc_info.num_pwr_levels is set to 8 due to 160 MHz
bandwidth. Note here ath11k fails to set reg_tpc_info.is_psd_power as TRUE due
to above commit. Then in ath11k_mac_fill_reg_tpc_info(), for each of the 8
power levels, for a PSD channel, ath11k_mac_get_psd_channel() is expected to
be called to get required information. However due to invalid
reg_tpc_info.is_psd_power, it is ath11k_mac_get_eirp_power() that gets called
and passed with pwr_lvl_idx as one of the arguments. Note this function
implicitly requires pwr_lvl_idx to be no more than 3. So when pwr_lvl_idx is
larger than that ath11k_mac_get_seg_freq() returns invalid center frequency,
with which as the input ieee80211_get_channel() returns NULL, then kernel
crashes due to NULL pointer dereference.

Fix it by setting reg_tpc_info.is_psd_power properly.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30

Fixes: 39dc8b8ea3 ("wifi: mac80211: pass parsed TPE data to drivers")
Reported-by: Mikko Tiihonen <mikko.tiihonen@iki.fi>
Tested-by: Mikko Tiihonen <mikko.tiihonen@iki.fi>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219131
Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://patch.msgid.link/20240813083808.9224-1-quic_bqiang@quicinc.com
2024-08-22 14:16:51 +03:00
..
accel
accessibility
acpi RISC-V Patches for the 6.11 Merge Window, Part 2 2024-07-27 10:14:34 -07:00
amba
android
ata Char/Misc and other driver changes for 6.11-rc1 2024-07-19 15:55:08 -07:00
atm
auxdisplay auxdisplay updates for v6.11 2024-07-26 11:04:28 -07:00
base regmap: Fix for v6.11 2024-07-27 12:26:09 -07:00
bcma
block block-6.11-20240726 2024-07-27 15:28:53 -07:00
bluetooth Bluetooth: btmtk: remove #ifdef around declarations 2024-07-26 10:56:54 -04:00
bus Devicetree fixes for 6.11, part 1 2024-07-27 12:46:16 -07:00
cache cache: StarFive: Require a 64-bit system 2024-08-01 07:15:02 -07:00
cdrom sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
cdx
char sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
clk Devicetree fixes for 6.11, part 1 2024-07-27 12:46:16 -07:00
clocksource of: remove internal arguments from of_property_for_each_u32() 2024-07-25 06:53:47 -05:00
comedi
connector
counter Char/Misc and other driver changes for 6.11-rc1 2024-07-19 15:55:08 -07:00
cpufreq Power management updates for 6.11-rc1 2024-07-16 15:54:03 -07:00
cpuidle
crypto ARM: 2024-07-20 12:41:03 -07:00
cxl CXL for v6.11 merge window 2024-07-28 09:33:28 -07:00
dax Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
dca Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
devfreq
dio
dma Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
dma-buf - 875fa64577 ("mm/hugetlb_vmemmap: fix race with speculative PFN 2024-07-21 17:15:46 -07:00
dpll
edac minmax: make generic MIN() and MAX() macros available everywhere 2024-07-28 15:49:18 -07:00
eisa
extcon
firewire Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
firmware ARM updates for v6.11-rc1 2024-07-29 10:33:51 -07:00
fpga Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
fsi Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
gnss
gpio gpio fixes for v6.11-rc1 2024-07-27 12:54:06 -07:00
gpu drm fixes for 6.11-rc2 2024-08-02 08:59:09 -07:00
greybus Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
hid for-linus-2024072901 2024-07-29 13:07:05 -07:00
hsi Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
hte
hv Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
hwmon minmax: make generic MIN() and MAX() macros available everywhere 2024-07-28 15:49:18 -07:00
hwspinlock
hwtracing Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
i2c Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
i3c I3C for 6.11 2024-07-27 10:53:06 -07:00
idle
iio of: remove internal arguments from of_property_for_each_u32() 2024-07-25 06:53:47 -05:00
infiniband IOMMU Updates for Linux v6.11 2024-07-19 09:59:58 -07:00
input Input: MT - limit max slots 2024-07-29 10:44:48 -07:00
interconnect Char/Misc and other driver changes for 6.11-rc1 2024-07-19 15:55:08 -07:00
iommu IOMMU Fixes for Linux v6.11-rc1 2024-07-27 12:39:55 -07:00
ipack
irqchip A couple of fixes for interrupt chip drivers: 2024-08-04 08:36:57 -07:00
isdn mISDN: Fix a use after free in hfcmulti_tx() 2024-07-25 08:05:05 -07:00
leds - Core Frameworks 2024-07-17 17:51:30 -07:00
macintosh sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-25 12:58:36 -07:00
mailbox mailbox: mtk-cmdq: Move devm_mbox_controller_register() after devm_pm_runtime_enable() 2024-07-19 21:25:23 -05:00
mcb Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
md minmax: add a few more MIN_T/MAX_T users 2024-07-28 13:41:14 -07:00
media media fixes for v6.11-rc2 2024-08-04 08:12:33 -07:00
memory
memstick Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
message
mfd Devicetree fixes for 6.11, part 1 2024-07-27 12:46:16 -07:00
misc Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
mmc Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
most Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
mtd This pull request contains updates (actually, just fixes) for UBI and UBIFS: 2024-07-28 11:51:51 -07:00
mux
net wifi: ath11k: fix NULL pointer dereference in ath11k_mac_get_eirp_power() 2024-08-22 14:16:51 +03:00
nfc minmax: make generic MIN() and MAX() macros available everywhere 2024-07-28 15:49:18 -07:00
ntb Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
nubus
nvdimm Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
nvme nvme fixes for Linux 6.11 2024-07-26 08:06:15 -06:00
nvmem Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
of IOMMU Updates for Linux v6.11 2024-07-19 09:59:58 -07:00
opp Merge branches 'pm-opp' and 'pm-tools' 2024-07-15 18:55:14 +02:00
parisc
parport sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-25 12:58:36 -07:00
pci PCI: pciehp: Retain Power Indicator bits for userspace indicators 2024-08-01 12:58:03 -05:00
pcmcia Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
peci Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
perf perf: riscv: Fix selecting counters in legacy mode 2024-08-01 07:15:13 -07:00
phy phy-for-6.11 2024-07-24 13:11:28 -07:00
pinctrl of: remove internal arguments from of_property_for_each_u32() 2024-07-25 06:53:47 -05:00
platform chrome-platform fixes for v6.11-rc2 2024-07-30 12:53:52 -07:00
pmdomain
pnp
power power supply and reset changes for the 6.11 series 2024-07-23 09:38:27 -07:00
powercap
pps Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
ps3
ptp Networking changes for 6.11. Not much excitement - a handful of large 2024-07-16 19:28:34 -07:00
pwm of: remove internal arguments from of_property_for_each_u32() 2024-07-25 06:53:47 -05:00
rapidio
ras - The AMD memory controllers data fabric version 4.5 supports 2024-07-15 18:20:24 -07:00
regulator regulator: Fixes for v6.11 2024-07-27 12:27:52 -07:00
remoteproc rpmsg updates for v6.11 2024-07-23 13:41:59 -07:00
reset Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
rpmsg Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
rtc
s390 s390/cio: Add missing MODULE_DESCRIPTION() macros 2024-07-31 16:30:20 +02:00
sbus
scsi SCSI fixes on 20240803 2024-08-03 15:12:56 -07:00
sh
siox Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
slimbus Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
soc Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
soundwire Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
spi spi: Fixes for v6.11 2024-07-27 12:29:10 -07:00
spmi Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
ssb
staging minmax: make generic MIN() and MAX() macros available everywhere 2024-07-28 15:49:18 -07:00
target
tc
tee Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
thermal Merge branch 'thermal-intel' 2024-07-31 12:31:27 +02:00
thunderbolt Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
tty Devicetree fixes for 6.11, part 1 2024-07-27 12:46:16 -07:00
ufs Merge branch '6.11/scsi-queue' into 6.11/scsi-fixes 2024-07-29 21:46:16 -04:00
uio
usb Devicetree fixes for 6.11, part 1 2024-07-27 12:46:16 -07:00
vdpa virtio: fixes 2024-07-29 12:53:37 -07:00
vfio Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
vhost virtio: features, fixes, cleanups 2024-07-19 11:57:55 -07:00
video - 875fa64577 ("mm/hugetlb_vmemmap: fix race with speculative PFN 2024-07-21 17:15:46 -07:00
virt ARM: 2024-07-20 12:41:03 -07:00
virtio virtio: fixes 2024-07-29 12:53:37 -07:00
w1
watchdog linux-watchdog 6.11-rc1 tag 2024-07-25 10:18:35 -07:00
xen Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
zorro Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
Kconfig
Makefile