All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/5] liveupdate: serialization safety and race fixes
@ 2026-05-18 12:54 Pasha Tatashin
  2026-05-18 12:54 ` [PATCH v5 1/5] liveupdate: skip serialization for context-preserving kexec Pasha Tatashin
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Pasha Tatashin @ 2026-05-18 12:54 UTC (permalink / raw)
  To: rppt, sourabhjain, jbouron, akpm, bhe, linux-kernel,
	dan.carpenter, pasha.tatashin, rafael.j.wysocki, piliu, kexec,
	pratyush, skhawaja, graf, mario.limonciello

This series addresses several issues related to the synchronization
between the reboot process and LUO session management.

Changes in v5:
- Collected Acked-by from Mike Rapoport.
- In "block session mutations during reboot" (#3):
  - Moved down_read(&luo_session_serialize_rwsem) after luo_session_alloc()
    to minimize the critical section, and simplify cleanup.
  - Replaced scoped_guard() with explicit mutex_lock/unlock in
    luo_session_create() for consistency.

1. Skip LUO serialization for context-preserving kexec: A
preserve_context kexec returns to the current kernel, which is unrelated
to live update where state is passed to the next kernel. Skipping
serialization avoids unnecessary work and prevents sessions from being
left in a frozen state upon return.

2. Fix TOCTOU race in luo_session_retrieve(): Extend the rwsem lock
scope to prevent a session from being released between lookup and
mutex acquisition.

3. Block session mutations during reboot: During the reboot() syscall,
user processes may still be running concurrently and attempting to
mutate sessions. To prevent this, we introduce luo_session_serialize_rwsem.
All mutation operations (create, retrieve, release, ioctl) hold the
read lock. The serialization process holds the write lock indefinitely
on success, effectively freezing the subsystem.

4. Fix use-after-free in luo_file_unpreserve_files(): Reorder module_put()
to ensure the file handler module remains pinned while its operations
are being accessed during cleanup.

5. Remove unused ser field from struct luo_session: Clean up the
session structure by removing a field that was never utilized.

Tree: git.kernel.org/pub/scm/linux/kernel/git/tatashin/linux.git Branch:
luo-reboot-sync/v5

Pasha Tatashin (5):
  liveupdate: skip serialization for context-preserving kexec
  liveupdate: fix TOCTOU race in luo_session_retrieve()
  liveupdate: block session mutations during reboot
  liveupdate: fix u-a-f in luo_file_unpreserve_files() and
    luo_file_finish()
  liveupdate: Remove unused ser field from struct luo_session

 kernel/kexec_core.c              |  8 +++++---
 kernel/liveupdate/luo_file.c     |  5 +++--
 kernel/liveupdate/luo_internal.h |  2 --
 kernel/liveupdate/luo_session.c  | 35 ++++++++++++++++++++++++--------
 4 files changed, 34 insertions(+), 16 deletions(-)


base-commit: b1378127003b61930ce30064328640503ad3ef6d
-- 
2.53.0



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-05-27 20:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-18 12:54 [PATCH v5 0/5] liveupdate: serialization safety and race fixes Pasha Tatashin
2026-05-18 12:54 ` [PATCH v5 1/5] liveupdate: skip serialization for context-preserving kexec Pasha Tatashin
2026-05-18 12:54 ` [PATCH v5 2/5] liveupdate: fix TOCTOU race in luo_session_retrieve() Pasha Tatashin
2026-05-18 16:13   ` Pratyush Yadav
2026-05-18 12:54 ` [PATCH v5 3/5] liveupdate: block session mutations during reboot Pasha Tatashin
2026-05-18 16:31   ` Pratyush Yadav
2026-05-18 23:15     ` Pasha Tatashin
2026-05-22 12:52       ` Pratyush Yadav
2026-05-27 20:06         ` Pasha Tatashin
2026-05-18 12:54 ` [PATCH v5 4/5] liveupdate: fix u-a-f in luo_file_unpreserve_files() and luo_file_finish() Pasha Tatashin
2026-05-18 16:24   ` Pratyush Yadav
2026-05-18 12:54 ` [PATCH v5 5/5] liveupdate: Remove unused ser field from struct luo_session Pasha Tatashin
2026-05-18 16:24   ` Pratyush Yadav

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.