From patchwork Tue Sep 3 15:14:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincenzo Frascino X-Patchwork-Id: 13788869 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 398A6CD342A for ; Tue, 3 Sep 2024 15:14:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C30CB8D018F; Tue, 3 Sep 2024 11:14:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BE0DC8D016E; Tue, 3 Sep 2024 11:14:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA86A8D018F; Tue, 3 Sep 2024 11:14:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 8CF288D016E for ; Tue, 3 Sep 2024 11:14:58 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 01FCF80535 for ; Tue, 3 Sep 2024 15:14:57 +0000 (UTC) X-FDA: 82523774676.03.7F68D5F Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf06.hostedemail.com (Postfix) with ESMTP id 58E2718001C for ; Tue, 3 Sep 2024 15:14:55 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=none; spf=pass (imf06.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=1725376448; 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; bh=l5ng6NJisMTK+l8xfi7NzwJyi91qW7zvH69hEyuPV3A=; b=l6KgqjBY2tDeciPBbtlKpETVZFobPyWUgGifW5KwxXB4TK0TgfJGEJsA2eJX03B58VL5RK HrP2HxvVkfGNnBhtKEa2/13BzjYpNf2/pfVWpSMfyGO6ea3HjLXJub8wT6PngdvaNeACiD SRw2NyRObCSd86UDAiD/ECZhLUVm36A= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; spf=pass (imf06.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=1725376448; a=rsa-sha256; cv=none; b=78GGg7/688TN9pi6GVREKQrXAcA0F7xDbpzcEOOG8YoUfwcHzFn6HN+ab6uz8IVG++rCsT Y99TS4coX+KJXxEEt4Ix8/XnkffrW0I6+ekKXzYdHXE/vlw6KbvYSliDwbRA3assgYpf2w ISAwGCwblUoLnlk7SbXCD1Lrt80Mo5A= 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 E1F08FEC; Tue, 3 Sep 2024 08:15:20 -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 8A8253F66E; Tue, 3 Sep 2024 08:14:51 -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 0/9] vdso: Use only headers from the vdso/ namespace Date: Tue, 3 Sep 2024 16:14:28 +0100 Message-Id: <20240903151437.1002990-1-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 58E2718001C X-Stat-Signature: bjg7ygkf6o56bfify4qacrxibykx8bfu X-HE-Tag: 1725376495-346152 X-HE-Meta: U2FsdGVkX1/LriD1qMr9T0ivXiBjfO6QeNDP/gd+7q9ojMU72xhj89+D6sMIaZdYfaFDbvyNaPOGoeiWz0b7hTKfFN70XTbMMjRgcCiyQqBiXLeChqYVYKo033x0CtA+TeJ7KgPJeTe8rC3fMnanziui7QGrWUzAuO8J1RLYYsjPc4MmUJ64UyWganNmU/gVVlKqRdGxrTR8TV+QVf99yh1dM+mmNCuEsh1VX1S1IGOjI8Amkk/F32coWkOmU62AkjHRKocdHPBWrOEnlGBAR8GQBhpXWjdxsM0j+fSKA/rFlhEqaorwqoTpSEmRaTdGUpGl6K/CM0T5XEV4CdWMgvxrt7AQgYQ2XJ+ElPLwMMVTpLXUhaKANCcNeZ33czI99LOnCLZqKwTyX+lc1sNXTUevLdiT9GEqgeFmR5nB9M0NJTi/R50AZWPnhkGyaCT8maeBPzBOTH+AerJJC6N0D9yZ2azY11XlaluGbtvxq6onpvS5xOuwijqEkMR5epp7XAcfmQkO8o/o5YsjLAtKT3NkvVz2oZStkRRntdfHQZkLYFyEIl4Et6cmo/v/tOE20EFT/0cWjgop20nYLBRE+a3JAJd2nVO/y6GoBghUFFgpkjEpUq64+BVPG2mnBJTmFInA/Mqd4GXpgdKgmqnPP8aDdG5zfXsdDRauXMMOnS4VuxlZYbv2460SRW/CKmepJ0CHeYNKA40kW9M7y0FcxFSmgvFL8LT8ILIZy2EvOo2EmVWRICPo3Buaj3DC0osjI6JzKm+3nxwGDPn0wI6ilrxBQfRdH5Xw+xDrbjg4wh+SKe+d50yvUdvzrgmffdfqS9drLgOd7WHCJfW44YhfkC4N4WdHqslGkOeYntJUmNsUgoKENeDp4t7MaT47PO5YMyIex7sblbxO91+M9vROswydqL66pnWH/uF3YBXUjHcdGyXHPbRaMGzmqlYk9ZmvCkq5ODXNFWi2vkVTIbr LXRP8jEO 4RHCEMN5qUjWOdYNE3ZpG6HdDW1Y9yxQwfcv+uKBYNWoYzd581ngL4Dtl59srFb+LgRxd785+XzH59Y5GkKu6DwQ8O+rf/kdHWjoZUqOfEOGv8eUo+YTfNP/sVp2V0UGYhKyumylA10uTMSlF9d6Zthdsxi67zKPGasfU9PY5kueYgNyJ6I8sIyE6tQCaS/RzR4R3vHSpVpylk4UGIunVYq62zv8bf1zcz4I5Hfnijqp+tIc5ltGEdUT3gpLGz6edHo8GqCHGGsGfSBTKMbJY6CeCLtHeDKpeqrGnhlyjcp1qEDSIGvl4AtS36ulnPpJT/V3tUSarPTer5WkLtR1bf17TtGOtl0Rx6FsDelg4f90Z3CC20tzjUD9utTs+kGcrCN01ks5D9m+LaDFrShEAFxUxyFv9awvrNvmegW/ZN/4kxKUZ4qw/Hfxgkht188OfAPyrmZihf8d2y2rRj8biylmaz7Grnt3uDD3+SaPqYpScUT3Xz6d4cLcbDF58bvOq/QXPQIOxn73gSR0NJ8mv7fMnbWwQtvhLQR2alzFz2ddLcaAnGLZOQzi6ZGpknS3SVQkWMddwgpLY7Cx+rgQgQ8rmJms6YSCas4EZ 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 recent implementation of getrandom in the generic vdso library, includes headers from outside of the vdso/ namespace. The purpose of this patch series is to refactor the code to make sure that the library uses only the allowed namespace. The series has been rebased on [1] to simplify the testing. [1] git://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git master Cc: Andy Lutomirski Cc: Thomas Gleixner Cc: Jason A. Donenfeld Cc: Christophe Leroy Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Naveen N Rao Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Theodore Ts'o Cc: Arnd Bergmann Cc: Andrew Morton Cc: Steven Rostedt Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Signed-off-by: Vincenzo Frascino Vincenzo Frascino (9): x86: vdso: Introduce asm/vdso/mman.h vdso: Introduce vdso/mman.h x86: vdso: Introduce asm/vdso/page.h vdso: Introduce vdso/page.h vdso: Split linux/minmax.h vdso: Split linux/array_size.h x86: vdso: Modify asm/vdso/getrandom.h to include datapage vdso: Modify vdso/getrandom.h to include the asm header vdso: Modify getrandom to include the correct namespace arch/x86/include/asm/vdso/getrandom.h | 2 ++ arch/x86/include/asm/vdso/mman.h | 15 +++++++++++ arch/x86/include/asm/vdso/page.h | 15 +++++++++++ include/linux/array_size.h | 8 +----- include/linux/minmax.h | 28 +------------------- include/vdso/array_size.h | 13 +++++++++ include/vdso/getrandom.h | 1 + include/vdso/minmax.h | 38 +++++++++++++++++++++++++++ include/vdso/mman.h | 7 +++++ include/vdso/page.h | 7 +++++ lib/vdso/getrandom.c | 22 ++++++---------- 11 files changed, 108 insertions(+), 48 deletions(-) create mode 100644 arch/x86/include/asm/vdso/mman.h create mode 100644 arch/x86/include/asm/vdso/page.h create mode 100644 include/vdso/array_size.h create mode 100644 include/vdso/minmax.h create mode 100644 include/vdso/mman.h create mode 100644 include/vdso/page.h