linux/arch
Esther Shimanovich 67416562ae PCI: Detect and trust built-in Thunderbolt chips
[ Upstream commit 3b96b89512 ]

Some computers with CPUs that lack Thunderbolt features use discrete
Thunderbolt chips to add Thunderbolt functionality. These Thunderbolt
chips are located within the chassis; between the Root Port labeled
ExternalFacingPort and the USB-C port.

These Thunderbolt PCIe devices should be labeled as fixed and trusted, as
they are built into the computer. Otherwise, security policies that rely on
those flags may have unintended results, such as preventing USB-C ports
from enumerating.

Detect the above scenario through the process of elimination.

  1) Integrated Thunderbolt host controllers already have Thunderbolt
     implemented, so anything outside their external facing Root Port is
     removable and untrusted.

     Detect them using the following properties:

       - Most integrated host controllers have the "usb4-host-interface"
         ACPI property, as described here:

         https://learn.microsoft.com/en-us/windows-hardware/drivers/pci/dsd-for-pcie-root-ports#mapping-native-protocols-pcie-displayport-tunneled-through-usb4-to-usb4-host-routers

       - Integrated Thunderbolt PCIe Root Ports before Alder Lake do not
         have the "usb4-host-interface" ACPI property. Identify those by
         their PCI IDs instead.

  2) If a Root Port does not have integrated Thunderbolt capabilities, but
     has the "ExternalFacingPort" ACPI property, that means the
     manufacturer has opted to use a discrete Thunderbolt host controller
     that is built into the computer.

     This host controller can be identified by virtue of being located
     directly below an external-facing Root Port that lacks integrated
     Thunderbolt. Label it as trusted and fixed.

     Everything downstream from it is untrusted and removable.

The "ExternalFacingPort" ACPI property is described here:
https://learn.microsoft.com/en-us/windows-hardware/drivers/pci/dsd-for-pcie-root-ports#identifying-externally-exposed-pcie-root-ports

Link: https://lore.kernel.org/r/20240910-trust-tbt-fix-v5-1-7a7a42a5f496@chromium.org
Suggested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Esther Shimanovich <eshimanovich@chromium.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-12-14 19:51:42 +01:00
..
alpha alpha: remove __init annotation from exported page_is_ram() 2023-08-16 18:22:03 +02:00
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-05-02 16:24:44 +02:00
arm ARM: dts: cubieboard4: Fix DCDC5 regulator constraints 2024-12-14 19:50:48 +01:00
arm64 arm64: ptrace: fix partial SETREGSET for NT_ARM_TAGGED_ADDR_CTRL 2024-12-14 19:51:32 +01:00
csky csky, hexagon: fix broken sys_sync_file_range 2024-07-05 09:14:48 +02:00
h8300 h8300: Fix build errors from do_exit() to make_task_dead() transition 2023-02-01 08:27:21 +01:00
hexagon hexagon: fix fadvise64_64 calling conventions 2024-07-05 09:14:48 +02:00
ia64 arch: Introduce CONFIG_FUNCTION_ALIGNMENT 2024-04-10 16:18:49 +02:00
m68k m68k: coldfire/device.c: only build FEC when HW macros are defined 2024-12-14 19:51:06 +01:00
microblaze microblaze: don't treat zero reserved memory regions as error 2024-10-17 15:10:38 +02:00
mips mips: asm: fix warning when disabling MIPS_FP_SUPPORT 2024-12-14 19:50:42 +01:00
nds32 exit: Add and use make_task_dead. 2023-02-01 08:27:20 +01:00
nios2 nios2: dts: Fix tse_mac "max-frame-size" property 2023-06-21 15:59:14 +02:00
openrisc openrisc: Call setup_memory() earlier in the init sequence 2024-09-04 13:23:27 +02:00
parisc parisc: fix a possible DMA corruption 2024-12-14 19:51:11 +01:00
powerpc powerpc/pseries: Fix KVM guest detection for disabling hardlockup detector 2024-12-14 19:51:13 +01:00
riscv riscv: Remove duplicated GET_RM 2024-11-08 16:25:55 +01:00
s390 s390/cpum_sf: Handle CPU hotplug remove during sampling 2024-12-14 19:51:34 +01:00
sh sh: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2024-12-14 19:51:16 +01:00
sparc sparc64: Fix incorrect function signature and add prototype for prom_cif_init 2024-08-19 05:45:04 +02:00
um um: Always dump trace for specified task in show_stack 2024-12-14 19:51:19 +01:00
x86 PCI: Detect and trust built-in Thunderbolt chips 2024-12-14 19:51:42 +01:00
xtensa xtensa: boot/lib: fix function prototypes 2023-10-06 13:18:14 +02:00
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Kconfig cpu: Re-enable CPU mitigations by default for !X86 architectures 2024-05-02 16:24:48 +02:00