[PATCH v2 0/2] kho: fixes for kho_init() failures
From: Chris Down
Date: Sat Nov 28 2026 - 04:21:54 EST
When kho_init() fails on a KHO boot, its error path frees the bootmem
areas that were inherited from the previous kernel, even though the
running kernel was loaded into them and is still using them. The new
kernel then oopses in kho_init() and panics.
The easiest way to get there turned out to be debugfs=off. With
CONFIG_KEXEC_HANDOVER_DEBUGFS=y, kho_init() fails when it can't create
its debugfs entries, so a KHO kexec into a kernel with debugfs disabled
is enough to hit the panic. That's a bug in its own right, because it
means KHO and LUO can't be used at all on a kernel that has debugfs
disabled, although nothing in KHO needs debugfs any more.
This series stops the error path from freeing bootmem areas that it
didn't reserve, and stops kho_init() from failing when debugfs is
disabled.
v2:
- Use is_kho_boot() instead of checking fdt (Mike)
- Say who reserves the bootmem areas on each kind of boot (Mike)
- Describe how to trigger it and add the oops (Mike)
- Add a patch so that kho_init() doesn't fail when debugfs is disabled
- Rebase onto liveupdate/fixes
v1: https://lore.kernel.org/r/au_vQhHAcJbkryXN@xxxxxxxxxxxxxx
Chris Down (2):
kho: don't release incoming bootmem areas when kho_init() fails
kho: don't fail kho_init() when debugfs is disabled
kernel/liveupdate/kexec_handover.c | 19 ++++++++-----------
kernel/liveupdate/kexec_handover_debugfs.c | 19 +++++++++++--------
kernel/liveupdate/kexec_handover_internal.h | 8 ++++----
3 files changed, 23 insertions(+), 23 deletions(-)
base-commit: fa1c0f103fd68558613d3df76e222463c6e4fc37
--
2.56.1