Message ID | 20250103140148.370368-1-glaubitz@physik.fu-berlin.de (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0604CE77188 for <linux-mm@archiver.kernel.org>; Fri, 3 Jan 2025 14:02:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 49BD46B007B; Fri, 3 Jan 2025 09:02:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 44BC96B0082; Fri, 3 Jan 2025 09:02:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 312E86B0083; Fri, 3 Jan 2025 09:02:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 11AAD6B007B for <linux-mm@kvack.org>; Fri, 3 Jan 2025 09:02:13 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id A135680852 for <linux-mm@kvack.org>; Fri, 3 Jan 2025 14:02:12 +0000 (UTC) X-FDA: 82966304442.14.0E2687C Received: from outpost1.zedat.fu-berlin.de (outpost1.zedat.fu-berlin.de [130.133.4.66]) by imf27.hostedemail.com (Postfix) with ESMTP id EABEC40014 for <linux-mm@kvack.org>; Fri, 3 Jan 2025 14:01:14 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=fu-berlin.de header.s=fub01 header.b=UWUvHptn; spf=pass (imf27.hostedemail.com: domain of glaubitz@zedat.fu-berlin.de designates 130.133.4.66 as permitted sender) smtp.mailfrom=glaubitz@zedat.fu-berlin.de; dmarc=pass (policy=none) header.from=fu-berlin.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1735912907; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=I8WoaN64gHSpe9wGDSBv1yuM3/6je8qwnfXSNYl8V4Y=; b=jlOA7cJf71x/Epw+iklAn2XTtuIJNpWc3ggGPc6VfEh9K+AvRqczij/JwXFmvK90fKwsxT LHRNBRXSqkpdbiV939Iz6aULSmugt4uYdwlc1mABoqL3pZXlq2XbyArLL6t5faHKwv0W3W aEltxXynaD70TUDo1uASAV0sgeewwII= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735912907; a=rsa-sha256; cv=none; b=qhW+rfUzYodZvACAGtWnzp+prj1GzpiCLKYWu3roEL6TZpkgc67iYRcsKPVFGz+Ae6SFCO PSPNZtwya4k4toO4CMjY098fnn4u3u2eDf72M3s0K3GBERZloFGXiSKiaVI3z4+PlpJfl2 bzD+N92H0XlPdsoK+2dR3EwRtZabxXU= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=fu-berlin.de header.s=fub01 header.b=UWUvHptn; spf=pass (imf27.hostedemail.com: domain of glaubitz@zedat.fu-berlin.de designates 130.133.4.66 as permitted sender) smtp.mailfrom=glaubitz@zedat.fu-berlin.de; dmarc=pass (policy=none) header.from=fu-berlin.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=fu-berlin.de; s=fub01; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=I8WoaN64gHSpe9wGDSBv1yuM3/6je8qwnfXSNYl8V4Y=; t=1735912930; x=1736517730; b=UWUvHptnFr9zH6KPOrTf+ML9LBkoXNUJu8PINPonNLKGT+CoN9g50yViYVUrfak5oTznOJkvjWI aPVeOPlghBMoNRGQnvDMK0/teZUy9EifHYWD5K08X/KegPG9xMK4/YTDlO+3LjxdZDwJ9kDuasYuQ n1dNgOZ+RbT1iRMs/um9eHDc1Biis2/OoFUXKGNoaQ/8ov1JJ+BwEXPVYmUm8hbwoLELoqH/zWcLG BMyX4/JZFhI34kT4jzQfF1Id3sxYrEhwDg+/M5+8r/u3sFNYfODbuR9DoyBheVeDQg/86ZLB+1J92 ak6g5w5NVrDF5iV3/uKcxxPhWB5N5h5JmhJA==; Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.98) with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (envelope-from <glaubitz@zedat.fu-berlin.de>) id 1tTiFX-00000000P7D-23jf; Fri, 03 Jan 2025 15:02:03 +0100 Received: from p57bd9274.dip0.t-ipconnect.de ([87.189.146.116] helo=z6.fritz.box) by inpost2.zedat.fu-berlin.de (Exim 4.98) with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (envelope-from <glaubitz@physik.fu-berlin.de>) id 1tTiFX-00000002btC-0ulp; Fri, 03 Jan 2025 15:02:03 +0100 Received: from glaubitz by z6.fritz.box with local (Exim 4.96) (envelope-from <glaubitz@physik.fu-berlin.de>) id 1tTiFW-001YM0-2E; Fri, 03 Jan 2025 15:02:02 +0100 From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> To: Richard Henderson <richard.henderson@linaro.org>, Matt Turner <mattst88@gmail.com>, Eric Biederman <ebiederm@xmission.com>, Kees Cook <kees@kernel.org>, Arnd Bergmann <arnd@arndb.de>, John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>, "Paul E. McKenney" <paulmck@kernel.org>, linux-alpha@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Michael Cree <mcree@orcon.net.nz>, Sam James <sam@gentoo.org>, "Maciej W . Rozycki" <macro@orcam.me.uk>, Geert Uytterhoeven <geert@linux-m68k.org>, Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>, Chris Hofstaedtler <zeha@debian.org>, util-linux@vger.kernel.org Subject: [PATCH] alpha: Fix personality flag propagation across an exec Date: Fri, 3 Jan 2025 15:01:46 +0100 Message-Id: <20250103140148.370368-1-glaubitz@physik.fu-berlin.de> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Original-Sender: glaubitz@physik.fu-berlin.de X-Originating-IP: 87.189.146.116 X-ZEDAT-Hint: PO X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: EABEC40014 X-Stat-Signature: ryn4rcgdqixqjka8mj5x4djt9pqkist4 X-Rspam-User: X-HE-Tag: 1735912874-49202 X-HE-Meta: U2FsdGVkX1/4f3q8zBBsGdOuwQrguu5bDoCbaRAEB5asZb2Ab8M/6qM2Js1RjCAce9wgH8MN+2aEGUrBMSTPhLkSqwfpRjVzk97E/2wNHgGYcpeJhIU2sWpcdd0FxD3VjCVWzBartLJKzzs3/s/nfY1oMFwpvDbEC9xiPiDEAw7K7mDhLqhKSPeBlFJ43BG3FOLmBThu3dZ4lgFlv/8i5i1hiXMVqaTlHjP2ud8Vpi/As1IblOA+rJsr0Jp6jp6UQD+2nMbiPhutifqgQ/RLrn9zot2uA0w2H+jkNLDqw1hj9jTvCllzYiwu57EztIRVbWjaDeKgT6iaoS6mYBr4zmyHb2ejx6ZLRJ8W5ozF/MXrqMvCQWRDuaqPTp/uyj1wLfcc/ELMdmGpQPyklPUQgPHOXYV1JoEVIR8O9AFaeK3Z21AlQvMkRERuyx+McyFjmPlwLmsgOgRxY0s0T4O6ERZaSp9H/e1MGZE7bEnVjBYgof60i5qPyZmyjkskHQEoVT6bNeIiuFOi7hnnRvjW5q3Xd2r2IsrqBNXzCNPSq5IEiiNNHe4knpLDLcsgJUr5DH5duNeJR/DG2/i7jeCMfRhlmS+4R3wuvS2tktTb+1DER7UrBdv6tJGz0j//S3fnratlTrgHW8EAHnoyGAOwjglJhk1PJj/cR8tJ9uInDcccQtTmio4AO6x7qAgT9XcIjIh1ppEuEbF7LCXjUDTC1hh70UlhzCuMK4zN9GioXlGKGFx2+spggIsAOVVThrbC9U2t8BTz+aw3Gd+fJ6FUl9C5Nzwyh7SSHgoe+g22Us5+FKU5aTLY4BYkfYryfH7WHDtHldomgH0OnD2aU9NoEcc9I08c7LXrA3ph+CX4tfFi3cmXu1IjTb/lOUE1/QAZf0WUJXnBWeSk7AgUhesYmo65xsTaWKob+RgCfRorMi5tGhDMH3Ra9WoF2FycydElFUUn3kEInhOw0w/fko1 v4zbDlB4 jMBleR23miLZatQ0EuW9uUq41U+JhcTsBukgT0WI1ASOB5SFJ+lRs0Or4HlEGaEd6oqfTeMQSmSsNHtGwpPlApB5+Ylbs7N/+uImP3mcNdIwLLmfgCU5JkKy3L6pBe6NZ64LhTiQw3wKjWZX93O484Gucz+BYUnDpVpXaJzZ144OSbBIThIXgwujPc4axF0YzOuHJiGR/LW5PZHgiUGDQlM83zrWgCXY2bWIL5l+87A71Hic7xCpaOAtEx+myDyNKRXqpXuBijfqIGUQoE5d1FrmhOkm6EKAYQUwjtBB1rrByNRbzU1eoxMKt8dmEaJXlCpM3YzEXMKR3SGYRpCbJhL95KWg156pGgNThsaCDjlEuDBm1wCp/66jSfd/B8oFIIS4w9xIdLPjib0JAzQVp+FrqqT4L5O8+vyDTj0TwFzLIMqhF1Ak2aNf9lUSQvTm2ttsZ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
alpha: Fix personality flag propagation across an exec
|
expand
|
diff --git a/arch/alpha/include/asm/elf.h b/arch/alpha/include/asm/elf.h index 4d7c46f50382..81f8473bb7c0 100644 --- a/arch/alpha/include/asm/elf.h +++ b/arch/alpha/include/asm/elf.h @@ -138,8 +138,8 @@ extern int dump_elf_task(elf_greg_t *dest, struct task_struct *task); }) #define SET_PERSONALITY(EX) \ - set_personality(((EX).e_flags & EF_ALPHA_32BIT) \ - ? PER_LINUX_32BIT : PER_LINUX) + set_personality((((EX).e_flags & EF_ALPHA_32BIT) \ + ? PER_LINUX_32BIT : PER_LINUX) | (current->personality & (~PER_MASK))) extern int alpha_l1i_cacheshape; extern int alpha_l1d_cacheshape;
It was observed that on alpha, the misc/setarch test of the util-linux testsuite failed with the following error: misc: setarch ... : options ... OK : uname26 ... OK : uname26-version ... FAILED (misc/setarch-uname26-version) : show ... OK ... FAILED (1 from 4 sub-tests) Running the setarch binary manually confirmed that setting the kernel version with the help --uname-2.6 flag does not work and the version remains unchanged. It turned out that on alpha, the personality flags are not propagated but overridden during an exec. The same issue was previously fixed on arm in commit 5e143436d044 ("ARM: 6878/1: fix personality flag propagation across an exec") and on powerpc in commit a91a03ee31a5 ("powerpc: Keep 3 high personality bytes across exec"). This patch fixes the issue on alpha. With the patch applied, the misc/setarch test succeeds on alpha as expected: misc: setarch ... : options ... OK : uname26 ... OK : uname26-version ... OK : show ... OK ... OK (all 4 sub-tests PASSED) However, as a side-effect, a warning is printed on the kernel message buffer which might indicate another unreleated bug: [ 39.964823] pid=509, couldn't seal address 0, ret=-12. Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> --- arch/alpha/include/asm/elf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)