mirror-linux/drivers
Chengfeng Ye ee5492fd88 fbnic: close fw_log race between users and teardown
Fixes a theoretical race on fw_log between the teardown path and fw_log
write functions.

fw_log is written inside fbnic_fw_log_write() and can be reached from
the mailbox handler fbnic_fw_msix_intr(), but fw_log is freed before
IRQ/MBX teardown during cleanup, resulting in a potential data race of
dereferencing a freed/null variable.

Possible Interleaving Scenario:
  CPU0: fbnic_fw_msix_intr() // Entry
          fbnic_fw_log_write()
            if (fbnic_fw_log_ready())   // true
            ... preempt ...
  CPU1: fbnic_remove() // Entry
          fbnic_fw_log_free()
            vfree(log->data_start);
            log->data_start = NULL;
  CPU0: continues, walks log->entries or writes to log->data_start

The initialization also has an incorrect order problem, as the fw_log
is currently allocated after MBX setup during initialization.
Fix the problems by adjusting the synchronization order to put
initialization in place before the mailbox is enabled, and not cleared
until after the mailbox has been disabled.

Fixes: ecc53b1b46 ("eth: fbnic: Enable firmware logging")
Signed-off-by: Chengfeng Ye <dg573847474@gmail.com>
Link: https://patch.msgid.link/20260211191329.530886-1-dg573847474@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-02-13 12:30:28 -08:00
..
accel accel/amdxdna: Move RPM resume into job run function 2026-02-04 13:08:48 -08:00
accessibility
acpi arm64 updates for 7.0 2026-02-09 20:28:45 -08:00
amba
android Locking updates for v6.20: 2026-02-10 12:28:44 -08:00
ata ata: libata: Print features also for ATAPI devices 2026-01-13 22:00:02 +09:00
atm atm: fore200e: fix use-after-free in tasklets during device removal 2026-02-12 18:57:02 -08:00
auxdisplay auxdisplay: max6959: Replace slab.h with device/devres.h 2026-01-13 12:08:12 +01:00
base Driver core changes for 7.0-rc1 2026-02-11 17:43:59 -08:00
bcma
block for-7.0/block-20260206 2026-02-09 17:57:21 -08:00
bluetooth Networking changes for 7.0 2026-02-11 19:31:52 -08:00
bus soc: driver updates for 7.0 2026-02-10 20:45:30 -08:00
cache
cdrom
cdx cdx: Use mutex guard to simplify error handling 2026-02-03 20:58:13 -06:00
char soc: driver updates for 7.0 2026-02-10 20:45:30 -08:00
clk Networking changes for 7.0 2026-02-11 19:31:52 -08:00
clocksource - A nice cleanup to the paravirt code containing a unification of the paravirt 2026-02-10 19:01:45 -08:00
comedi comedi: dmm32at: serialize use of paged registers 2026-01-16 16:43:51 +01:00
connector
counter
cpufreq Devicetree updates for v7.0: 2026-02-11 18:27:08 -08:00
cpuidle pci-v7.0-changes 2026-02-11 17:20:38 -08:00
crypto drm for 7.0-rc1 2026-02-11 12:55:44 -08:00
cxl Merge branch 'acpi-apei' 2026-02-05 15:17:54 +01:00
dax drivers/dax: add some missing kerneldoc comment fields for struct dev_dax 2026-01-14 22:16:26 -08:00
dca
devfreq
dibs
dio
dma Devicetree updates for v7.0: 2026-02-11 18:27:08 -08:00
dma-buf dma-buf: add some tracepoints to debug. 2026-01-21 13:27:54 +01:00
dpll Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-02-11 15:14:35 +01:00
edac - Remove two drivers for obsolete hardware: i82443bxgx_edac and r82600_edac 2026-02-10 18:14:36 -08:00
eisa
extcon
firewire firewire updates for v7.0 2026-02-11 11:32:06 -08:00
firmware sound updates for 7.0-rc1 2026-02-11 11:43:00 -08:00
fpga
fsi
fwctl
gnss
gpib
gpio gpio updates for v7.0-rc1 2026-02-11 10:53:39 -08:00
gpu Driver core changes for 7.0-rc1 2026-02-11 17:43:59 -08:00
greybus
hid hid-for-linus-2026020901 2026-02-11 11:28:10 -08:00
hsi
hte
hv EFI updates for v7.0 2026-02-09 20:49:19 -08:00
hwmon hwmon updates for v7.0 2026-02-11 11:00:19 -08:00
hwspinlock soc: driver updates for 7.0 2026-02-10 20:45:30 -08:00
hwtracing Merge branch 'pm-runtime' 2026-02-04 21:03:18 +01:00
i2c i2c: imx: preserve error state in block data length handler 2026-02-03 21:47:48 +01:00
i3c i3c: dw-i3c-master: fix SIR reject bit mapping for dynamic addresses 2026-01-31 00:05:22 +01:00
idle intel_idle: Add C-states validation 2026-01-07 21:17:43 +01:00
iio iio: dac: ad3552r-hs: fix out-of-bound write in ad3552r_hs_write_data_source 2026-01-11 13:25:15 +00:00
infiniband bnge/bng_re: Add a new HSI 2026-02-11 13:44:47 +01:00
input Input updates for v6.19-rc6 2026-01-25 09:42:25 -08:00
interconnect interconnect: debugfs: initialize src_node and dst_node to empty strings 2026-01-12 01:58:36 +02:00
iommu Driver core changes for 7.0-rc1 2026-02-11 17:43:59 -08:00
ipack
irqchip soc: driver updates for 7.0 2026-02-10 20:45:30 -08:00
isdn mISDN: annotate data-race around dev->work 2026-01-20 18:37:41 -08:00
leds leds: led-class: Only Add LED to leds_list when it is fully ready 2026-01-20 16:02:01 +00:00
macintosh
mailbox soc: driver updates for 7.0 2026-02-10 20:45:30 -08:00
mcb
md - dm-verity: various optimizations and fixes related to forward error 2026-02-11 17:04:21 -08:00
media [GIT PULL for v7.0] media updates 2026-02-11 12:20:25 -08:00
memory
memstick
message
mfd gpio updates for v7.0-rc1 2026-02-11 10:53:39 -08:00
misc pci-v7.0-changes 2026-02-11 17:20:38 -08:00
mmc Another fairly large set of changes, notably: 2026-01-29 19:17:43 -08:00
most
mtd A single late MTD fix, which reverts a fix that turned out to be 2026-01-29 14:08:36 -08:00
mux mux: mmio: Fix IS_ERR() vs NULL check in probe() 2026-01-16 16:42:08 +01:00
net fbnic: close fw_log race between users and teardown 2026-02-13 12:30:28 -08:00
nfc nfc: nxp-nci: remove interrupt trigger type 2026-02-06 20:54:50 -08:00
ntb ntb: transport: Fix uninitialized mutex 2026-01-17 11:57:39 -05:00
nubus nubus: Call put_device() in bus initialization error path 2026-01-26 12:26:01 +01:00
nvdimm
nvme for-7.0/block-20260206 2026-02-09 17:57:21 -08:00
nvmem
of Devicetree updates for v7.0: 2026-02-11 18:27:08 -08:00
opp OPP: Return correct value in dev_pm_opp_get_level 2026-01-27 10:58:50 +05:30
parisc parisc architecture fixes and updates for kernel v7.0-rc1: 2026-02-10 21:42:10 -08:00
parport
pci pci-v7.0-changes 2026-02-11 17:20:38 -08:00
pcmcia PCI: Separate CardBus setup & build it only with CONFIG_CARDBUS 2026-01-27 16:36:52 -06:00
peci
perf perf/arm-cmn: Reject unsupported hardware configurations 2026-02-03 19:43:52 +00:00
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-01-22 20:14:36 -08:00
pinctrl gpio fixes for v6.19-rc8 2026-01-30 11:58:27 -08:00
platform chrome-platform: Updates for v7.0 2026-02-11 09:19:47 -08:00
pmdomain pmdomain providers: 2026-02-06 10:10:39 -08:00
pnp
power gpio updates for v7.0-rc1 2026-02-11 10:53:39 -08:00
powercap powercap: intel_rapl: Add PL4 support for Ice Lake 2026-01-15 21:14:54 +01:00
pps
ps3
ptp drivers: Add support for DPLL reference count tracking 2026-02-05 15:57:46 +01:00
pwm Driver core changes for 7.0-rc1 2026-02-11 17:43:59 -08:00
rapidio
ras - Remove two drivers for obsolete hardware: i82443bxgx_edac and r82600_edac 2026-02-10 18:14:36 -08:00
regulator gpio updates for v7.0-rc1 2026-02-11 10:53:39 -08:00
remoteproc remoteproc: qcom: pas: Enable Secure PAS support with IOMMU managed by Linux 2026-01-13 12:14:35 -06:00
resctrl arm_mpam: Use non-atomic bitops when modifying feature bitmap 2026-01-16 12:04:20 +00:00
reset reset: spacemit: Add SpacemiT K3 reset driver 2026-01-24 16:53:02 +01:00
rpmsg
rtc gpio updates for v7.0-rc1 2026-02-11 10:53:39 -08:00
s390 This update includes the following changes: 2026-02-10 08:36:42 -08:00
sbus
scsi Driver core changes for 7.0-rc1 2026-02-11 17:43:59 -08:00
sh
siox
slimbus slimbus: core: clean up of_slim_get_device() 2026-01-16 16:43:05 +01:00
soc soc: driver updates for 7.0 2026-02-10 20:45:30 -08:00
soundwire soundwire fix for 6.19 2026-01-18 12:29:12 -08:00
spi sound updates for 7.0-rc1 2026-02-11 11:43:00 -08:00
spmi
ssb
staging drm for 7.0-rc1 2026-02-11 12:55:44 -08:00
target for-7.0/block-20260206 2026-02-09 17:57:21 -08:00
tc
tee TEE sysfs for 6.20 2026-01-21 16:30:52 +01:00
thermal A series of treewide cleanups to ensure interrupt request consistency. 2026-02-10 13:22:50 -08:00
thunderbolt
tty drm for 7.0-rc1 2026-02-11 12:55:44 -08:00
ufs Power management updates for 6.20-rc1/7.0-rc1 2026-02-09 19:00:42 -08:00
uio uio: pci_sva: correct '-ENODEV' check logic 2026-01-16 16:43:43 +01:00
usb pci-v7.0-changes 2026-02-11 17:20:38 -08:00
vdpa
vfio vfio: Prevent from pinned DMABUF importers to attach to VFIO DMABUF 2026-01-23 08:47:48 -07:00
vhost vsock: add netns support to virtio transports 2026-01-27 10:45:38 +01:00
video drm for 7.0-rc1 2026-02-11 12:55:44 -08:00
virt coco/tsm: Remove unused variable tsm_rwsem 2026-01-23 13:09:51 -08:00
virtio
w1
watchdog watchdog: rzv2h_wdt: Discard pm_runtime_put() return value 2026-01-08 21:36:51 +01:00
xen - A nice cleanup to the paravirt code containing a unification of the paravirt 2026-02-10 19:01:45 -08:00
zorro
Kconfig
Makefile