From patchwork Mon Dec 9 09:50:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Brodsky X-Patchwork-Id: 13899197 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]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1D66E7717D for ; Mon, 9 Dec 2024 09:51:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4FBD88D0048; Mon, 9 Dec 2024 04:51:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4818E8D0029; Mon, 9 Dec 2024 04:51:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2FBDB8D0048; Mon, 9 Dec 2024 04:51:14 -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 088978D0029 for ; Mon, 9 Dec 2024 04:51:14 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id C23FB14028A for ; Mon, 9 Dec 2024 09:51:13 +0000 (UTC) X-FDA: 82874951796.10.D3E2F6A Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf01.hostedemail.com (Postfix) with ESMTP id 9455F4000E for ; Mon, 9 Dec 2024 09:50:56 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf01.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733737862; a=rsa-sha256; cv=none; b=0axQa0uKkHBBGHgXlNqj+4t58rZ4FOdTjZJApUuVujS6JU07DvficFGVzPZlgYOgFFDBa8 nSyqZXiOdsbDWYsMXBRDzRNMewc5H3okhwyE4kMPfoVrRRkBDy/XrEtA5r28RsRQJEUTI/ J+pZ2OLhXaLlic0GHcDmb63FxXpDcRA= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf01.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733737862; 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:in-reply-to:references:references; bh=fD+1ahQubNsrFJcIZy6nYonMd+lwfObdutf43AaVl4o=; b=LAmoCEbw76bK/X4TkafSocfNxwFzBn9sARaFoVewboXIs/u2+Xf7sKBMUSBp7WDmFt8xEk fR5w9nMYRcR1WuTrs/yEgliZFNQ61okVtN55TAitvCTt4iCr1DTQ46jhOTnPFqBJCJDsxw Dj3Bf5AHAUq+5T97mWVvWCaBkCc9/hA= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 84549113E; Mon, 9 Dec 2024 01:51:39 -0800 (PST) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7ADDE3F720; Mon, 9 Dec 2024 01:51:09 -0800 (PST) From: Kevin Brodsky To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Kevin Brodsky , akpm@linux-foundation.org, aruna.ramakrishna@oracle.com, catalin.marinas@arm.com, dave.hansen@linux.intel.com, joey.gouly@arm.com, keith.lucas@oracle.com, ryan.roberts@arm.com, shuah@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, x86@kernel.org Subject: [PATCH 14/14] selftests/mm: Remove X permission from sigaltstack mapping Date: Mon, 9 Dec 2024 09:50:19 +0000 Message-ID: <20241209095019.1732120-15-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241209095019.1732120-1-kevin.brodsky@arm.com> References: <20241209095019.1732120-1-kevin.brodsky@arm.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 9455F4000E X-Stat-Signature: ujk3td45njgbcmb8d3ys857hmfcocn6u X-HE-Tag: 1733737856-288533 X-HE-Meta: U2FsdGVkX18g+oAIxt2v4fQ1C2vPr8iIWIMchb9Idi1kNIbqVg37+BCDk+Gkd2mwchfPzgLgF4xGS1EFZZUBkVqIU2sey3/HcGyX6ZKBsc152hTRsH8I/BrwDgIrzJzfH32zR+ocEnGECxHuWIkEVTKkrA8RrV/qdpQJaNOSRtTht23Rpesk6SZT04Oae8VmTWgF1Fz39DO50mk3yJfSKMLOe5ELak+/5jxZvGeOumETbBt/asOrBtF5nVjaeaDgL1wLf4GjMbbmeQMB197nWJAP+51gRocmptvQdJ/45mhagZq4kLWquxSjwg4fEQFippWHtLQoNc7WGPmYQqDXnAHMbRc9+7dYFTiszHTrPShdUAqqWBM++SctaHvCessa7drHx8zUe0ygdLbCtgUuU5SWG2f4NpXx0lYtBV4xPP0+4uEcpQaPoIBCm2fafGoAwe4nJo2hFQq/xLkSGc8Ri/NB2qJZ/hdejvsWIXJDtsrgrUtPiHbO7z6Up8lTg2XnZcQNz6sZ2AvAk16iEJ7qWoA5BekOxhAxcTrDQQjlStiCL3Sil/JoR5S0Jy/NuNWjWR1jrD+pou7QCIBPehHV5kb28xdcMovNzphIsc5gOo5KLKn47+v7nLqN1WxB2E/gAM0Kycnr+/2MSbXJwADcWcsFymzr+lErk0SNyjBzAiVZubjz7wDX6sGNXPixYGUjUdjS3AJdpw/fy+lBhWYxEMp+0pZohTdicNtgOcTWVX5nVU/wyRKJ2d1bijHVql/HKLwZnKzUFqBYLHIQmmmCMnPafhjuewa9TnXaTFHu0whl62G2X+AmG0inLb4BN64XgqIRVjZSw0hzanYnMr8Utr7CpgG4pGgagxNi97bbNUoTKKlWn7PbzeqOPgZo4kSKP33hJ/yogAewBVGTEuZyZBLcu+4A8qC1h5W27pzTyrEEJe9Cp7jmn/0ICN3/v+JtQtnRluAjoOblz2hRQtp Me3CxefJ lZFzmsdYbd9IjqvMS84pKDyJs2ZUeSbZp6AAhlIdJzk7Z90tr1gkM0NrVPVCKbPa6CcqYX7a4JmPNmz+KWp+ACeqTcV2YAK5KIiJ+dqaPW5mE8cl/vA+WKVgEJuVpe34EMA1eON+cmmoW046gu0QG7AyKRj8jaqvrtBMhxK4ywcGZQr/JwdEvXYtaR+SSaP8rL3wIzCIPUNHjQiywoQgJi4c+ejYc5ZlIBrNTxAkOEh2agUMYl+OmVImRag== 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: List-Subscribe: List-Unsubscribe: There is no reason why the alternate signal stack should be mapped as RWX. Map it as RW instead. Signed-off-by: Kevin Brodsky --- tools/testing/selftests/mm/pkey_sighandler_tests.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/pkey_sighandler_tests.c b/tools/testing/selftests/mm/pkey_sighandler_tests.c index 449ec5acec75..17bbfcd552c6 100644 --- a/tools/testing/selftests/mm/pkey_sighandler_tests.c +++ b/tools/testing/selftests/mm/pkey_sighandler_tests.c @@ -315,7 +315,7 @@ static void test_sigsegv_handler_with_different_pkey_for_stack(void) sys_mprotect_pkey(stack, STACK_SIZE, PROT_READ | PROT_WRITE, pkey); /* Set up alternate signal stack that will use the default MPK */ - sigstack.ss_sp = mmap(0, STACK_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, + sigstack.ss_sp = mmap(0, STACK_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); sigstack.ss_flags = 0; sigstack.ss_size = STACK_SIZE; @@ -488,7 +488,7 @@ static void test_pkru_sigreturn(void) sys_mprotect_pkey(stack, STACK_SIZE, PROT_READ | PROT_WRITE, pkey); /* Set up alternate signal stack that will use the default MPK */ - sigstack.ss_sp = mmap(0, STACK_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, + sigstack.ss_sp = mmap(0, STACK_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); sigstack.ss_flags = 0; sigstack.ss_size = STACK_SIZE;