lsm: give BPF programs a way to query locked_down state - #13318
lsm: give BPF programs a way to query locked_down state#13318kernel-patches-daemon-bpf[bot] wants to merge 2 commits into
Conversation
|
Upstream branch: d82ebfc |
AI reviewed your patch. Please fix the bug or email reply why it's not a bug. In-Reply-To-Subject: |
AI reviewed your patch. Please fix the bug or email reply why it's not a bug. In-Reply-To-Subject: |
|
Forwarding comment 5302139184 via email |
|
Forwarding comment 5302159272 via email |
a5710c4 to
233ffc0
Compare
|
Upstream branch: ce7c9f6 |
0f2dda2 to
de84581
Compare
233ffc0 to
5d19d61
Compare
|
Upstream branch: c93cbdb |
de84581 to
93b3738
Compare
5d19d61 to
7b509dc
Compare
|
Upstream branch: c93cbdb |
93b3738 to
ee683ab
Compare
7b509dc to
93097fe
Compare
|
Upstream branch: 8eb1892 |
ee683ab to
3662ee2
Compare
93097fe to
b51acce
Compare
|
Upstream branch: d99bda7 |
3662ee2 to
60f4d56
Compare
b51acce to
b27c6f9
Compare
|
Upstream branch: 34e0eb7 |
60f4d56 to
974bc13
Compare
b27c6f9 to
5d621a7
Compare
|
Upstream branch: 5fe7007 |
974bc13 to
0ed5a61
Compare
5d621a7 to
81e4232
Compare
|
Upstream branch: 77877bf |
0ed5a61 to
d123357
Compare
81e4232 to
f0e6afe
Compare
|
Upstream branch: adb7719 |
d123357 to
f9c9696
Compare
f0e6afe to
7ac20a0
Compare
|
Upstream branch: 6b0835a |
f9c9696 to
bb9e0c8
Compare
7ac20a0 to
fd7f5fa
Compare
|
Upstream branch: 6ab6a94 |
bb9e0c8 to
2f11d17
Compare
fd7f5fa to
23ff631
Compare
|
Upstream branch: 3d9393f |
2f11d17 to
e9853f7
Compare
23ff631 to
530113d
Compare
|
Upstream branch: f79066c |
Add a new kfunc bpf_security_locked_down, which calls security_locked_down and returns the result. Create a new file security/lsm_kfuncs.c for LSM framework kfuncs. Reject reasons outside (LOCKDOWN_NONE, LOCKDOWN_CONFIDENTIALITY_MAX) with -EINVAL before dispatching the hook. Limit the kfunc to BPF_PROG_TYPE_LSM and BPF_PROG_TYPE_SYSCALL programs, and refuse it to programs attached to the locked_down hook itself, which would recurse into the dispatch. Signed-off-by: Justin Suess <utilityemal77@gmail.com>
Test the bpf_security_locked_down() kfunc. An LSM program attached to the locked_down hook denies LOCKDOWN_HIBERNATION, so a syscall program querying the kfunc observes both verdicts deterministically without touching real lockdown state: 0 for LOCKDOWN_KEXEC and -EPERM for LOCKDOWN_HIBERNATION. Out-of-range reasons must return -EINVAL. Programs in denied calling contexts (a tracing program, and an LSM program attached to the locked_down hook itself) must be rejected at load time by the kfunc filter. The selftest config guarantees the verdicts are stable: the bpf LSM is in CONFIG_LSM and the lockdown LSM is not, so the kernel cannot already be locked down. Signed-off-by: Justin Suess <utilityemal77@gmail.com>
e9853f7 to
9b2d907
Compare
Pull request for series with
subject: lsm: give BPF programs a way to query locked_down state
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1146486