linux/drivers
Jakub Kicinski d798162eb3 dpll: reject a reference sync pin which is not on the pin's dpll
dpll_pin_ref_sync_state_set() resolves the partner's driver private data
with dpll_pin_on_dpll_priv() and passes the result to ref_sync_get() and
ref_sync_set() without looking at it. The helper returns NULL when the
partner holds no ref on that dpll. Of the two drivers implementing the
feature only zl3073x dereferences the pointer (sync_pin->id); ice ignores
it, so ice cannot fault here.

The NULL is a teardown race, not a steady state - zl3073x registers every
input pin with every channel, so the partner is normally present on the
dpll the base pin resolves to. zl3073x_dev_stop() unregisters pins one at
a time, taking and dropping dpll_lock for each, and between the partner's
turn and the base pin's the partner is out of that dpll's pin_refs while
still registered with the channels not yet torn down, so
dpll_pin_available() keeps passing. That path is not only driver removal:
devlink reload and devlink dev flash both run zl3073x_dev_stop().

Reproduced by holding that state open with a mock dpll device, which is
where the frame name comes from:

 BUG: kernel NULL pointer dereference, address: 0000000000000000
 Oops: Oops: 0000 [#1] SMP NOPTI
 RIP: 0010:mock_ref_sync_get+0x5/0x30
 Call Trace:
  <TASK>
  dpll_pin_ref_sync_set+0x19f/0x4a0
  dpll_nl_pin_set_doit+0x17d/0x840
  genl_family_rcv_msg_doit+0xd6/0x130
  genl_rcv_msg+0x181/0x2b0
  netlink_rcv_skb+0x55/0x100
  genl_rcv+0x23/0x30
  netlink_unicast+0x24d/0x370
  netlink_sendmsg+0x1e2/0x420
  __sys_sendto+0x1db/0x1f0
  __x64_sys_sendto+0x1f/0x30
  do_syscall_64+0xe1/0x490

Commit d2e914a4a0 ("dpll: fix NULL pointer dereference in
dpll_msg_add_pin_ref_sync()") added the same guard to the read side, which
the kernel walks into by itself because the delete notification is emitted
from inside the unregister; the write side needs a pin-set to land in the
window and was left alone. Test the priv rather than look up pin_refs
directly, so that the two halves key off the same condition.

Fixes: 58256a26bf ("dpll: add reference sync get/set")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Ivan Vecera <ivecera@redhat.com>
Link: https://patch.msgid.link/20260915213047.1352286-1-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-09-17 14:51:23 +02:00
..
accel kmalloc_obj conversions for v7.3-rc2 2026-09-05 20:45:18 -07:00
accessibility
acpi treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
amba
android Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
ata ata: libata-scsi: do not raise UA for storage element depopulation and restoration 2026-09-03 16:10:44 +02:00
atm
auxdisplay auxdisplay for v7.3-1 2026-08-24 08:15:59 -07:00
base kmalloc_obj conversions for v7.3-rc2 2026-09-05 20:45:18 -07:00
bcma
block kmalloc_obj conversions for v7.3-rc2 2026-09-05 20:45:18 -07:00
bluetooth Bluetooth: btintel_pcie: fix off-by-one bounds check in RX submit 2026-09-15 14:55:27 -04:00
bus Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
cache
cdrom
cdx
char virtio_console: do not free control-out buffers on remove 2026-09-07 18:54:02 -04:00
clk treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
clocksource hyperv-next for v7.3-rc1 2026-08-26 16:47:40 -07:00
comedi
connector
counter Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
cpufreq treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
cpuidle cpuidle: dt_idle_genpd: kfree() the original name allocation 2026-09-01 17:28:56 +02:00
crypto treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
cxl
dax mm.git review status for mm-hotfixes-stable..mm-stable 2026-08-20 18:17:08 -07:00
dca
devfreq treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
dibs dibs: Unregister dibs_class after error 2026-09-04 16:12:24 -07:00
dio
dma treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
dma-buf kmalloc_obj conversions for v7.3-rc2 2026-09-05 20:45:18 -07:00
dpll dpll: reject a reference sync pin which is not on the pin's dpll 2026-09-17 14:51:23 +02:00
edac treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
eisa
extcon
firewire firewire updates for v7.3 2026-08-22 08:41:28 -07:00
firmware treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
fpga treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
fsi
fwctl rust: introduce abstractions for fwctl 2026-08-14 19:21:17 -03:00
gnss
gpib Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
gpio treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
gpu kmalloc_obj conversions for v7.3-rc2 2026-09-05 20:45:18 -07:00
greybus
hid treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
hsi HSI changes for the 7.3 series 2026-08-21 12:01:23 -07:00
hte
hv treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
hwmon treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
hwspinlock
hwtracing treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
i2c treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
i3c treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
idle
iio treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
infiniband treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
input treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
interconnect This pull request contains the following interconnect updates for 2026-08-19 09:55:37 +02:00
iommu treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
ipack Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
irqchip Miscellaneous IRQ subsystem fixes: 2026-09-06 10:35:24 -07:00
leds LEDs for v7.3 2026-08-27 11:05:51 -07:00
macintosh
mailbox treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
mcb
md treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
media treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
memory * Raw NAND changes 2026-08-23 09:11:21 -07:00
memstick
message
mfd treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
misc Merge drm/drm-fixes into drm-misc-fixes 2026-09-01 09:38:51 +02:00
mmc MMC core: 2026-08-21 11:58:08 -07:00
most
mtd treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
mux
net net: mvpp2: prevent buffer overflow in page_pool allocation 2026-09-17 14:43:29 +02:00
nfc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-08-18 10:42:41 -07:00
ntb NTB: ntb_transport: Reject oversized TX buffers 2026-08-20 13:43:24 -07:00
nubus
nvdimm treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
nvme kmalloc_obj conversions for v7.3-rc2 2026-09-05 20:45:18 -07:00
nvmem Char/Misc/IIO/etc driver update for 7.3-rc1 2026-08-25 09:38:50 -07:00
of Devicetree fixes for v7.3, part 1: 2026-08-27 12:53:43 -07:00
opp treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
parisc parisc: eisa: Fix infinite loop when parsing invalid IRQ value 2026-08-18 11:43:05 +02:00
parport
pci treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
pcmcia
peci
perf RISC-V updates for v7.3 2026-08-20 14:53:54 -07:00
phy Mostly the usual clk driver updates and new SoC additions plus non-critical 2026-08-26 11:14:30 -07:00
pinctrl Pin control bulk changes for kernel v7.3 2026-08-24 08:46:03 -07:00
platform treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
pmdomain treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
pnp
power treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
powercap More power management updates for 7.3-rc1 2026-08-26 14:13:26 -07:00
pps
ps3
ptp treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
pwm Driver core changes for 7.3-rc1 2026-08-19 10:42:18 -07:00
rapidio
ras - Mark the mpc85xx and ThunderX EDAC drivers as orphaned due to lack of 2026-08-31 20:10:39 -07:00
regulator regulator: Fix for v7.3 2026-08-27 12:21:56 -07:00
remoteproc
resctrl arm64 updates for 7.3 2026-08-18 11:57:17 -07:00
reset Mostly the usual clk driver updates and new SoC additions plus non-critical 2026-08-26 11:14:30 -07:00
rpmsg
rtc RTC for 7.3 2026-08-28 09:53:43 -07:00
s390 Nothing too exciting, usual stream of fixes. 2026-09-10 14:07:48 -07:00
sbus
scsi kmalloc_obj conversions for v7.3-rc2 2026-09-05 20:45:18 -07:00
sh
siox
slimbus
soc treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
soundwire soundwire updates for 7.3 2026-08-24 12:16:16 -07:00
spi treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
spmi
ssb
staging Staging driver fixes for 7.3-rc2 2026-09-06 09:49:06 -07:00
target scsi: target: iscsi: Reserve a terminator byte for the login payload 2026-09-01 22:08:31 -04:00
tc
tee treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
thermal MFD for v7.3 2026-08-27 10:45:08 -07:00
thunderbolt treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
tty treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
ufs kmalloc_obj conversions for v7.3-rc2 2026-09-05 20:45:18 -07:00
uio
usb USB fixes for 7.3-rc2 2026-09-06 08:50:20 -07:00
vdpa vduse: return compat ioctl results directly 2026-09-08 03:58:27 -04:00
vfio mm.git review status for mm-hotfixes-stable..mm-stable 2026-08-20 18:17:08 -07:00
vhost vhost: invalidate vring access on IOTLB transitions 2026-09-07 18:54:04 -04:00
video Backlight for v7.3 2026-08-27 11:16:39 -07:00
virt arm64 updates for 7.3 2026-08-18 11:57:17 -07:00
virtio virtio_input: stop callbacks before unregistering input device 2026-09-07 18:54:04 -04:00
w1
watchdog watchdog: msc313e: Sync timeout value if WDT was running at boot 2026-09-09 14:18:25 -07:00
xen treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
zorro
Kconfig
Makefile