Re: [PATCH v3 4/9] lsm: framework for BPF integrity verification

From
Song Liu <song@kernel.org>
Date
2026-03-27 18:25:06
Also in
bpf, linux-doc, lkml
Reply to
Blaise Boscaccy, 2026-03-27
On Fri, Mar 27, 2026 at 10:54 AM Blaise Boscaccy
[off-list ref] wrote:
Song Liu [off-list ref] writes:
quoted
On Wed, Mar 25, 2026 at 11:07 PM Blaise Boscaccy
[off-list ref] wrote:
[...]
quoted
The first new callback, bpf_prog_load_integrity(), located within the
security_bpf_prog_load() hook, is necessary to ensure that the integrity
verification callbacks are executed before any of the existing LSMs
are executed via the bpf_prog_load() callback.  Reusing the existing
bpf_prog_load() callback for integrity verification could result in LSMs
not having access to the integrity verification results when asked to
authorize the BPF program load in the bpf_prog_load() callback.

The new LSM hook, security_bpf_prog_load_post_integrity(), is intended
to be called from within LSMs performing BPF program integrity
verification.  It is used to report the verdict of the integrity
verification to other LSMs enforcing access control policy on BPF
program loads.  LSMs enforcing such access controls should register a
bpf_prog_load_post_integrity() callback to receive integrity verdicts.
bpf_prog_load_post_integrity() is weird. Some questions about it:

1. Is it possible to call it from other LSMs (not hornet)? Specifically, is it
   possible to call it from BPF LSM?
There is nothing hornet exclusive about that security hook. If the BPF
LSM folks wanted to use it they would probably need to implement a
kfunc to invoke it.
Please also include the kfunc in v4.

Thanks,
Song
Thread (16 messages) 16 messages, 4 authors, last reply 2026-03-31
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help