All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Add device filter support
@ 2021-09-30  1:05 Kuppuswamy Sathyanarayanan
  2021-09-30  1:05 ` [PATCH v2 1/6] driver core: Move the "authorized" attribute from USB/Thunderbolt to core Kuppuswamy Sathyanarayanan
                   ` (5 more replies)
  0 siblings, 6 replies; 132+ messages in thread
From: Kuppuswamy Sathyanarayanan @ 2021-09-30  1:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Borislav Petkov
  Cc: x86, Bjorn Helgaas, Thomas Gleixner, Ingo Molnar, Andreas Noever,
	Michael S . Tsirkin, Michael Jamet, Yehezkel Bernat,
	Rafael J . Wysocki, Mika Westerberg, Jonathan Corbet, Jason Wang,
	Dan Williams, Andi Kleen, Kuppuswamy Sathyanarayanan,
	linux-kernel, linux-pci, linux-usb, virtualization

Currently bus drivers like USB, Thunderbolt implement a custom
version of the device "authorize" support to selectively
allow/dis-allow device driver probing. This is used to avoid
attacks by untrusted devices on unhardened drivers (i.e. drivers that
do not expect malicious hardware). For confidential computing, like
Intel TDX, a similar policy is needed because a confidential guest
doesn't trust the host's devices. This patch kit attempts to unify the
support for both.

