[PATCH 1/5] liveupdate: block outgoing session updates during reboot

Andrew Morton akpm at linux-foundation.org
Fri Mar 20 18:23:52 PDT 2026


On Fri, 20 Mar 2026 17:37:16 +0100 Oskar Gerlicz Kowalczuk <oskar at gerlicz.space> wrote:

> When kernel_kexec() starts a live update handover, LUO serializes
> outgoing sessions before the reboot path freezes tasks or shuts
> devices down. That leaves a window where close() and
> LIVEUPDATE_SESSION_PRESERVE_FD can still mutate an existing outgoing
> session after luo_session_serialize() has already captured it.
> 
> The race is dangerous because the next kernel may inherit stale file
> metadata or references to memory that userspace has already
> unpreserved. That breaks handover consistency and can later trigger
> restore failures on already torn down state.
> 
> Mark the outgoing session set as rebooting while serialization is in
> progress, reject new mutations with -EBUSY, and make release wait
> until rebooting finishes before unpreserving files. Reset the flag and
> wake waiters when serialization rolls back, and use READ_ONCE() and
> WRITE_ONCE() so the state is visible across CPUs.

Sashiko AI review has quite a few questions:
	https://sashiko.dev/#/patchset/20260320163720.100456-1-oskar@gerlicz.space



More information about the kexec mailing list