[PATCH v2 0/2] liveupdate: Add LIVEUPDATE_SESSION_FREEZE ioctl
From: Pasha Tatashin
Date: Tue Oct 20 2026 - 10:48:11 EST
Currently, LUO sessions are frozen automatically only inside the
reboot(LINUX_REBOOT_CMD_KEXEC) path, where luo_session_serialize()
iterates through all outgoing sessions under global write locks and
freezes them serially during shutdown.
This series introduces the LIVEUPDATE_SESSION_FREEZE ioctl on session
file descriptors so userspace can freeze a session as soon as it is done
with it, rather than delaying until auto-freeze at kexec time. Because
luo_session_freeze() only acquires the per-session mutex, userspace can
also freeze multiple sessions concurrently in advance, reducing kexec
blackout time.
Once frozen, no further files can be preserved in the session and
subsequent freeze attempts return -EBUSY (or -EINVAL on incoming
sessions). During kexec, already-frozen sessions skip the late
auto-freeze step; if an early-frozen session is closed before kexec, its
files are rolled back via .unfreeze() before being unpreserved.
This series is based on liveupdate/next commit 27be83a12b24 ("Merge
branch 'lu-pci-preservation' into next").
Changelog:
v2:
- Rebased onto liveupdate/next (commit 27be83a12b24 ("Merge branch
'lu-pci-preservation' into next")) and split out early session freeze
into a standalone series (tmpfs preservation and its per-file user
argument plumbing were spun out into a separate series).
- Patch 1:
- Drop struct luo_file_set_ser * from luo_file_freeze() and
luo_file_unfreeze(), and rename the session helpers to
luo_session_serialize_one() / luo_session_unserialize_one() so all
of struct luo_session_ser is populated and cleared in one place
(Suggested by Pratyush Yadav).
- Unfreeze the session's files if luo_ucmd_respond() fails in
luo_session_freeze().
- Update remaining reboot-only wording in luo_file.c kernel-doc
comments.
- Patch 2:
- Add checks verifying that non-zero reserved bits and freezing an
incoming post-kexec session fail with -EINVAL.
Link: https://lore.kernel.org/all/20261015093816.2438942-1-pasha.tatashin@xxxxxxxxxx/ # v1
Pasha Tatashin (2):
liveupdate: Add LIVEUPDATE_SESSION_FREEZE ioctl to freeze sessions
early
selftests: liveupdate: Add tests for LIVEUPDATE_SESSION_FREEZE
include/linux/liveupdate.h | 3 +-
include/uapi/linux/liveupdate.h | 25 ++++++
kernel/liveupdate/luo_file.c | 73 ++++++++---------
kernel/liveupdate/luo_internal.h | 9 +-
kernel/liveupdate/luo_session.c | 82 +++++++++++++++----
mm/memfd_luo.c | 5 +-
.../liveupdate/lib/include/libliveupdate.h | 1 +
.../selftests/liveupdate/lib/lu_utils.c | 10 +++
.../testing/selftests/liveupdate/liveupdate.c | 49 +++++++++++
.../selftests/liveupdate/luo_kexec_simple.c | 8 ++
10 files changed, 202 insertions(+), 63 deletions(-)
base-commit: 27be83a12b246b6b3783e7d3ac5c378ff7520f25
--
2.56.0.212.g129ede20d9-goog