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

Andrew Morton akpm at linux-foundation.org
Sat Mar 21 10:45:20 PDT 2026


On Sat, 21 Mar 2026 15:36:38 +0100 Oskar Gerlicz Kowalczuk <oskar at gerlicz.space> wrote:

> kernel_kexec() serializes outgoing sessions before the reboot path
> freezes tasks, so close() and session ioctls can still mutate a
> session while handover state is being prepared. The original v2 code
> also let incoming lookups keep a bare session pointer after dropping
> the list lock.
> 
> That leaves two correctness problems in the reboot path: outgoing state
> can change after serialization starts, and incoming sessions can be
> freed while another thread still holds a pointer to them.
> 
> Add refcounted session lifetime management, track in-flight outgoing
> close() paths with an atomic closing counter, and make serialization
> wait for closing to drain before setting rebooting. Reject phase-invalid
> ioctls, keep incoming release on a common cleanup path, and make the
> release wait freezable without spinning.

A [0/N] cover letter would be appropriate.

Please have a think about which patches should be backported into
-stable kernels.  Possibly "none", given how new LUO is.

If there are any backportable patches, please ensure that they are at
the start-of-series, or separate them out into a separate series,
against current mainline.

AI review hasn't completed yet, but it has things to say:
	https://sashiko.dev/#/patchset/20260321143642.166313-1-oskar@gerlicz.space



More information about the kexec mailing list