In the v1 version, we have submitted a proposal for a driver filter
framework. But Greg asked us not to re-invent the wheel and reuse the
authorized support from USB and Thunderbolt drivers. This patch series
fixes this issue. You can find v1 version and related discussion in the
following link
(https://lore.kernel.org/lkml/YQrXhnHJCsTxiRcP@casper.infradead.org/T/)

Please note that the following patches have dependency on TDX
patches [1] and Confidential Computing support patches  [2] from Tom
Landecky. Mainly, dependency lies in usage of functions like
tdx_early_init(), cc_platform_has(), etc. So they will be merged along
with other TDX patches via x86 tree. But we have included it here for
review and to give the complete picture on how device filter support
is used.

  x86/tdx: Add device filter support for x86 TDX guest platform
  PCI: Initialize authorized attribute for confidential guest
  virtio: Initialize authorized attribute for confidential guest

We are expecting to merge only following patches through the driver core
process.

  driver core: Move the "authorized" attribute from USB/Thunderbolt to
  core
  driver core: Add common support to skip probe for un-authorized
  devices
  driver core: Allow arch to initialize the authorized attribute

[1] - https://lore.kernel.org/lkml/20210916183550.15349-1-sathyanarayanan.kuppuswamy@linux.intel.com/
[2] - https://lkml.org/lkml/2021/9/28/1143

Changes since v1:
 * Unified authorized support in driver core and added support for device
   filter.
 * Included the authorized attribute use case support (TDX device filter support)
   in this patch series.

Kuppuswamy Sathyanarayanan (6):
  driver core: Move the "authorized" attribute from USB/Thunderbolt to
    core
  driver core: Add common support to skip probe for un-authorized
    devices
  driver core: Allow arch to initialize the authorized attribute
  virtio: Initialize authorized attribute for confidential guest
  x86/tdx: Add device filter support for x86 TDX guest platform
  PCI: Initialize authorized attribute for confidential guest

 arch/x86/include/asm/tdx.h      |  9 ++++++
 arch/x86/kernel/Makefile        |  2 +-
 arch/x86/kernel/cc_platform.c   | 20 ++++++++++++
 arch/x86/kernel/cpu/intel.c     |  1 +
 arch/x86/kernel/tdx-filter.c    | 56 +++++++++++++++++++++++++++++++++
 arch/x86/kernel/tdx.c           |  2 ++
 drivers/base/core.c             |  7 +++++
 drivers/base/dd.c               |  5 +++
 drivers/pci/probe.c             |  4 +++
 drivers/thunderbolt/domain.c    |  7 +++--
 drivers/thunderbolt/icm.c       |  9 +++---
 drivers/thunderbolt/switch.c    | 18 +++++------
 drivers/thunderbolt/tb.c        |  2 +-
 drivers/thunderbolt/tb.h        |  2 --
 drivers/usb/core/driver.c       |  3 +-
 drivers/usb/core/generic.c      |  2 +-
 drivers/usb/core/hub.c          |  8 ++---
 drivers/usb/core/message.c      |  2 +-
 drivers/usb/core/sysfs.c        |  3 +-
 drivers/usb/core/usb.c          | 10 +++++-
 drivers/virtio/virtio.c         |  9 ++++++
 include/linux/cc_platform.h     | 10 ++++++
 include/linux/device.h          | 16 +++++++++-
 include/linux/device/bus.h      |  4 +++
 include/linux/usb.h             |  6 ----
 include/uapi/linux/virtio_ids.h |  8 +++++
 26 files changed, 187 insertions(+), 38 deletions(-)
 create mode 100644 arch/x86/kernel/tdx-filter.c

-- 
2.25.1


^ permalink raw reply	[flat|nested] 132+ messages in thread

end of thread, other threads:[~2021-10-06  5:45 UTC | newest]

Thread overview: 132+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-30  1:05 [PATCH v2 0/6] Add device filter support Kuppuswamy Sathyanarayanan
2021-09-30  1:05 ` [PATCH v2 1/6] driver core: Move the "authorized" attribute from USB/Thunderbolt to core Kuppuswamy Sathyanarayanan
2021-09-30  1:42   ` Alan Stern
2021-09-30  1:42     ` Alan Stern
2021-09-30  1:55     ` Dan Williams
2021-09-30  1:55       ` Dan Williams
2021-09-30  2:38       ` Kuppuswamy, Sathyanarayanan
2021-09-30  4:59         ` Dan Williams
2021-09-30  4:59           ` Dan Williams
2021-09-30  9:05           ` Rafael J. Wysocki
2021-09-30  9:05             ` Rafael J. Wysocki
2021-09-30 14:59       ` Alan Stern
2021-09-30 14:59         ` Alan Stern
2021-09-30 15:25         ` Dan Williams
2021-09-30 15:25           ` Dan Williams
2021-09-30 11:19   ` Yehezkel Bernat
2021-09-30 15:28     ` Dan Williams
2021-09-30 15:28       ` Dan Williams
2021-09-30 18:25       ` Yehezkel Bernat
2021-09-30 19:04         ` Dan Williams
2021-09-30 19:04           ` Dan Williams
2021-09-30 19:50           ` Kuppuswamy, Sathyanarayanan
2021-09-30 20:23             ` Dan Williams
2021-09-30 20:23               ` Dan Williams
2021-09-30  1:05 ` [PATCH v2 2/6] driver core: Add common support to skip probe for un-authorized devices Kuppuswamy Sathyanarayanan
2021-09-30 10:59   ` Michael S. Tsirkin
2021-09-30 10:59     ` Michael S. Tsirkin
2021-09-30 13:52     ` Greg Kroah-Hartman
2021-09-30 13:52       ` Greg Kroah-Hartman
2021-09-30 14:38       ` Michael S. Tsirkin
2021-09-30 14:38         ` Michael S. Tsirkin
2021-09-30 14:49         ` Greg Kroah-Hartman
2021-09-30 14:49           ` Greg Kroah-Hartman
2021-09-30 15:00           ` Michael S. Tsirkin
2021-09-30 15:00             ` Michael S. Tsirkin
2021-09-30 15:22             ` Greg Kroah-Hartman
2021-09-30 15:22               ` Greg Kroah-Hartman
2021-09-30 17:17               ` Andi Kleen
2021-09-30 17:17                 ` Andi Kleen
2021-09-30 17:23                 ` Greg Kroah-Hartman
2021-09-30 17:23                   ` Greg Kroah-Hartman
2021-09-30 19:15                   ` Andi Kleen
2021-09-30 19:15                     ` Andi Kleen
2021-10-01  6:29                     ` Greg Kroah-Hartman
2021-10-01  6:29                       ` Greg Kroah-Hartman
2021-10-01 15:51                       ` Alan Stern
2021-10-01 15:51                         ` Alan Stern
2021-10-01 15:56                         ` Andi Kleen
2021-10-01 15:56                           ` Andi Kleen
2021-09-30 14:43       ` Alan Stern
2021-09-30 14:43         ` Alan Stern
2021-09-30 14:48         ` Michael S. Tsirkin
2021-09-30 14:48           ` Michael S. Tsirkin
2021-09-30 15:32           ` Alan Stern
2021-09-30 15:32             ` Alan Stern
2021-09-30 15:52             ` Michael S. Tsirkin
2021-09-30 15:52               ` Michael S. Tsirkin
2021-09-30 14:58         ` Michael S. Tsirkin
2021-09-30 14:58           ` Michael S. Tsirkin
2021-09-30 15:35           ` Alan Stern
2021-09-30 15:35             ` Alan Stern
2021-09-30 15:59             ` Michael S. Tsirkin
2021-09-30 15:59               ` Michael S. Tsirkin
2021-09-30 19:23               ` Andi Kleen
2021-09-30 19:23                 ` Andi Kleen
2021-09-30 20:44                 ` Alan Stern
2021-09-30 20:44                   ` Alan Stern
2021-09-30 20:52                   ` Dan Williams
2021-09-30 20:52                     ` Dan Williams
2021-10-01  1:41                     ` Alan Stern
2021-10-01  1:41                       ` Alan Stern
2021-10-01  2:20                       ` Dan Williams
2021-10-01  2:20                         ` Dan Williams
2021-09-30 21:12                   ` Andi Kleen
2021-09-30 21:12                     ` Andi Kleen
2021-09-30  1:05 ` [PATCH v2 3/6] driver core: Allow arch to initialize the authorized attribute Kuppuswamy Sathyanarayanan
2021-09-30  1:05 ` [PATCH v2 4/6] virtio: Initialize authorized attribute for confidential guest Kuppuswamy Sathyanarayanan
2021-09-30 11:03   ` Michael S. Tsirkin
2021-09-30 11:03     ` Michael S. Tsirkin
2021-09-30 13:36     ` Dan Williams
2021-09-30 13:36       ` Dan Williams
2021-09-30 13:49       ` Greg Kroah-Hartman
2021-09-30 13:49         ` Greg Kroah-Hartman
2021-09-30 15:18       ` Kuppuswamy, Sathyanarayanan
2021-09-30 15:20         ` Michael S. Tsirkin
2021-09-30 15:20           ` Michael S. Tsirkin
2021-09-30 15:23           ` Kuppuswamy, Sathyanarayanan
2021-09-30 15:23         ` Greg Kroah-Hartman
2021-09-30 15:23           ` Greg Kroah-Hartman
2021-09-30 19:04           ` Kuppuswamy, Sathyanarayanan
2021-09-30 19:16             ` Kuppuswamy, Sathyanarayanan
2021-09-30 19:30             ` Andi Kleen
2021-09-30 19:30               ` Andi Kleen
2021-09-30 19:40               ` Kuppuswamy, Sathyanarayanan
2021-10-01  7:03             ` Greg Kroah-Hartman
2021-10-01  7:03               ` Greg Kroah-Hartman
2021-10-01 15:49               ` Andi Kleen
2021-10-01 15:49                 ` Andi Kleen
2021-10-02 11:04                 ` Michael S. Tsirkin
2021-10-02 11:04                   ` Michael S. Tsirkin
2021-10-02 11:14                   ` Greg Kroah-Hartman
2021-10-02 11:14                     ` Greg Kroah-Hartman
2021-10-02 14:20                     ` Andi Kleen
2021-10-02 14:20                       ` Andi Kleen
2021-10-02 14:44                       ` Greg Kroah-Hartman
2021-10-02 14:44                         ` Greg Kroah-Hartman
2021-10-02 18:40                       ` Michael S. Tsirkin
2021-10-02 18:40                         ` Michael S. Tsirkin
2021-10-03  6:40                         ` Greg Kroah-Hartman
2021-10-03  6:40                           ` Greg Kroah-Hartman
2021-10-04 21:04                       ` Dan Williams
2021-10-04 21:04                         ` Dan Williams
2021-10-01 16:13               ` Dan Williams
2021-10-01 16:13                 ` Dan Williams
2021-10-01 16:45                 ` Alan Stern
2021-10-01 16:45                   ` Alan Stern
2021-10-01 18:09                   ` Dan Williams
2021-10-01 18:09                     ` Dan Williams
2021-10-01 19:00                     ` Alan Stern
2021-10-01 19:00                       ` Alan Stern
2021-10-01 19:45                       ` Kuppuswamy, Sathyanarayanan
2021-10-01 19:57                       ` Dan Williams
2021-10-01 19:57                         ` Dan Williams
2021-10-04  5:16                         ` Mika Westerberg
2021-10-05 22:33                           ` Dan Williams
2021-10-05 22:33                             ` Dan Williams
2021-10-06  5:45                             ` Greg Kroah-Hartman
2021-10-06  5:45                               ` Greg Kroah-Hartman
2021-09-30 19:25         ` Andi Kleen
2021-09-30 19:25           ` Andi Kleen
2021-09-30  1:05 ` [PATCH v2 5/6] x86/tdx: Add device filter support for x86 TDX guest platform Kuppuswamy Sathyanarayanan
2021-09-30  1:05 ` [PATCH v2 6/6] PCI: Initialize authorized attribute for confidential guest Kuppuswamy Sathyanarayanan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.