[PATCH 0/4] CRASH_ZEROIZE: Wipe secrets before kdump
Jan Sebastian Götte
linux at jaseg.de
Sat Aug 1 16:31:31 UTC 2026
Hi there,
On 8/1/26 16:03, Baoquan He wrote:
> On 07/31/26 at 05:46pm, Jan Sebastian Götte wrote:
>> Add CONFIG_CRASH_ZEROIZE (default off), which when enabled makes various
>> subsystems handling secret data do a quick, targeted wipe of these
>> secrets before kdump. This behavior might also be interesting in cases
>> where you run a normal kdump kernel but you still want to keep things
>> like fde crypto keys out of these dumps.
>
> Please check below patchset, you both seem to have the similar
> requirement. Please go there to discuss.
>
> [RFC PATCH 0/4] panic: a pre kdump notifier list for hypervisor upcalls
Thank you for the pointer. That's indeed similar, but I think this
patchset here makes sense as an independent patchset.
* The two notifier chains run at different points, and theirs runs
inside panic independent of kdump. This one here has to be run after
machine_crash_shutdown(), and so makes most sense inside
__crash_kexec(). The wipe code in this patchset must be one of the last
things to run before the kexec since the wiped data structures could
easily lead to problems if something tried using them later.
* I think this patch series here is a bit cleaner. I don't think this
needs a custom notifier implementation.
* Since there's lots of places that may need wiping after crash, I think
it makes sense to have an explicit notifier list for that purpose, and
to not mix these with other things like hypercalls. I think ordering is
important here: The wiping should be the last thing before the kexec
jump. Having it on a generic notifier chain risks that later, other
callbacks get added that when interleaved could cause problems.
* Since a good fraction of users may not care about wiping secrets, I
think it should be gated behind an explicit enable setting.
> Note that we usually dont' want to run a lot of work after panic and
> before jumping into kdump kernel.
I understand. For this reason, I think it's best to keep this
default-off. As-is, the notifier list call is timed and on the (slow)
ARM64 target I'm using, it takes about 3-5 ms to run. I took the "try
lock, skip if locked" approach to keep the risk of this code crashing
during panic minimal. In my application, the kdump payload is code that
then does a full wipe, taking a couple hundred milliseconds.
Let me know what you think.
More information about the Linux-security-module-archive
mailing list