Why is that so complicated?
Why is that so complicated?
Posted Oct 27, 2025 23:28 UTC (Mon) by muase (subscriber, #178466)Parent article: BPF signing LSM hook change rejected
After all, at least in the beginning, BPF programs are just bytes? So why can't we just read the program from disk into (kernel) memory, validate the signature over this blob, and then do the magic afterwards (per-version translation, relocation, ...)?
AFAIK the problem is probably not new – with dylibs, relocatable linkage, jar-files or other jittery stuff, and app-bundles, you already have payloads that are modified during runtime in ways the signature cannot cover. The solution is usually that you sign the precursor, because every runtime modification is either done by the OS (=trusted), or by the executed code from the precursor itself (=trusted).
So – what am I missing here? Where is my error? :D
Posted Oct 28, 2025 8:37 UTC (Tue)
by taladar (subscriber, #68407)
[Link] (1 responses)
But yes, that was my first thought too, your approach seems much simpler as far as signature verification is concerned.
Posted Oct 28, 2025 11:55 UTC (Tue)
by daroc (editor, #160859)
[Link]
But there has also been some work toward doing relocations in the kernel without using BPF; this is still an evolving area, and I would not be terribly surprised to see more related patch sets (and arguments) in the future.
Posted Oct 28, 2025 16:11 UTC (Tue)
by aszs (subscriber, #50252)
[Link] (5 responses)
Posted Oct 28, 2025 18:47 UTC (Tue)
by mathstuf (subscriber, #69389)
[Link] (1 responses)
Posted Oct 28, 2025 20:21 UTC (Tue)
by aszs (subscriber, #50252)
[Link]
Posted Oct 29, 2025 12:33 UTC (Wed)
by hailfinger (subscriber, #76962)
[Link] (1 responses)
Posted Oct 30, 2025 10:00 UTC (Thu)
by taladar (subscriber, #68407)
[Link]
Posted Oct 30, 2025 10:32 UTC (Thu)
by jbarns231 (subscriber, #152627)
[Link]
Posted Oct 30, 2025 12:24 UTC (Thu)
by jejb (guest, #6654)
[Link]
Nothing ... that's how both proposed patch sets validate the code.. The complexity of light skeletons is that they consist of two sets of bpf instructions: a loader and a program the loader relocates. Once the loader has run, the program is fully relocated and can be executed. Both patches produce separate hashes of the loader and program and then sign that combined hash. The only difference, and the crux of the argument is what information the security_bpf_prog_load, which is called before any bpf code executes, LSM hook receives to make the policy determination. In KP's scheme the signature is over the loader which contains the hash of the program and which verifies that hash at loader run time, so the security hook knows if the loader signature verifies but not if the program hash matches. With the other patch set both hashes are checked before the hook is called.
Why is that so complicated?
Why is that so complicated?
Why is that so complicated?
Why is that so complicated?
Why is that so complicated?
Why is that so complicated?
"You may only run or load code which is part of the SBOM. The SBOM must be complete and signed off in advance." Admins may be obliged to desist from any ad-hoc patching of the kernel or userspace, including dynamically generated code.
Dynamically generated code also is very valuable for attackers because there is no guarantee that all such code is preserved (including timestamps for when the code was active) for forensic purposes. That may also be a strong motivation to prevent such use-cases.
Why is that so complicated?
Why is that so complicated?
Why is that so complicated?
