]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
liveupdate: block session mutations during reboot
authorPasha Tatashin <pasha.tatashin@soleen.com>
Wed, 27 May 2026 20:27:35 +0000 (20:27 +0000)
committerMike Rapoport (Microsoft) <rppt@kernel.org>
Mon, 1 Jun 2026 06:19:38 +0000 (09:19 +0300)
commitbb1328be35bf43c88288c5c31ceb45181b574c0c
tree3f11c38928fee8e3e2b45535cae08b886eca9aa3
parentd3ae9e7fddb4036f50003d7fa1ef52801fdb961b
liveupdate: block session mutations during reboot

During the reboot() syscall, user processes may still be running
concurrently and attempting to mutate sessions (e.g., creating,
retrieving, or releasing sessions). To prevent this, introduce
luo_session_serialize_rwsem to synchronize mutations with the
serialization process.

All session mutation operations (create, retrieve, release, ioctl) take
the read lock. The serialization process (luo_session_serialize) takes
the write lock and holds it indefinitely on success. This effectively
freezes the LUO session subsystem during the transition to the new
kernel. If serialization fails, the lock is released to allow recovery.

Fixes: 0153094d03df ("liveupdate: luo_session: add sessions support")
Reported-by: Oskar Gerlicz Kowalczuk <oskar@gerlicz.space>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Pratyush Yadav (Google) <pratyush@kernel.org>
Link: https://patch.msgid.link/20260527202737.1345192-4-pasha.tatashin@soleen.com
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
kernel/liveupdate/luo_session.c