From: "Michal Koutný" <mkoutny@suse.com>
To: Andrei Vagin <avagin@google.com>
Cc: Kees Cook <kees@kernel.org>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org, criu@lists.linux.dev,
Andrew Morton <akpm@linux-foundation.org>,
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>
Subject: Re: [PATCH 2/3] exec: inherit HWCAPs from the parent process
Date: Wed, 14 Jan 2026 22:25:11 +0100 [thread overview]
Message-ID: <sp5yxpqi62ymfhjysggmuvxxcwsxtz5kthu64h6kr2poymesbd@3tjqlq7z372p> (raw)
In-Reply-To: <CAEWA0a4s+Uhm405CnvNsE61ed5_xJ8PUZqL74zfeZnivw1BChA@mail.gmail.com>
On Mon, Jan 12, 2026 at 02:18:18PM -0800, Andrei Vagin <avagin@google.com> wrote:
> It is true for all existing arch-es. I can't imagine why we would want to
> define ELF_HWCAP{n+1} without having ELF_HWCAP{n}. If you think we need
> to handle this case, I can address it in the next version.
>
> It is just a small optimization to stop iterating after handling all
> entries. The code will work correctly even when HWCAP n+1 exists but n
> doesn't.
Indeed (I accidentally ignored the AT_VECTOR_SIZE condition), it turns
out no big deal then.
I like that it's not needlessly searched (and copied altogether).
> The inherit_hwcap function is only called if MMF_USER_HWCAP is set (auxv was
> modified via prctl). However, even if mm->saved_auxv hasn't been
> modified, it still contains valid values.
Hm, bprm_mm_init/mm_alloc/mm_init would tranfser the flag from
current, I'm still unclear whether it is necessary here. (It should make
no harm though.)
saved_auxv validity seems OK then.
One more thing came up to my mind -- synchronization between prctl'ing
and exec'ing threads (I see de_thread() is relatively late after
bprm__mm_init()).
Thanks,
Michal
next prev parent reply other threads:[~2026-01-14 21:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-08 5:07 [PATCH 0/3 v2] " Andrei Vagin
2026-01-08 5:07 ` [PATCH 1/3] binfmt_elf_fdpic: fix AUXV size calculation for ELF_HWCAP3 and ELF_HWCAP4 Andrei Vagin
2026-01-08 11:31 ` Mark Brown
2026-01-12 12:38 ` Michal Koutný
2026-01-08 5:07 ` [PATCH 2/3] exec: inherit HWCAPs from the parent process Andrei Vagin
2026-01-12 12:46 ` Michal Koutný
2026-01-12 21:56 ` Andrei Vagin
2026-01-12 22:18 ` Andrei Vagin
2026-01-14 21:25 ` Michal Koutný [this message]
2026-01-08 5:07 ` [PATCH 3/3] selftests/exec: add test for HWCAP inheritance Andrei Vagin
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=sp5yxpqi62ymfhjysggmuvxxcwsxtz5kthu64h6kr2poymesbd@3tjqlq7z372p \
--to=mkoutny@suse.com \
--cc=akpm@linux-foundation.org \
--cc=avagin@google.com \
--cc=brauner@kernel.org \
--cc=chenridong@huawei.com \
--cc=criu@lists.linux.dev \
--cc=david@kernel.org \
--cc=ebiederm@xmission.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 \
/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