mirror-linux/drivers/thunderbolt
Michael Bommarito 928abe19fb thunderbolt: property: Cap recursion depth in __tb_property_parse_dir()
A DIRECTORY entry's value field is used as the dir_offset for a
recursive call into __tb_property_parse_dir() with no depth counter.
A crafted peer that chains DIRECTORY entries into a back-reference
loop drives the parser until the kernel stack is exhausted and the
guard page fires.  Any untrusted XDomain peer (cable, dock, in-line
inspector, adjacent host) that reaches the PROPERTIES_REQUEST
control-plane exchange can trigger this without authentication.

Thread a depth counter through tb_property_parse() and
__tb_property_parse_dir(), and reject blocks that exceed
TB_PROPERTY_MAX_DEPTH = 8.  That is comfortably larger than any
observed legitimate XDomain layout.

Operators who do not need XDomain host-to-host discovery can disable
the path entirely with thunderbolt.xdomain=0 on the kernel command
line.

Fixes: cdae7c07e3 ("thunderbolt: Add support for XDomain properties")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4-6
Assisted-by: Codex:gpt-5-4
Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2026-05-11 11:32:03 +02:00
..
Kconfig thunderbolt: Use HMAC-SHA256 library instead of crypto_shash 2025-08-11 07:56:14 +02:00
Makefile thunderbolt: Add trace events support for the control channel 2024-02-26 09:12:24 +02:00
acpi.c thunderbolt: Update acpi.c function documentation 2025-09-17 07:32:58 +02:00
cap.c thunderbolt: Update cap.c function documentation 2025-09-17 07:32:58 +02:00
clx.c thunderbolt: Update clx.c function documentation 2025-09-17 07:32:58 +02:00
ctl.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ctl.h thunderbolt: Add missing documentation in ctl.h tb_cfg_request struct 2025-09-17 07:32:58 +02:00
debugfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dma_port.c thunderbolt: dma_port: kmalloc_array + kzalloc to flex 2026-03-18 14:31:56 +01:00
dma_port.h thunderbolt: Convert rest of the driver files to use SPDX identifier 2018-10-02 15:52:08 -07:00
dma_test.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
domain.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
eeprom.c thunderbolt: Fix typo in tb_eeprom_ctl_read documentation 2025-10-20 08:17:36 +02:00
icm.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
lc.c thunderbolt: Fix typos in lc.c 2025-11-17 08:24:23 +01:00
nhi.c thunderbolt: Fix property read in nhi_wake_supported() 2026-03-09 12:36:54 +01:00
nhi.h thunderbolt: Add support for Intel Wildcat Lake 2025-10-20 08:20:34 +02:00
nhi_ops.c thunderbolt: Software CM only should set force power in Tiger Lake 2020-09-03 12:06:40 +03:00
nhi_regs.h thunderbolt: Add missing documentation in nhi_regs.h ring_desc structure 2025-09-17 07:32:59 +02:00
nvm.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
path.c thunderbolt: Use kzalloc_flex() for struct tb_path allocation 2026-03-23 06:49:43 +01:00
property.c thunderbolt: property: Cap recursion depth in __tb_property_parse_dir() 2026-05-11 11:32:03 +02:00
quirks.c thunderbolt: Disable CLx on Titan Ridge-based devices with old firmware 2026-03-02 07:51:58 +01:00
retimer.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sb_regs.h thunderbolt: debugfs: Implement asymmetric lane margining 2024-11-01 07:55:38 +02:00
switch.c thunderbolt: Read router NVM version before applying quirks 2026-03-02 07:51:58 +01:00
tb.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
tb.h thunderbolt: Use kzalloc_flex() for struct tb_path allocation 2026-03-23 06:49:43 +01:00
tb_msgs.h thunderbolt: Notify userspace about firmware CM tunneling events 2025-04-24 08:24:39 +03:00
tb_regs.h thunderbolt: Fix typos in tb_regs.h 2025-11-17 08:24:24 +01:00
test.c thunderbolt: Handle DisplayPort tunnel activation asynchronously 2025-01-03 11:50:09 +02:00
tmu.c thunderbolt: Fix typos in tmu.c 2025-11-17 08:24:24 +01:00
trace.h thunderbolt: Correct trace output of firmware connection manager packets 2024-04-29 07:47:54 +03:00
tunnel.c thunderbolt: tunnel: Simplify allocation 2026-04-07 09:00:26 +02:00
tunnel.h thunderbolt: tunnel: Simplify allocation 2026-04-07 09:00:26 +02:00
usb4.c thunderbolt: Fix typos in usb4.c 2025-11-17 08:24:24 +01:00
usb4_port.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
xdomain.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00