linux/drivers/firewire
Takashi Sakamoto 7f9f2d6abc firewire: core: fix race condition in split transaction handling
For a split transaction, either fw_core_handle_response() or
split_transaction_timeout_callback() may manipulate the same transaction
entry in the pending transaction list. The return value of timer_delete()
is used to determine which function handles the entry. If the transaction
is a split transaction and timer_delete() returns zero, the timeout
callback may already be running. In this case, the response handler must
leave the entry in the list for the timeout callback to remove.

A previous code refactoring broke this behavior, introducing a race
condition in which both functions could process the same transaction.
This could lead to a use-after-free on the transaction initiator side.

Fix the regression by ensuring that the response handler does not process
the transaction when timer_delete() returns zero. The timeout callback is
responsible for removing the entry from the pending transaction list.

Fixes: fa2dc27100 ("firewire: core: code refactoring to find and pop transaction entry")
Link: https://lore.kernel.org/r/20261018025504.290598-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2026-10-18 11:59:35 +09:00
..
.kunitconfig firewire: core: add KUnit test skeleton for node tree 2026-08-11 17:02:43 +09:00
core-card.c firewire: core: validate sub-block lengths in fw_core_add_descriptor() 2026-07-27 09:39:52 +09:00
core-cdev.c firewire: cdev: fix back-transition for iso_resource_auto client resource 2026-09-23 09:20:17 +09:00
core-device.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
core-iso.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
core-topology.c firewire: core: fix memory leak in error path of build_tree() 2026-08-12 07:50:06 +09:00
core-trace.c firewire: core: move copy_port_status() helper function to TP_fast_assign() block 2024-07-12 14:34:12 +09:00
core-transaction.c firewire: core: fix race condition in split transaction handling 2026-10-18 11:59:35 +09:00
core.h firewire: core: provide isoc header buffer size outside card driver 2026-01-18 17:18:48 +09:00
device-attribute-test.c firewire: test: Fix potential null dereference in firewire kunit test 2025-01-13 10:31:27 +09:00
init_ohci1394_dma.c firewire: init_ohci1394_dma: add missing function parameter documentation 2025-10-25 08:29:56 +09:00
Kconfig firewire: core: add KUnit test skeleton for node tree 2026-08-11 17:02:43 +09:00
Makefile firewire: ohci: add static inline functions to deserialize for Self-ID DMA operation 2024-07-04 08:12:48 +09:00
net.c firewire: net: Fix fragmented datagram reassembly 2026-07-13 20:19:06 +09:00
node-tree-test.c firewire: core: fix memory leak in error path of build_tree() 2026-08-12 07:50:06 +09:00
nosy-user.h
nosy.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nosy.h
ohci-serdes-test.c firewire: ohci: add static inline functions to serialize/deserialize data of IT DMA 2024-08-02 09:36:05 +09:00
ohci.c - Get rid of static_cpu_has() - one less API to care about testing CPU 2026-08-18 19:09:42 -07:00
ohci.h firewire: ohci: add static inline functions to serialize/deserialize data of IT DMA 2024-08-02 09:36:05 +09:00
packet-header-definitions.h firewire: core: arrangement header inclusion for tracepoints events 2024-06-17 08:37:03 +09:00
packet-serdes-test.c firewire: core: add tests for serialization/deserialization of phy config packet 2024-06-17 08:37:03 +09:00
phy-packet-definitions.h firewire: core: add tests for serialization/deserialization of phy config packet 2024-06-17 08:37:03 +09:00
sbp2.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
self-id-sequence-helper-test.c firewire: core: add helper function to handle port status from self ID sequence and its KUnit test 2024-06-17 08:37:02 +09:00
uapi-test.c firewire: add missing MODULE_DESCRIPTION() to test modules 2024-05-27 07:34:58 +09:00