CSD lockup during kexec due to unbounded busy-wait in pl011_console_write_atomic (arm64)

Breno Leitao leitao at debian.org
Wed Nov 26 07:54:25 PST 2025


Hello Marco,

On Wed, Nov 26, 2025 at 03:54:26PM +0100, Marco Elver wrote:
> On Wed, 26 Nov 2025 at 15:13, Breno Leitao <leitao at debian.org> wrote:
> >         +static int kfence_reboot_callback(struct notifier_block *nb,
> >         +                                 unsigned long action, void *data)
> >         +{
> >         +       /* Disable KFENCE to avoid IPI synchronization during shutdown */
> >         +       WRITE_ONCE(kfence_enabled, false);
> >         +       /* Cancel any pending timer work */
> >         +       cancel_delayed_work_sync(&kfence_timer);
> >         +       return NOTIFY_OK;
> >         +}
> >         +
> >         +static struct notifier_block kfence_reboot_notifier = {
> >         +       .notifier_call = kfence_reboot_callback,
> >         +       .priority = INT_MAX, /* Run early to stop timers ASAP */
> >         +};
> 
> Just place it under the #ifdef CONFIG_KFENCE_STATIS_KEYS below, I do
> not think this is required if CONFIG_KFENCE_STATIC_KEYS is unset.

Ack. This is only needed for CONFIG_KFENCE_STATIC_KEYS, my bad.

> > Alexander, Marco and Kasan maintainers:
> >
> > What is the potential impact of disabling KFENCE during reboot
> > procedures?
> 
> But only if CONFIG_KFENCE_STATIC_KEYS is enabled?
> That would be reasonable, given our recommendation has been to disable
> CONFIG_KFENCE_STATIC_KEYS since
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4f612ed3f748962cbef1316ff3d323e2b9055b6e
> in most cases.
> 
> I believe some low-CPU count systems are still benefiting from it, but
> in general, I'd advise against it.

Thanks for your review and guidance.

Just to confirm my understanding: You’re okay with me adding this
notifier specifically for CONFIG_KFENCE_STATIC_KEYS (which is what
I need), but you would not support adding it for the general case where
!CONFIG_KFENCE_STATIC_KEYS, correct?

Thanks again,
--breno



More information about the linux-arm-kernel mailing list