public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/3] liveupdate: prevent double preservation
@ 2026-03-26 16:39 Pasha Tatashin
  2026-03-26 16:39 ` [PATCH v4 1/3] liveupdate: prevent double management of files Pasha Tatashin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Pasha Tatashin @ 2026-03-26 16:39 UTC (permalink / raw)
  To: linux-kselftest, rppt, shuah, akpm, linux-mm, linux-kernel,
	pasha.tatashin, dmatlack, pratyush, skhawaja

Currently, LUO does not prevent the same file from being managed twice
across different active sessions.

Because LUO preserves files of absolutely different types: memfd, and
upcoming vfiofd [1], iommufd [2], guestmefd (and possible kvmfd/cpufd).
There is no common private data or guarantee on how to prevent that the
same file is not preserved twice beside using inode or some slower and
expensive method like hashtables.

[1] https://lore.kernel.org/all/20260129212510.967611-1-dmatlack@google.com
[2] https://lore.kernel.org/all/20260203220948.2176157-1-skhawaja@google.com

Changelog:
v4:
 - Added get_id() callback to struct liveupdate_file_ops to allow handlers
   to define unique identification for files (e.g. via inode).
 - Implemented get_id() for memfd_luo to use the inode pointer.

Pasha Tatashin (3):
  liveupdate: prevent double management of files
  memfd: implement get_id for memfd_luo
  selftests: liveupdate: add test for double preservation

 include/linux/liveupdate.h                      |  2 ++
 kernel/liveupdate/luo_file.c                    | 32 ++++++++++++++++++++++++++++++--
 mm/memfd_luo.c                                  |  6 ++++++
 tools/testing/selftests/liveupdate/liveupdate.c | 41 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 79 insertions(+), 2 deletions(-)

Pasha Tatashin (3):
  liveupdate: prevent double management of files
  memfd: implement get_id for memfd_luo
  selftests: liveupdate: add test for double preservation

 include/linux/liveupdate.h                    |  2 +
 kernel/liveupdate/luo_file.c                  | 32 ++++++++++++++-
 mm/memfd_luo.c                                |  6 +++
 .../testing/selftests/liveupdate/liveupdate.c | 41 +++++++++++++++++++
 4 files changed, 79 insertions(+), 2 deletions(-)


base-commit: 0138af2472dfdef0d56fc4697416eaa0ff2589bd
-- 
2.43.0


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

end of thread, other threads:[~2026-04-03 18:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-26 16:39 [PATCH v4 0/3] liveupdate: prevent double preservation Pasha Tatashin
2026-03-26 16:39 ` [PATCH v4 1/3] liveupdate: prevent double management of files Pasha Tatashin
2026-03-26 16:39 ` [PATCH v4 2/3] memfd: implement get_id for memfd_luo Pasha Tatashin
2026-04-03 18:32   ` Pratyush Yadav
2026-03-26 16:39 ` [PATCH v4 3/3] selftests: liveupdate: add test for double preservation Pasha Tatashin

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