On Tue, Nov 16, 2021 at 11:00:23AM -0800, Casey Schaufler wrote:
On 11/16/2021 10:41 AM, Kees Cook wrote:Yeah, that is what I was thinking. This would give the LSM a view into
On Tue, Nov 16, 2021 at 12:12:16PM +0300, Alexander Popov wrote:Do you really want to make error handling a "security" issue?
What if the Linux kernel had a LSM module responsible for error handling policy?That would solve the "atomicity" issue the WARN tracepoint solution has,
That would require adding LSM hooks to BUG*(), WARN*(), KERN_EMERG, etc.
In such LSM policy we can decide immediately how to react on the kernel error.
We can even decide depending on the subsystem and things like that.
and it would allow for very flexible userspace policy.
I actually wonder if the existing panic_on_* sites should serve as a
guide for where to put the hooks. The current sysctls could be replaced
by the hooks and a simple LSM.
If you add security_bug(), security_warn_on() and the like
you're begging that they be included in SELinux (AppArmor) policy.
BPF, too, come to think of it. Is that what you want?
kernel state, which seems a reasonable thing to do. If system integrity
is compromised, an LSM may want to stop trusting things.
A dedicated error-handling LSM could be added for those hooks that
implemented the existing default panic_on_* sysctls, and could expand on
that logic for other actions.