[PATCH v1 3/3] liveupdate: pin sessions and handle inactive ones during serialization

Pratyush Yadav pratyush at kernel.org
Wed May 6 01:53:34 PDT 2026


On Wed, May 06 2026, Pasha Tatashin wrote:

> During the reboot() syscall, user processes are still running
> concurrently. Even though the system is actively serializing LUO
> sessions and will not return to userspace unless liveupdate_reboot()
> fails, it is still possible for a user process to close a preserved LUO
> session. This creates a race condition where a session could be
> destroyed while it is being serialized.
>
> To fix this, we must ensure that we only preserve sessions that are not
> closed at the time of serialization. Take a reference to the session's
> struct file for all outgoing sessions to pin them during this process.
>
> Handle inactive sessions (where get_file_active() fails) by cleaning
> them up and removing them from the outgoing list during the pinning
> phase. This ensures serialization can safely proceed with the remaining
> active sessions.
>
> Fixes: 0153094d03df ("liveupdate: luo_session: add sessions support")
> Reported-by: Oskar Gerlicz Kowalczuk <oskar at gerlicz.space>
> Signed-off-by: Pasha Tatashin <pasha.tatashin at soleen.com>

Same here. If we hold the session header and session locks, we don't
have to worry about all these corner cases. It is too late to touch the
session once liveupdate_reboot() starts, and if you try you just get put
to sleep.

[...]

-- 
Regards,
Pratyush Yadav



More information about the kexec mailing list