Re: [PATCH v2 3/3] liveupdate: block outgoing session mutations
From: Pasha Tatashin
Date: Mon May 11 2026 - 09:46:28 EST
On 05-11 13:03, Pratyush Yadav wrote:
> On Wed, May 06 2026, Pasha Tatashin wrote:
>
> > During the reboot() syscall, user processes may still be running
> > concurrently and attempting to mutate sessions (e.g., adding files or
> > closing sessions). To prevent this, hold the session header's rwsem and
> > each session's mutex indefinitely on successful serialization.
> >
> > If serialization succeeds, these locks will never be released as the
> > system transitions to the new kernel, effectively blocking any
> > concurrent task attempting to modify or release a session. If
> > liveupdate_reboot() fails, the locks are released in the error path,
> > allowing normal operation to resume.
> >
> > Fixes: 0153094d03df ("liveupdate: luo_session: add sessions support")
> > Reported-by: Oskar Gerlicz Kowalczuk <oskar@gerlicz.space>
> > Signed-off-by: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx>
>
> Reviewed-by: Pratyush Yadav (Google) <pratyush@xxxxxxxxxx>
Sashiko also provided a good comment about this patch: We run over
MAX_LOCK_DEPTH limit with this patch. I am going to refactor to not take
every session lock simultaneously during serialization.
>
> [...]
>
> --
> Regards,
> Pratyush Yadav