From patchwork Tue Sep 3 15:14:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincenzo Frascino X-Patchwork-Id: 13788870 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 387CFCD343E for ; Tue, 3 Sep 2024 15:15:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8D5F18D0190; Tue, 3 Sep 2024 11:15:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 885B28D016E; Tue, 3 Sep 2024 11:15:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 74D6A8D0190; Tue, 3 Sep 2024 11:15:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 4F39A8D016E for ; Tue, 3 Sep 2024 11:15:00 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id EE8A24058D for ; Tue, 3 Sep 2024 15:14:59 +0000 (UTC) X-FDA: 82523774718.01.3A8C1A4 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf08.hostedemail.com (Postfix) with ESMTP id 607C3160028 for ; Tue, 3 Sep 2024 15:14:58 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; spf=pass (imf08.hostedemail.com: domain of vincenzo.frascino@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=vincenzo.frascino@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725376451; 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=eLPi23NCssDW347bgKtantBj/qSiJtHKtzQPoxefRsI6Jl3G66M4vgdLq3i09UZJqBJIq/ 5lZvZuckXzrlOl5LA+VFJnUcw2sfZHDmw8PPgu/9Hmkx5UTPaE0d7r3creqNwcQLxhgEUm 5Z7VMNp+H10QKD7bEWB7lTK8ufT51PM= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; spf=pass (imf08.hostedemail.com: domain of vincenzo.frascino@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=vincenzo.frascino@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725376451; a=rsa-sha256; cv=none; b=xV8QuByP5fLSt6hnmx5axpGcyK3s4/CBdA2cDz4QcF1RIPKnpkWgOZc6B397bulFESPFhT HlH2u8WPLfvEw3rWdMSNEMR+7sy/SId/OqDaAff8beyBuJkaBRjDp4YjgGXQ6m4/ncs4iN ECb8R9Ar6sNSKNTkRYVmeHaH9E7OddQ= 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 1C42A1063; Tue, 3 Sep 2024 08:15:24 -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 BAAB13F66E; Tue, 3 Sep 2024 08:14:54 -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 1/9] x86: vdso: Introduce asm/vdso/mman.h Date: Tue, 3 Sep 2024 16:14:29 +0100 Message-Id: <20240903151437.1002990-2-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240903151437.1002990-1-vincenzo.frascino@arm.com> References: <20240903151437.1002990-1-vincenzo.frascino@arm.com> MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 607C3160028 X-Stat-Signature: bi89kbajpzji4z3ijc5wnjk4poxgawbt X-HE-Tag: 1725376498-204377 X-HE-Meta: U2FsdGVkX1+AQZ00dkQMBx3B6PQie9OiPmU9GOvgugLb4nxd0dZJDoq3jKl2hu/ezvP1Qr787UcS1twVmOrY45r+Dj+0W79pZzS6WY/Q6cUafGkLh/8NhzOoIWbnkeyfkaYr/z8HwyDk19Z4UaWH7T46CQMdnERnF5tXM88FwTBN2i1FUkIDG3WkZ0ydUDAEwALN3Tl1PeodJXSV4+Yo8ICEZRLP10N/EO/flcpQ5Ym1nIq/7l1ljaSuIHWUi5IWNeYYy2wfD7hTkkxMUOUdhtHYHvZnxjX+wcT3hdvyi8nkHgAJmHcbOeFG60gNisjvhy1a8uwflBsVq0zkqarrt+GEqGT15qk+SaQXrMRrLmRw7miXK5UuKYIiLux/uAcxwf46yu1aNQtJhd8uT5xh2/7qoj/TCtFnAs2aP130Fz+W5Wq7PjqzR7qm0H9shukZkrNp0D54zOJF2w7BtpcV1hDWq/91SQGLx/+vutXs8t3EJKFX6/W6/ZzAaF2t+Q3tff8OVD18EWXrWGAosWz9hXkHCIVRPaQWU04cw3MlQrH5jB9guEKnZHKjjhgzw8p5c8Zo7xsVCYMJhDkgJ4IvVtgqhamlme9rocKOt14YuD8l7w41oFShUFfYAvg5PxHcpn7SiI9RPXEOVH4pIFDuQ1TgwFv8DtQ120JegTx4RG2wUJJJSz5mujvtmOESJGtVfOaVjAbsiBJta825yt+YhcOTYQrNhy2Z3zjNah7CkEFkNoHlcJWAv7cdpdmdmOw6cFthdSRx36mAwcaf7aRqxYIfW463UktO8//k/xH4dZ/JR2Y5mvcG1I+F2yAp2I+CLfwsQWkFU+oevQbzPc9adF1OO9lOKlXWAKZubI4G6lbZ/c3cEb2tjNW7++Tm4a0rb1a7Fvr0i+la45kAh7QQ2bUBmnLOA/H8L2B3zmxQ+hd4QPXu5hpDqVQWI1mlSvLQL1DOWcOMbi8ma/p/rBJ wfsrC8+M 7zmJaHKC+RpJFcs3NJPKR8tFPHO6mL2lM5wf3q5C60gbwcYzFPqEnZVoz3hBr8m9mzwcrKLxqgxjje6599ES+kkw/l/V+k8y5BnK56s0OgDmj38c22EA9dukMkpWyB8DAZMX2jONEjpIJdAHoAWKlVw+mpvr6U4BranaklJz7TDfWUXnjRGgniwIecq6jEqxOdpvJIP9a9bSgH39D+g/fBYVe/Yrl2auBcYOmwil36il9/dE= 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 */