linux/drivers
Rajat Jain c037b6c818 PCI: Add sysfs "removable" attribute
A PCI device is "external_facing" if it's a Root Port with the ACPI
"ExternalFacingPort" property or if it has the DT "external-facing"
property.  We consider everything downstream from such a device to
be removable by user.

We're mainly concerned with consumer platforms with user accessible
Thunderbolt ports that are vulnerable to DMA attacks, and we expect those
ports to be identified by firmware as "ExternalFacingPort". Devices in
traditional hotplug slots can technically be removed, but the expectation
is that unless the port is marked with "ExternalFacingPort", such devices
are less accessible to user / may not be removed by end user, and thus not
exposed as "removable" to userspace.

This can be used to implement userspace policies tailored for
user removable devices. Eg usage:
https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2591812
https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2795038
(code uses such an attribute to remove external PCI devices or disable
features on them as needed by the policy desired)

Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Rajat Jain <rajatja@google.com>
Link: https://lore.kernel.org/r/20210524171812.18095-2-rajatja@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-27 09:36:31 +02:00
..
accessibility TTY/Serial driver updates for 5.13-rc1 2021-04-26 11:20:10 -07:00
acpi libnvdimm fixes for 5.13-rc2 2021-05-15 08:32:51 -07:00
amba
android selinux/stable-5.13 PR 20210426 2021-04-27 13:42:11 -07:00
ata pci-v5.13-changes 2021-05-05 13:24:11 -07:00
atm atm: firestream: Use fallthrough pseudo-keyword 2021-05-07 16:01:08 -07:00
auxdisplay treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
base driver core: Move the "removable" attribute from USB to core 2021-05-27 09:36:31 +02:00
bcma bcma: remove unused function 2021-04-18 09:36:56 +03:00
block block-5.13-2021-05-14 2021-05-15 08:52:30 -07:00
bluetooth Networking changes for 5.13. 2021-04-29 11:57:23 -07:00
bus ARM: SoC drivers for v5.13 2021-04-26 12:11:52 -07:00
cdrom
char tpm: fix error return code in tpm2_get_cc_attrs_tbl() 2021-05-12 22:36:50 +03:00
clk clk: Skip clk provider registration when np is NULL 2021-05-11 08:47:25 +02:00
clocksource clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86 2021-05-14 14:55:13 +02:00
comedi staging: comedi: move out of staging directory 2021-04-15 09:26:25 +02:00
connector
counter
cpufreq Fix an idle CPU selection bug, and an AMD Ryzen maximum frequency enumeration bug. 2021-05-15 10:24:48 -07:00
cpuidle
crypto ARM: 2021-05-01 10:14:08 -07:00
cxl cxl/mem: Fix memory device capacity probing 2021-04-16 18:21:56 -07:00
dax
dca
devfreq
dio
dma dmaengine updates for v5.13-rc1 2021-05-04 11:24:46 -07:00
dma-buf
edac x86/msr: Rename MSR_K8_SYSCFG to MSR_AMD64_SYSCFG 2021-05-10 07:51:38 +02:00
eisa
extcon - Core Frameworks 2021-04-28 15:59:13 -07:00
firewire The usual updates from the irq departement: 2021-04-26 09:43:16 -07:00
firmware Assorted arm64 fixes and clean-ups, the most important: 2021-05-07 12:11:05 -07:00
fpga ARM: SoC drivers for v5.13 2021-04-26 12:11:52 -07:00
fsi
gnss
gpio gpio updates for v5.13 2021-05-05 12:39:29 -07:00
gpu Merge tag 'drm-msm-fixes-2021-05-09' of https://gitlab.freedesktop.org/drm/msm into drm-fixes 2021-05-15 06:52:15 +10:00
greybus greybus: es2: fix kernel-doc warnings 2021-04-16 07:26:50 +02:00
hid Merge branch 'for-5.13/warnings' into for-linus 2021-04-29 21:47:22 +02:00
hsi HSI: core: fix resource leaks in hsi_add_client_from_dt() 2021-04-16 00:14:49 +02:00
hv printk changes for 5.13 2021-04-27 18:09:44 -07:00
hwmon hwmon: (adm9240) Fix writes into inX_max attributes 2021-05-12 18:53:11 -07:00
hwspinlock
hwtracing ARM: 2021-05-01 10:14:08 -07:00
i2c Merge branch 'i2c/for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2021-04-30 13:01:02 -07:00
i3c Revert "i3c master: fix missing destroy_workqueue() on error in i3c_master_register" 2021-04-24 22:21:01 +02:00
ide
idle
iio iio: tsl2583: Fix division by a zero lux_val 2021-05-10 14:01:48 +01:00
infiniband block-5.13-2021-05-07 2021-05-07 11:35:12 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2021-05-06 23:37:55 -07:00
interconnect CFI on arm64 series for v5.13-rc1 2021-04-27 10:16:46 -07:00
iommu pci-v5.13-changes 2021-05-05 13:24:11 -07:00
ipack
irqchip ARM: 2021-05-01 10:14:08 -07:00
isdn proc: mandate ->proc_lseek in "struct proc_ops" 2021-05-06 19:24:11 -07:00
leds Nothing too exciting here, just some fixes. 2021-05-03 12:23:03 -07:00
lightnvm
macintosh macintosh/via-pmu: Fix build warning 2021-04-16 23:57:51 +10:00
mailbox - qcom: enable support for SM8350 and SC7280 2021-04-28 16:10:33 -07:00
mcb
md Merge branch 'akpm' (patches from Andrew) 2021-05-07 00:34:51 -07:00
media Merge branch 'akpm' (patches from Andrew) 2021-05-07 00:34:51 -07:00
memory .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
memstick memstick: r592: ignore kfifo_out() return code again 2021-04-26 11:08:23 +02:00
message
mfd - Core Frameworks 2021-04-28 15:59:13 -07:00
misc IOMMU Updates for Linux v5.13 2021-05-01 09:33:00 -07:00
mmc MMC core: 2021-04-28 15:56:51 -07:00
most Staging/IIO driver updates for 5.13-rc1 2021-04-26 11:14:21 -07:00
mtd This pull request contains changes for JFFS2, UBI and UBIFS 2021-05-04 18:08:40 -07:00
mux
net Networking fixes for 5.13-rc1, including fixes from bpf, can 2021-05-08 08:31:46 -07:00
nfc
ntb
nubus
nvdimm include: remove pagemap.h from blkdev.h 2021-05-06 19:24:11 -07:00
nvme nvmet: use new ana_log_size instead the old one 2021-05-13 16:33:32 +02:00
nvmem
of of: overlay: Remove redundant assignment to ret 2021-05-03 13:57:56 -05:00
opp
parisc
parport treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
pci PCI: Add sysfs "removable" attribute 2021-05-27 09:36:31 +02:00
pcmcia
perf ARM: 2021-05-01 10:14:08 -07:00
phy Networking changes for 5.13. 2021-04-29 11:57:23 -07:00
pinctrl linux/kconfig.h: replace IF_ENABLED() with PTR_IF() in <linux/kernel.h> 2021-05-09 00:29:45 +09:00
platform chrome platform changes for 5.13 2021-05-07 14:49:18 -07:00
pnp
power power supply and reset changes for the v5.13 series 2021-04-28 15:43:58 -07:00
powercap
pps TTY/Serial driver updates for 5.13-rc1 2021-04-26 11:20:10 -07:00
ps3
ptp ARM: 2021-05-01 10:14:08 -07:00
pwm pwm: Changes for v5.13-rc1 2021-05-05 12:53:16 -07:00
rapidio
ras
regulator - Core Frameworks 2021-04-28 15:59:13 -07:00
remoteproc remoteproc updates for v5.13 2021-05-04 11:13:33 -07:00
reset pci-v5.13-changes 2021-05-05 13:24:11 -07:00
rpmsg
rtc RTC for 5.13 2021-05-03 12:15:21 -07:00
s390 block-5.13-2021-05-07 2021-05-07 11:35:12 -07:00
sbus
scsi SCSI misc on 20210508 2021-05-08 10:44:36 -07:00
sh The usual updates from the irq departement: 2021-04-26 09:43:16 -07:00
siox
slimbus
soc IOMMU Updates for Linux v5.13 2021-05-01 09:33:00 -07:00
soundwire
spi sound updates for 5.13 2021-04-30 12:48:14 -07:00
spmi
ssb
staging staging: rtl8723bs: avoid bogus gcc warning 2021-05-10 14:26:24 +02:00
target SCSI misc on 20210508 2021-05-08 10:44:36 -07:00
tc
tee ARM: SoC drivers for v5.13 2021-04-26 12:11:52 -07:00
thermal - Remove duplicate error message for the amlogic driver (Tang Bin) 2021-05-05 12:46:48 -07:00
thunderbolt
tty tty: vt: always invoke vc->vc_sw->con_resize callback 2021-05-15 08:12:12 -07:00
uio
usb driver core: Move the "removable" attribute from USB to core 2021-05-27 09:36:31 +02:00
vdpa vDPA/ifcvf: get_config_size should return dev specific config size 2021-05-03 04:55:54 -04:00
vfio IOMMU Updates for Linux v5.13 2021-05-01 09:33:00 -07:00
vhost virtio,vhost,vdpa: features, fixes 2021-05-05 13:31:39 -07:00
video tty: vt: always invoke vc->vc_sw->con_resize callback 2021-05-15 08:12:12 -07:00
virt nitro_enclaves: Fix stale file descriptors on failed usercopy 2021-04-29 19:06:49 +02:00
virtio virtio_pci_modern: correct sparse tags for notify 2021-05-04 04:19:59 -04:00
visorbus
vlynq
vme
w1
watchdog - Core Frameworks 2021-04-28 15:59:13 -07:00
xen xen/swiotlb: check if the swiotlb has already been initialized 2021-05-14 15:52:11 +02:00
zorro
Kconfig staging: comedi: move out of staging directory 2021-04-15 09:26:25 +02:00
Makefile virtio,vhost,vdpa: features, fixes 2021-05-05 13:31:39 -07:00