[PATCH v2 0/2] liveupdate: prevent double preservation

From: Pasha Tatashin

Date: Mon Mar 23 2026 - 16:35:56 EST


Currently, LUO does not prevent the same file from being preserved 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@xxxxxxxxxx
[2] https://lore.kernel.org/all/20260203220948.2176157-1-skhawaja@xxxxxxxxxx

Changelog:
v2:
- Because inodes of preserved files can be shared, we cannot rely on a
flag in the inode. Therefore, use an xarray to prevent preserving
duplicated files.

Pasha Tatashin (2):
liveupdate: prevent double management of files
selftests: liveupdate: add test for double preservation

kernel/liveupdate/luo_file.c | 17 +++++++-
.../testing/selftests/liveupdate/liveupdate.c | 41 +++++++++++++++++++
2 files changed, 56 insertions(+), 2 deletions(-)

--
2.43.0