lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aVPwDdUpNTZ7gUT7@kernel.org>
Date: Tue, 30 Dec 2025 17:30:21 +0200
From: Mike Rapoport <rppt@...nel.org>
To: Pasha Tatashin <pasha.tatashin@...een.com>
Cc: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, pratyush@...nel.org
Subject: Re: [PATCH v2] liveupdate: separate memfd support into
 LIVEUPDATE_MEMFD

On Tue, Dec 30, 2025 at 09:53:21AM -0500, Pasha Tatashin wrote:
> Decouple memfd preservation support from the core Live Update
> Orchestrator configuration.
> 
> Previously, enabling CONFIG_LIVEUPDATE forced a dependency on
> CONFIG_SHMEM and unconditionally compiled memfd_luo.o. However, Live
> Update may be used for purposes that do not require memfd-backed memory
> preservation.
> 
> Introduce CONFIG_LIVEUPDATE_MEMFD to gate memfd_luo.o. This moves the
> SHMEM and MEMFD_CREATE dependencies to the specific feature that needs
> them, allowing the base LIVEUPDATE option to be selected independently
> of shared memory support.
> 
> Signed-off-by: Pasha Tatashin <pasha.tatashin@...een.com>
> Reviewed-by: Pratyush Yadav <pratyush@...nel.org>
> ---
> Changes v2:
> - Updated testing config
> - Added review-by
> 
>  kernel/liveupdate/Kconfig                 | 16 +++++++++++++++-
>  mm/Makefile                               |  2 +-
>  tools/testing/selftests/liveupdate/config |  1 +
>  3 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/liveupdate/Kconfig b/kernel/liveupdate/Kconfig
> index d2aeaf13c3ac..9a1a8cdcf16c 100644
> --- a/kernel/liveupdate/Kconfig
> +++ b/kernel/liveupdate/Kconfig
> @@ -54,7 +54,6 @@ config KEXEC_HANDOVER_ENABLE_DEFAULT
>  config LIVEUPDATE
>  	bool "Live Update Orchestrator"
>  	depends on KEXEC_HANDOVER
> -	depends on SHMEM
>  	help
>  	  Enable the Live Update Orchestrator. Live Update is a mechanism,
>  	  typically based on kexec, that allows the kernel to be updated
> @@ -73,4 +72,19 @@ config LIVEUPDATE
>  
>  	  If unsure, say N.
>  
> +config LIVEUPDATE_MEMFD
> +	bool "Live update support for memfd"
> +	depends on LIVEUPDATE
> +	depends on MEMFD_CREATE
> +	depends on SHMEM

Maybe also

	default LIVEUPDATE 

> +	help
> +	  Enable live update support for memfd regions. This allows preserving
> +	  memfd-backed memory across kernel live updates.
> +
> +	  This can be used to back VM memory with memfds, allowing the guest
> +	  memory to persist, or for other user workloads needing to preserve
> +	  pages.
> +
> +	  If unsure, say N.
> +
>  endmenu
> diff --git a/mm/Makefile b/mm/Makefile
> index 9175f8cc6565..798f04233d71 100644
> --- a/mm/Makefile
> +++ b/mm/Makefile
> @@ -100,7 +100,7 @@ obj-$(CONFIG_NUMA) += memory-tiers.o
>  obj-$(CONFIG_DEVICE_MIGRATION) += migrate_device.o
>  obj-$(CONFIG_TRANSPARENT_HUGEPAGE) += huge_memory.o khugepaged.o
>  obj-$(CONFIG_PAGE_COUNTER) += page_counter.o
> -obj-$(CONFIG_LIVEUPDATE) += memfd_luo.o
> +obj-$(CONFIG_LIVEUPDATE_MEMFD) += memfd_luo.o
>  obj-$(CONFIG_MEMCG_V1) += memcontrol-v1.o
>  obj-$(CONFIG_MEMCG) += memcontrol.o vmpressure.o
>  ifdef CONFIG_SWAP
> diff --git a/tools/testing/selftests/liveupdate/config b/tools/testing/selftests/liveupdate/config
> index 91d03f9a6a39..1bfc708041bd 100644
> --- a/tools/testing/selftests/liveupdate/config
> +++ b/tools/testing/selftests/liveupdate/config
> @@ -5,6 +5,7 @@ CONFIG_KEXEC_HANDOVER_ENABLE_DEFAULT=y
>  CONFIG_KEXEC_HANDOVER_DEBUGFS=y
>  CONFIG_KEXEC_HANDOVER_DEBUG=y
>  CONFIG_LIVEUPDATE=y
> +CONFIG_LIVEUPDATE_MEMFD=y

then this is not needed :)

>  CONFIG_LIVEUPDATE_TEST=y
>  CONFIG_MEMFD_CREATE=y
>  CONFIG_TMPFS=y
> -- 
> 2.52.0.351.gbe84eed79e-goog
> 

-- 
Sincerely yours,
Mike.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