From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5C3501099B33 for ; Fri, 20 Mar 2026 18:19:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AAC466B009D; Fri, 20 Mar 2026 14:19:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A5C6E6B00A6; Fri, 20 Mar 2026 14:19:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 94B576B00BD; Fri, 20 Mar 2026 14:19:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 7FD1F6B009D for ; Fri, 20 Mar 2026 14:19:30 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 322F1584C8 for ; Fri, 20 Mar 2026 18:19:30 +0000 (UTC) X-FDA: 84567254100.11.08F3FA1 Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf19.hostedemail.com (Postfix) with ESMTP id 456951A0010 for ; Fri, 20 Mar 2026 18:19:28 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=cet4N38q; spf=pass (imf19.hostedemail.com: domain of kees@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=kees@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1774030768; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=fAqmIpfQANEAuEJCQspIG3/xHFA3afWxbUMTE97V27Y=; b=JsIuNzIwv0UT9xoU2Nv082UP9QW4rtTRiA6RRYsXbGEvOhJ8zJopC59dxJmLd0KYkv4P1l 5KH0DTSVUYkx+0e/umeH/pCwNa92raViJKkHCLQahy47C86ACM2TUu/yYj1hrXhMgWb61S fe6jAulyVD0x1yh41VqpHI6d2xE0btg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1774030768; a=rsa-sha256; cv=none; b=FWz/eyaL8AuFMFDVxqZpfGtRGp7m5u2/BxNbxrUL+DZI138LCh4p2PV9fjR57eQw+Lvxu/ PUfaJFbp40X9OLLxlhH3pE6a/m6VnIRN1bRp+Hkj2O/FGYGeAXf1a/+X015KDi+yRf0Url dRW7IS99BGUXxmVN5qKtFjp4z0EZbHw= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=cet4N38q; spf=pass (imf19.hostedemail.com: domain of kees@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=kees@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 10A9E4375C; Fri, 20 Mar 2026 18:19:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC792C4CEF7; Fri, 20 Mar 2026 18:19:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774030766; bh=fhynckOY3YNY5Z7Vmj+3M9LO934fJkg+0qdwtO++Nsk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cet4N38qjcfMf1hg2fBVK/3J0TcvK5Mk9XFV6riNA9guHnYQ3YgtOKsHP+rmkWYr6 rYXRmsM2aZqSY1A/mFeiQVZ07NhSrrijL6gq9mf3rgmQDl9FZZSzK/4Yr/Y6A8fPm5 OEyBvZnOwUeTv9YxnI7x5f9WeYlMWV7UBnIkfT1gVY+PIvDElJUBkTOflo85rfxBVs nAKTPslk4lGymjYpEAxIBj9hHs21k2R8ATq9mp8G1ZbRZTFA4K1rT10A9RaFvBJry8 zSNh2xS7oOi3lGYzxWkSLd/Fb9gPDybtiMzuM7yOYte0zRAgXpqEc/8vCk8YLItg5C rxtx+Rh4ZwmpA== Date: Fri, 20 Mar 2026 11:19:26 -0700 From: Kees Cook To: Marek Szyprowski Cc: Andrei Vagin , Andrew Morton , Cyrill Gorcunov , Mike Rapoport , Alexander Mikhalitsyn , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, criu@lists.linux.dev, Chen Ridong , Christian Brauner , David Hildenbrand , Eric Biederman , Lorenzo Stoakes , Michal Koutny , Alexander Mikhalitsyn Subject: Re: [PATCH 2/4] exec: inherit HWCAPs from the parent process Message-ID: <202603201118.2F75F8D@keescook> References: <20260217180108.1420024-1-avagin@google.com> <20260217180108.1420024-3-avagin@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 456951A0010 X-Stat-Signature: cyiop7o11t5jyshcxofeyramfrhbxycs X-Rspam-User: X-HE-Tag: 1774030768-592660 X-HE-Meta: U2FsdGVkX1+GxQyZJErIpQwx6bMwyMmJPYGTftknI88tWc+5wZLYKK+iLTqSd9IZOJFapWRH86eFCoX7FLfJAgw8uMv4orGKDLr0lCgLVhuN+1AsIihTVALvaMYSI4qne8Zy4q8H7UHCubERjFt9lSa/TE3XEmisXj3LPYHbDkbF5MvO2Lm5zaX2vGbSLYtR9c7WFf8iyt1geYS6Kn9KcTNXOteoCqhPuRiiwIMm6W6OrmynbtAphL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ner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Fri, Mar 20, 2026 at 10:15:26AM +0100, Marek Szyprowski 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 > > Reviewed-by: Alexander Mikhalitsyn > > Signed-off-by: Andrei Vagin > > 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. Thanks for the report! I've dropped these patches from -next for now. Andrei can you investigate what is needed to fix this? Thanks! -Kees -- Kees Cook