Re: [RFC PATCH v10 22/28] security: Add run LSM hooks
From: bot+bpf-ci
Date: Fri Dec 04 2026 - 23:02:27 EST
> security: Add run LSM hooks
TL;DR: Design question only: no LSM in the series sets lbs_runfd, so the
per-run security blob handling (alloc/free) looks unused. Could it wait until
a module needs it?
> diff --git a/security/security.c b/security/security.c
> --- a/security/security.c
> +++ b/security/security.c
[ ... ]
> +int security_runfd_alloc(struct run *run, unsigned int flags)
> +{
> + int rc;
> +
> + rc = lsm_blob_alloc(&run->security, blob_sizes.lbs_runfd,
> + GFP_KERNEL);
> + if (unlikely(rc))
> + return rc;
> +
This isn't a bug, but is there an LSM that will set .lbs_runfd?
No LSM in this series sets it (Landlock only registers runfd_share and
runfd_clone, and BPF LSM does not use composite blobs), so
blob_sizes.lbs_runfd stays 0 and run->security stays NULL.
Could the run->security blob handling (lbs_runfd, lsm_blob_alloc() here,
the kfree() in security_runfd_free()) wait until a module needs per-run
state?
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/47474652355