From patchwork Mon Sep 23 14:19:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincenzo Frascino X-Patchwork-Id: 13809663 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 84687CF9C70 for ; Mon, 23 Sep 2024 14:19:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 176ED6B0083; Mon, 23 Sep 2024 10:19:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1290E6B0085; Mon, 23 Sep 2024 10:19:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F31B76B0088; Mon, 23 Sep 2024 10:19:55 -0400 (EDT) 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 D4F346B0083 for ; Mon, 23 Sep 2024 10:19:55 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 5C9071212CC for ; Mon, 23 Sep 2024 14:19:55 +0000 (UTC) X-FDA: 82596211950.15.091039E Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf26.hostedemail.com (Postfix) with ESMTP id B9907140010 for ; Mon, 23 Sep 2024 14:19:53 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf26.hostedemail.com: domain of vincenzo.frascino@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=vincenzo.frascino@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727101107; a=rsa-sha256; cv=none; b=JQGftFUpk4dm5PWUGd9SRnvoWBCYSdemJs0pfGdN0lVxKsFZ4HNsnKwLwwrmPABKsajaLZ g5QyWL5/UvIf3QH8pkAkFUx9uqpTiXeIRzgtknO25mE8+LdSCyzJjZ5YhFr7QTDCXHYWUd KCFcEqH4twceLT/P206/rpd/MiSIpyw= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf26.hostedemail.com: domain of vincenzo.frascino@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=vincenzo.frascino@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727101107; 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=mFyRD62lBvZVQAlhbGspUIuSgrAAOVOzZzpdKiV2GGw=; b=SgjQtUYMHK9l1fUtat5m2pNgM2ZVLRLz1lvzQXlBWKocY7V4zCJdHGFUhPvIZ2JJ8YurHX 04f2xY4BbdluoGUAiVC6ZBd9JroBOcP5znWoeLb+U4lvZJFT0a0E09pxtAE0Hq9v0DdudA qYKppof5DAVbgkUdQ4cFx63EUmvNL0c= 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 2BC111007; Mon, 23 Sep 2024 07:20:22 -0700 (PDT) Received: from e119884-lin.cambridge.arm.com (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 426CC3F64C; Mon, 23 Sep 2024 07:19:50 -0700 (PDT) From: Vincenzo Frascino To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org Cc: Vincenzo Frascino , Andy Lutomirski , Thomas Gleixner , "Jason A . Donenfeld" , Christophe Leroy , Michael Ellerman , Nicholas Piggin , Naveen N Rao , Ingo Molnar , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , Theodore Ts'o , Arnd Bergmann , Andrew Morton , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers Subject: [PATCH v2 1/8] x86: vdso: Introduce asm/vdso/mman.h Date: Mon, 23 Sep 2024 15:19:36 +0100 Message-Id: <20240923141943.133551-2-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240923141943.133551-1-vincenzo.frascino@arm.com> References: <20240923141943.133551-1-vincenzo.frascino@arm.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: B9907140010 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 84m898psbukwrynm7agff4qn95gew849 X-HE-Tag: 1727101193-543070 X-HE-Meta: U2FsdGVkX1+65rrsfMBXrA/+yyrtFD5O5ZecrRhaNvMCgwm07GDfPCZ88dr0jPMQHr4n8xiwJgUhDwwh5GLZ4EANbQ7DRuwqM6gezlvOhjeUK0HLFfhtcZkA4JQ39HO1rJocjVfeHkaQArx9ddAickgWrqVzX4rcLEFOLBCOaAGdZ3Lu3T4DxkCvxex2N87fjgBzybpGq2r+zBTlhvPKqOXlB0J2oHSGpw3i0lGLxicEBNvE/wTDJFIa5PaUPkQhNq+Rep9CKzDxh+12Vxn7c09xMMXYroPFuXdY5kJBjZHcR18nJ1fyPX/hfwmA2dcZYa66MjzF6XhelZh8Vc3AaKYEArvekUsz7zKe5UDl7xa+hDBWYBDpy1PdVJAxJNFCWiy9ESFjCG3UkZsRVJkNzMeayAcMP0FrqurjCarIygtJX8lbhmoVqefwtyH3fwK3Q52BKc5Vite9+pcu3TamKyqznB4bkkyOxr0sDypocSGj5LpjshFzsKysiPwaHZKi7P4XVNWK55c/gYEwG5rskH+lC3CHLyptr5qob1DspRAhZ3hAwPo1alIR6me1+kr65ucqqO9+21852yWaRaS0M0fSxwV7F32XAV3ZQ6psOuB/K01oHMafjFSmh/fxtdBURZF0c6epHNzt8G3O7xwrW+sVZ0qvIsPYBiDqGLKsL2F0RHM7TjEa68zCDrrn/YpqzbTD4Jx646qhJjBoKyC4uhw2a6ywIwLZc9Q7koQcdffDTElN9YSOxoq7QRDcV2Di8MnX2e/ITGjh6Cot3OQc44kM2IsTmxNm1+dn0kujvTw/w910BnkiyakIiDnhPsMd1bV3q0WR/yIds/RjVSBorTmEC6674V48zEh7QQ038e/vFsOgL/l6Zf0W/+t3QqbODK4aM7NcQIwfnh31VQZs0Gpd66Ncrpd0C8cAMkXOv8oGYmUxOroxwS0lkg07BS4ABW5XxFUF6se+u2yhmcn jRpDZMon 5Y/3zrudV3+GZgN9hzOePBJHnba4KwVSlhZskPxyX56p0rLFUF088JytVzY0rURXIvSCXXATrpwEczAX6h6Ek2dot5qye3/NzrbeWaRBZjSbH7F4BY7XcA2BHI9+kYYdVsnKtdHpHzD6qcH1qLFEv8ljvEyHXe1aF0SLwdYmToCIrL2wDDO4MSKC+eKzOzZfpooR/5cmGeTbUP19KNkgV9LtNDZmiMr8ccSxoUVWJksX6Zz0= 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: The VDSO implementation includes headers from outside of the vdso/ namespace. Introduce asm/vdso/mman.h to make sure that the generic library uses only the allowed namespace. Cc: Andy Lutomirski Cc: Thomas Gleixner Cc: Jason A. Donenfeld Signed-off-by: Vincenzo Frascino --- arch/x86/include/asm/vdso/mman.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 arch/x86/include/asm/vdso/mman.h diff --git a/arch/x86/include/asm/vdso/mman.h b/arch/x86/include/asm/vdso/mman.h new file mode 100644 index 000000000000..4c936c9d11ab --- /dev/null +++ b/arch/x86/include/asm/vdso/mman.h @@ -0,0 +1,15 @@ + +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_VDSO_MMAN_H +#define __ASM_VDSO_MMAN_H + +#ifndef __ASSEMBLY__ + +#include + +#define VDSO_MMAP_PROT PROT_READ | PROT_WRITE +#define VDSO_MMAP_FLAGS MAP_DROPPABLE | MAP_ANONYMOUS + +#endif /* !__ASSEMBLY__ */ + +#endif /* __ASM_VDSO_MMAN_H */