public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Stephen Smalley <stephen.smalley.work@gmail.com>
Cc: Paul Moore <paul@paul-moore.com>,
	James Morris <jmorris@namei.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Itay Avraham <itayavr@nvidia.com>,
	Dave Jiang <dave.jiang@intel.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
	Chiara Meiohas <cmeiohas@nvidia.com>,
	Maher Sanalla <msanalla@nvidia.com>,
	Edward Srouji <edwards@nvidia.com>
Subject: Re: [PATCH 0/3] Firmware LSM hook
Date: Tue, 10 Mar 2026 19:57:59 +0200	[thread overview]
Message-ID: <20260310175759.GD12611@unreal> (raw)
In-Reply-To: <CAEjxPJ4nTmovpgkzC+3=Oh7EAhpi1vHLwJfjezu-vzX_Q2OCug@mail.gmail.com>

On Tue, Mar 10, 2026 at 12:29:40PM -0400, Stephen Smalley wrote:
> On Tue, Mar 10, 2026 at 5:14 AM Leon Romanovsky <leon@kernel.org> wrote:
> > 1140         MLX5_SET(general_obj_in_cmd_hdr, cmd_in, uid, uid);
> > 1141         err = security_fw_validate_cmd(cmd_in, cmd_in_len, &dev->ib_dev.dev,
> > 1142                                        FW_CMD_CLASS_UVERBS, RDMA_DRIVER_MLX5);
> > 1143         if (err)
> > 1144                 return err;
> > 1145
> > 1146         err = mlx5_cmd_do(dev->mdev, cmd_in, cmd_in_len, cmd_out, cmd_out_len);
> >
> > Could you point me to the LSM that would be best suited for performing
> > checks of this kind?
> 
> If you just want to filter on opcodes, then the SELinux extended
> permissions (xperms) support may suffice, see:
> https://blog.siphos.be/2017/11/selinux-and-extended-permissions/
> https://kernsec.org/files/lss2015/vanderstoep.pdf
> https://github.com/SELinuxProject/selinux-notebook/blob/main/src/xperm_rules.md
> 
> This was originally added to SELinux to support filtering ioctl
> commands and later extended to netlink as well.
> 
> If you truly need/want filtering of arbitrary variable-length command
> buffers.

Yes. The opcode alone is not sufficient for any real‑world use.  
It is not reliable because different firmware versions place different  
parameters into the same mailbox entry under the same opcode.  
Without inspecting the mailbox contents, you cannot properly filter them.

Thanks

  reply	other threads:[~2026-03-10 17:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260310175759.GD12611@unreal \
    --to=leon@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=cmeiohas@nvidia.com \
    --cc=dave.jiang@intel.com \
    --cc=edwards@nvidia.com \
    --cc=itayavr@nvidia.com \
    --cc=jgg@ziepe.ca \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=msanalla@nvidia.com \
    --cc=paul@paul-moore.com \
    --cc=saeedm@nvidia.com \
    --cc=serge@hallyn.com \
    --cc=stephen.smalley.work@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox