mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] mm: memfd_luo: pick up seals added after preserve at freeze
@ 2026-11-28  7:24 Long Wei
  2026-11-28  7:24 ` [PATCH 1/2] " Long Wei
  2026-11-28  7:24 ` [PATCH 2/2] selftests/liveupdate: add seal-after-preserve kexec test Long Wei
  0 siblings, 2 replies; 3+ messages in thread
From: Long Wei @ 2026-11-28  7:24 UTC (permalink / raw)
  To: rppt, pasha.tatashin, pratyush
  Cc: shuah, akpm, linux-mm, kexec, linux-kernel, linux-kselftest,
	hewenliang4, Long Wei

A seal added to a memfd after the memfd was preserved with a liveupdate
session is accepted without any error, but the seal is silently gone once
the kexec handover is over: the retrieved memfd no longer has it.

memfd_luo_preserve() snapshots the file seals, but userspace may keep
operating on the memfd until the handover, so the preserve-time snapshot
is naturally incomplete.  memfd_luo_freeze() never re-read the seals and
memfd_luo_retrieve() replays the stale snapshot, so seals added in the
window between preserve() and kexec were dropped without any notice.

Patch 1 re-reads the seals at freeze time, mirroring the file position
handling: freeze is the last snapshot point before kexec and the only
place where the final value can still be sampled and, when it diverged
from the preserve-time snapshot, validated while the live update can
still be aborted.

Patch 2 adds a kexec round-trip selftest that adds F_SEAL_GROW after
preserve and asserts that the seal survives the handover.

Tested on arm64 and x86_64 with two consecutive kexec handovers each:
with the fix the seal survives and dmesg stays free of new warnings.

This series applies on the current next branch of liveupdate.git,
where the file is still named memfd_luo.c. I am aware of the
pending "mm: Rename memfd_luo to shmem_luo" series. If that series
lands first, a trivial s/memfd_luo/shmem_luo/ rebase will be needed,
which I am happy to provide.


Long Wei (2):
  mm: memfd_luo: pick up seals added after preserve at freeze
  selftests/liveupdate: add seal-after-preserve kexec test

 mm/memfd_luo.c                                |  27 ++-
 tools/testing/selftests/liveupdate/Makefile   |   1 +
 .../liveupdate/luo_seal_after_preserve.c      | 170 ++++++++++++++++++
 .../selftests/liveupdate/run-vmtests.sh       |   1 +
 4 files changed, 197 insertions(+), 2 deletions(-)
 create mode 100644 tools/testing/selftests/liveupdate/luo_seal_after_preserve.c

-- 
2.43.0


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

end of thread, other threads:[~2026-11-28  7:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-28  7:24 [PATCH 0/2] mm: memfd_luo: pick up seals added after preserve at freeze Long Wei
2026-11-28  7:24 ` [PATCH 1/2] " Long Wei
2026-11-28  7:24 ` [PATCH 2/2] selftests/liveupdate: add seal-after-preserve kexec test Long Wei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®