public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Firmware LSM hook
@ 2026-03-09 11:15 Leon Romanovsky
  2026-03-09 11:15 ` [PATCH 1/3] lsm: add hook for firmware command validation Leon Romanovsky
                   ` (3 more replies)
  0 siblings, 4 replies; 23+ messages in thread
From: Leon Romanovsky @ 2026-03-09 11:15 UTC (permalink / raw)
  To: Paul Moore, James Morris, Serge E. Hallyn, Leon Romanovsky,
	Jason Gunthorpe, Saeed Mahameed, Itay Avraham, Dave Jiang,
	Jonathan Cameron
  Cc: linux-security-module, linux-kernel, linux-rdma, Chiara Meiohas,
	Maher Sanalla, Edward Srouji

From Chiara:

This patch set introduces a new LSM hook to validate firmware commands
triggered by userspace before they are submitted to the device. The hook
runs after the command buffer is constructed, right before it is sent
to firmware.

The goal is to allow a security module to allow or deny a given command
before it is submitted to firmware. BPF LSM can attach to this hook
to implement such policies. This allows fine-grained policies for different
firmware commands. 

In this series, the new hook is called from RDMA uverbs and from the fwctl
subsystem. Both the uverbs and fwctl interfaces use ioctl, so an obvious
candidate would seem to be the file_ioctl hook. However, the userspace
attributes used to build the firmware command buffer are copied from
userspace (copy_from_user()) deep in the driver, depending on various
conditions. As a result, file_ioctl does not have the information required
to make a policy decision.

This newly introduced hook provides the command buffer together with relevant
metadata (device, command class, and a class-specific device identifier), so
security modules can distinguish between different command classes and devices.

The hook can be used by other drivers that submit firmware commands via a command
buffer.

Thanks

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
Chiara Meiohas (3):
      lsm: add hook for firmware command validation
      RDMA/mlx5: Invoke fw_validate_cmd LSM hook for DEVX commands
      fwctl/mlx5: Invoke fw_validate_cmd LSM hook for fwctl commands

 drivers/fwctl/mlx5/main.c         | 12 +++++++--
 drivers/infiniband/hw/mlx5/devx.c | 52 ++++++++++++++++++++++++++++++---------
 include/linux/lsm_hook_defs.h     |  2 ++
 include/linux/security.h          | 25 +++++++++++++++++++
 security/security.c               | 26 ++++++++++++++++++++
 5 files changed, 103 insertions(+), 14 deletions(-)
---
base-commit: 11439c4635edd669ae435eec308f4ab8a0804808
change-id: 20260309-fw-lsm-hook-7c094f909ffc

Best regards,
--  
Leon Romanovsky <leonro@nvidia.com>


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

end of thread, other threads:[~2026-03-11 19:16 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 11:15 [PATCH 0/3] Firmware LSM hook Leon Romanovsky
2026-03-09 11:15 ` [PATCH 1/3] lsm: add hook for firmware command validation Leon Romanovsky
2026-03-09 15:02   ` Jonathan Cameron
2026-03-09 15:25     ` Leon Romanovsky
2026-03-09 17:00   ` Dave Jiang
2026-03-09 11:15 ` [PATCH 2/3] RDMA/mlx5: Invoke fw_validate_cmd LSM hook for DEVX commands Leon Romanovsky
2026-03-09 15:10   ` Jonathan Cameron
2026-03-09 16:59   ` Dave Jiang
2026-03-09 11:15 ` [PATCH 3/3] fwctl/mlx5: Invoke fw_validate_cmd LSM hook for fwctl commands Leon Romanovsky
2026-03-09 15:12   ` Jonathan Cameron
2026-03-09 16:57   ` Dave Jiang
2026-03-09 18:32 ` [PATCH 0/3] Firmware LSM hook Paul Moore
2026-03-09 19:37   ` Leon Romanovsky
2026-03-09 23:10     ` Paul Moore
2026-03-10  9:07       ` Leon Romanovsky
2026-03-10 16:29         ` Stephen Smalley
2026-03-10 17:57           ` Leon Romanovsky
2026-03-10 18:24         ` Paul Moore
2026-03-10 19:30           ` Leon Romanovsky
2026-03-10 21:40             ` Paul Moore
2026-03-11  8:19               ` Leon Romanovsky
2026-03-11 16:06                 ` Paul Moore
2026-03-11 19:16                   ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox