On Fri, May 08, 2026 at 12:26:45PM -0400, Mathieu Desnoyers wrote:
On 2026-05-08 12:23, Sasha Levin wrote:
On Fri, May 08, 2026 at 12:18:28PM -0400, Mathieu Desnoyers wrote:
On 2026-05-08 12:13, Sasha Levin wrote:
[...]
One possible approach to prevent "footgun" type of killswitch use would
be to first apply a statistics collection killswitch handler that does
not change the behavior: it checks whether the target function is
invoked at all on the system for a given period of time. Then it applies
the killswitch if it was not invoked during that period. Overall
sequence:

- pre-soak killswitch for e.g. 30s, checking whether the function is
 invoked at all. (period would be user-configurable)
- if no calls were detected, engage killswitch, else report failure to
 the user.

This should prevent footguns such as trying to killswitch fork, malloc
or other core functions which are inherently required.

Why not just use our good old tracing infra? Set tracepoints where ever you want, collect any data you might need, and engage the killswitch when you're
happy with the data you have?

It feels a bit weird adding something like this into killswitch.

It really depends on whether you want to include some basic safety nets
directly within killswitch, or leave that entirely to the end user.

I don't have a strong opinion either way. I was just pointing out the
feasibility of a pre-soak sanity check before applying the killswitch.

What about doing this with some userspace tooling (maybe under scripts/) to
facilitate this?


That could work, although it requires additional infrastructure to be in
place (tracing) on production environments, which may not be the case
everywhere. In comparison, if the sanity check is done within
killswitch, you only need killswitch and kprobe to be compiled into
the production system, which is more lightweight.

So CONFIG_KPROBES but no CONFIG_KPROBES_EVENTS or BPF?

This sounds like a pretty small crowd :)

I think it makes sense to document/script a workflow around tracing or
bpftrace, but I don't think it's worth adding all that logic in the kernel.

I'd also note that you can always reverse the killswitch if you observe issues.

--
Thanks,
Sasha

Reply via email to