public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Andrei Vagin <avagin@google.com>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Kees Cook <kees@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Cyrill Gorcunov <gorcunov@gmail.com>,
	Mike Rapoport <rppt@kernel.org>,
	 Alexander Mikhalitsyn <alexander@mihalicyn.com>,
	linux-kernel@vger.kernel.org,  linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org, criu@lists.linux.dev,
	 Chen Ridong <chenridong@huawei.com>,
	Christian Brauner <brauner@kernel.org>,
	 David Hildenbrand <david@kernel.org>,
	Eric Biederman <ebiederm@xmission.com>,
	 Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	Michal Koutny <mkoutny@suse.com>,
	 Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>
Subject: Re: [PATCH 2/4] exec: inherit HWCAPs from the parent process
Date: Mon, 23 Mar 2026 11:19:24 -0700	[thread overview]
Message-ID: <CAEWA0a7s86fO_gezFRWGjXh5i0-=XAuo+7pqqf3CdWRX3kBwGg@mail.gmail.com> (raw)
In-Reply-To: <aec9c36d-d67a-4b61-9950-57b95afedf75@samsung.com>

On Fri, Mar 20, 2026 at 2:15 AM Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
>
> Hi,
>
> On 17.02.2026 19:01, Andrei Vagin wrote:
> > Introduces a mechanism to inherit hardware capabilities (AT_HWCAP,
> > AT_HWCAP2, etc.) from a parent process when they have been modified via
> > prctl.
> >
> > To support C/R operations (snapshots, live migration) in heterogeneous
> > clusters, we must ensure that processes utilize CPU features available
> > on all potential target nodes. To solve this, we need to advertise a
> > common feature set across the cluster.
> >
> > This patch adds a new mm flag MMF_USER_HWCAP, which is set when the
> > auxiliary vector is modified via prctl(PR_SET_MM, PR_SET_MM_AUXV).  When
> > execve() is called, if the current process has MMF_USER_HWCAP set, the
> > HWCAP values are extracted from the current auxiliary vector and stored
> > in the linux_binprm structure. These values are then used to populate
> > the auxiliary vector of the new process, effectively inheriting the
> > hardware capabilities.
> >
> > The inherited HWCAPs are masked with the hardware capabilities supported
> > by the current kernel to ensure that we don't report more features than
> > actually supported. This is important to avoid unexpected behavior,
> > especially for processes with additional privileges.
> >
> > Reviewed-by: Cyrill Gorcunov <gorcunov@gmail.com>
> > Reviewed-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>
> > Signed-off-by: Andrei Vagin <avagin@google.com>
>
> This patch landed in yesterday's linux-next as commit ac8c259ce0d5
> ("exec: inherit HWCAPs from the parent process"). In my tests I found
> that it causes regression on my Khadas VIM3L board, which is based
> on Amlogic Meson SM1 (S905D3) SoC
> (arch/arm64/boot/dts/amlogic/meson-sm1-khadas-vim3l.dts). Running init
> process fails after this patch:
>
> Freeing unused kernel memory: 13696K
> Run /sbin/init as init process
> Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
> CPU: 1 UID: 0 PID: 1 Comm: init Not tainted 7.0.0-rc4-next-20260319
> #12369 PREEMPT
> Hardware name: Khadas VIM3L (DT)
>
> What is probably important here, this board (for some internal,
> historical reasons) uses armv7l rootfs, but other boards used in my
> tests, based on different SoCs, also use such rootfs and boot fine with
> yesterday's linux-next. Reverting ac8c259ce0d5 commit (together with
> 0ea77bbf3b98 due to dependencies) on top of next-20260319 fixes this issue.


Hi Marek.

Thank you for the report. I’ve sent a new version of this series here:
https://patchew.org/linux/20260323175340.3361311-1-avagin@google.com/.
The reported issue should be fixed in this version. Could you please
give it a try?

Thanks,
Andrei


  parent reply	other threads:[~2026-03-23 18:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-17 18:01 [PATCH 0/4 v4] exec: inherit HWCAPs from the parent process Andrei Vagin
2026-02-17 18:01 ` [PATCH 1/4] binfmt_elf_fdpic: fix AUXV size calculation for ELF_HWCAP3 and ELF_HWCAP4 Andrei Vagin
2026-02-17 18:01 ` [PATCH 2/4] exec: inherit HWCAPs from the parent process Andrei Vagin
2026-03-20  9:15   ` Marek Szyprowski
2026-03-20 18:19     ` Kees Cook
2026-03-20 20:10       ` Andrei Vagin
2026-03-23 18:19     ` Andrei Vagin [this message]
2026-02-17 18:01 ` [PATCH 3/4] mm: synchronize saved_auxv access with arg_lock Andrei Vagin
2026-02-17 18:01 ` [PATCH 4/4] selftests/exec: add test for HWCAP inheritance Andrei Vagin
2026-02-23 18:29 ` [PATCH 0/4 v4] exec: inherit HWCAPs from the parent process Andrei Vagin
2026-02-23 22:28   ` Kees Cook
2026-03-10 18:17     ` Andrei Vagin
  -- strict thread matches above, loose matches on Subject: below --
2026-02-09 19:06 [PATCH 0/4 v3] " Andrei Vagin
2026-02-09 19:06 ` [PATCH 2/4] " Andrei Vagin
2026-02-10 20:13   ` Alexander Mikhalitsyn
2026-02-12 23:49   ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEWA0a7s86fO_gezFRWGjXh5i0-=XAuo+7pqqf3CdWRX3kBwGg@mail.gmail.com' \
    --to=avagin@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=aleksandr.mikhalitsyn@futurfusion.io \
    --cc=alexander@mihalicyn.com \
    --cc=brauner@kernel.org \
    --cc=chenridong@huawei.com \
    --cc=criu@lists.linux.dev \
    --cc=david@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=gorcunov@gmail.com \
    --cc=kees@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=m.szyprowski@samsung.com \
    --cc=mkoutny@suse.com \
    --cc=rppt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox