From patchwork Mon Oct 13 10:40:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 2149189 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=kAa+j5mP; dkim=pass (1024-bit key; unprotected) header.d=weissschuh.net header.i=@weissschuh.net header.a=rsa-sha256 header.s=mail header.b=J6mngZ5l; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4clYll1S3wz1yHN for ; Mon, 13 Oct 2025 21:40:33 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cn3osPYs4c1fpWopV4aZ+cLtK4IK6I5A4rd+bW/Oo8c=; b=kAa+j5mPkPglkrzUUE9RulK63o d8TzUi3INA2hk6BUYcVTzr2QRvvixN3w5wEEoLfSQVwurOclxb5EDWDv+SzMfhvg1iI+2bNDVjl/+ OVPvfa1xE82PubNMi7dO8PbW8SwUdHWNswgeCarO/gDdtm7sc1lZ8PO7Qt0oKWE7tJipujbFdJMPH t0LS2jsijEB9u62eq/82zxqv+r0BH0oWB0lNHaWhzP4rSM+ZGiuaIm+9tw3BURbgKeDCqGD+xn1Su Q6Bn9Ycz3nNdSMXbF/A7YzN/r/2fzhnVz7byHlF8JgfKacn2MtBDDhSTUqIhIZAgaWEDapLJom5We 12eajsRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v8Fyh-0000000Cv6Q-11rV; Mon, 13 Oct 2025 10:40:31 +0000 Received: from todd.t-8ch.de ([159.69.126.157]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1v8Fyf-0000000Cv5A-0XKl for linux-um@lists.infradead.org; Mon, 13 Oct 2025 10:40:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1760352024; bh=1LVkRx8kRsF68/oifLyumQVqZEvOwQPq1xNG3PoVF1A=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=J6mngZ5lrtIRvMVqQUBJixn0amS1NZH/0oIVAzVy8lRtWUVPuqh7z7s3OcWJ3FVTm /NXElh7G6j6Hzijz7uaA7kKOXcT2GH4xTamjNhd0JQp3oyEJFyIj8ZbHb0XvOhQzPo mSDPSaY/361xM+3FffvLTOMVnzgLNnznjVNnj2go= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 13 Oct 2025 12:40:18 +0200 Subject: [PATCH 1/4] x86/um/vdso: Fix prototype of clock_gettime() MIME-Version: 1.0 Message-Id: <20251013-uml-vdso-cleanup-v1-1-a079c7adcc69@weissschuh.net> References: <20251013-uml-vdso-cleanup-v1-0-a079c7adcc69@weissschuh.net> In-Reply-To: <20251013-uml-vdso-cleanup-v1-0-a079c7adcc69@weissschuh.net> To: Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?q?Th?= =?utf-8?q?omas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1760352023; l=1689; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=1LVkRx8kRsF68/oifLyumQVqZEvOwQPq1xNG3PoVF1A=; b=6UzajuXf5P86gem69w6a2djFM4jes8KR7Z+AzzHnTw4uM+roZNNIk2t1Jq+8CO6OVy0pS/y+F PC1ENOK3eoBBrpWRQyQSH5h8EA2YJElWI2s0v3x8dePl7ZxczNQsnBN X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251013_034029_330153_5372B5EB X-CRM114-Status: GOOD ( 10.87 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The clock_gettime() system call takes a pointer to 'struct __kernel_timespec', not 'struct __kernel_old_timespec'. Right now this is not an issue as the vDSO never works with the actual struct but onl [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [159.69.126.157 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [159.69.126.157 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [159.69.126.157 listed in bl.score.senderscore.com] X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The clock_gettime() system call takes a pointer to 'struct __kernel_timespec', not 'struct __kernel_old_timespec'. Right now this is not an issue as the vDSO never works with the actual struct but only passes it through to the kernel. Fix the prototype for consistency with the system call. Signed-off-by: Thomas Weißschuh --- arch/x86/um/vdso/um_vdso.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/um/vdso/um_vdso.c b/arch/x86/um/vdso/um_vdso.c index cbae2584124f..5cadcc04d422 100644 --- a/arch/x86/um/vdso/um_vdso.c +++ b/arch/x86/um/vdso/um_vdso.c @@ -14,12 +14,12 @@ #include /* workaround for -Wmissing-prototypes warnings */ -int __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts); +int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts); int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz); __kernel_old_time_t __vdso_time(__kernel_old_time_t *t); long __vdso_getcpu(unsigned int *cpu, unsigned int *node, struct getcpu_cache *unused); -int __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts) +int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts) { long ret; @@ -30,7 +30,7 @@ int __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts) return ret; } -int clock_gettime(clockid_t, struct __kernel_old_timespec *) +int clock_gettime(clockid_t, struct __kernel_timespec *) __attribute__((weak, alias("__vdso_clock_gettime"))); int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) From patchwork Mon Oct 13 10:40:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 2149190 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=eSe0//pq; dkim=pass (1024-bit key; unprotected) header.d=weissschuh.net header.i=@weissschuh.net header.a=rsa-sha256 header.s=mail header.b=pTjoi4kk; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4clYll1dZrz1yHS for ; Mon, 13 Oct 2025 21:40:34 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZCjuI6KQlUnErooOxXkErybYUanb2mdgvyk1axj3d+o=; b=eSe0//pqotNbRmA2UoamD4d9g0 uIfoIp0/j+qpUVXS8HniJOGLU+9f1kVj+GHNTqdNZzT4a3BPft+/BHP5xTVYngE453PZlkwo/0Gdn QlRWtUNrRUiIHEKqiDpLToWsKHqycWLhc0SsjQP8PBW8kXQC0y3wix0QqUrm+mLdATbQWDmebavSU Yrw0yo5i3O9ELHr3qRtaq/uaD0hw/2f/kSyWDfCSLFIjtys6ofknbzgz8iDnUf5QBCPPQBRtRTV2K wvk5+Fr5Z6tNi7L9ZxmpQFYTYTt7R5K0h8HSXVjCoxzhjclRh1xmcu0JsHH9y5S4n7hFzH4xiKbKy zY90iDyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v8Fyi-0000000Cv6r-27wZ; Mon, 13 Oct 2025 10:40:32 +0000 Received: from todd.t-8ch.de ([2a01:4f8:c010:41de::1]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1v8Fyf-0000000Cv57-0xMN for linux-um@lists.infradead.org; Mon, 13 Oct 2025 10:40:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1760352024; bh=1LBGK3TkrPoW63QLWYmeLol3aNiWj2Xkcr6MKYmW53w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=pTjoi4kk9KMK8YhfuDbvKy/w8317zuHva+xyx2B0jEZuCR9YB/UW+sL00F92mSFeD GmVQdZ0h5YCxnD+1UZVrskky1mqiQSrmV74y897v86iSxwzGeAR19m6TwALBbLZpwx fhCYQDk0m0uGc7WNeR0f3dL9HB3VVNZZsDJgMjvI= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 13 Oct 2025 12:40:19 +0200 Subject: [PATCH 2/4] x86/um/vdso: Use prototypes from generic vDSO headers MIME-Version: 1.0 Message-Id: <20251013-uml-vdso-cleanup-v1-2-a079c7adcc69@weissschuh.net> References: <20251013-uml-vdso-cleanup-v1-0-a079c7adcc69@weissschuh.net> In-Reply-To: <20251013-uml-vdso-cleanup-v1-0-a079c7adcc69@weissschuh.net> To: Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?q?Th?= =?utf-8?q?omas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1760352023; l=1093; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=1LBGK3TkrPoW63QLWYmeLol3aNiWj2Xkcr6MKYmW53w=; b=MsrwrxDOXOU/dVReY9Htl3GJq1AC/ZpJPqTe1SC8mLKREvu7kOV34WL64CxKeKIs5+9fkTc2Y 2nmIHBraG5fCGhikb0qvbXJ6rE8PCShGHBl+CbPbUqbiraEzJ8Z2iwu X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251013_034029_416692_DBBF68F5 X-CRM114-Status: UNSURE ( 8.40 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__The_generic_vDSO_library_provides_a_co?= =?unknown-8bit?q?nvenient_header_for?= =?unknown-8bit?q?_the_vDSO_function_prototypes=2C_use_it=2E_Signed-off-by=3A?= =?unknown-8bit?q?_Thomas_Wei=C3=9Fschuh_=3Clinux=40weissschuh=2Enet=3E?= =?unknown-8bit?q?_---_arch/x86/um/vdso/um=5Fvdso=2Ec_=7C_4_+---_1_file_chang?= =?unknown-8bit?q?ed=2C_1_insertion=28+=29=2C_3?= =?unknown-8bit?q?_deletions=28-=29_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=28-2=2E1_points=2C_5=2E0_re?= =?unknown-8bit?q?quired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from_author=27s?= =?unknown-8bit?q?_domain?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= =?unknown-8bit?q?_-1=2E9_BAYES=5F00_______________BODY=3A_Bayes_spam_probabi?= =?unknown-8bit?q?lity_is_0_to_1=25?= =?unknown-8bit?q?_=5Bscore=3A_0=2E0000=5D?= X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The generic vDSO library provides a convenient header for the vDSO function prototypes, use it. Signed-off-by: Thomas Weißschuh --- arch/x86/um/vdso/um_vdso.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/x86/um/vdso/um_vdso.c b/arch/x86/um/vdso/um_vdso.c index 5cadcc04d422..02d41fdb5655 100644 --- a/arch/x86/um/vdso/um_vdso.c +++ b/arch/x86/um/vdso/um_vdso.c @@ -9,14 +9,12 @@ /* Disable profiling for userspace code */ #define DISABLE_BRANCH_PROFILING +#include #include #include #include /* workaround for -Wmissing-prototypes warnings */ -int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts); -int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz); -__kernel_old_time_t __vdso_time(__kernel_old_time_t *t); long __vdso_getcpu(unsigned int *cpu, unsigned int *node, struct getcpu_cache *unused); int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts) From patchwork Mon Oct 13 10:40:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 2149191 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=1jK74/YL; dkim=pass (1024-bit key; unprotected) header.d=weissschuh.net header.i=@weissschuh.net header.a=rsa-sha256 header.s=mail header.b=tbCze3m1; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4clYll1N8Rz1yDD for ; Mon, 13 Oct 2025 21:40:33 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=t1mxEv6RpOJ9ToL71xyYV8XShcnXGEu8fegHnBhQtdA=; b=1jK74/YLMF5YzcIVLpaUYT/zYK Ec0ibjU0YFE9/qDcbrDmHLPnmF+4369rN2QweuZTHRlOMrk9+4nm9E4u91XllsDeoM0pOm/wUxLur fsbAL6Aapfzv9Usxc78slozxGoZ8ZGE9u8/cUWmOou6+p+S6gwpDIZsoDW0YgXwv6QolItazaaWHy c+CdL2QAbfXpsqjgAU1/Ac4VqQD126b3rHi9MvNux+HVZNY938/tgWUlUCf2EsBEt0U9vakpFMCfF wJ8Yi3VH2cA7iu6LDcPX/YJCK9AmNSEEFzLnnlc7SDJ3Mb0X7cSDBMZuJ0MbGUtxXK0XchMsWKaUN vdL55xqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v8Fyg-0000000Cv6G-49HD; Mon, 13 Oct 2025 10:40:30 +0000 Received: from todd.t-8ch.de ([2a01:4f8:c010:41de::1]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1v8Fye-0000000Cv5B-3tkT for linux-um@lists.infradead.org; Mon, 13 Oct 2025 10:40:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1760352024; bh=4oJNqNidl2yJO66qwAhbfNuPC9Nd39kyLTxqx4jOV1A=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=tbCze3m1twkQ3CIGnwhOAKKcmhdyw5pGuR9ZeUhD6owE3TbxlRc4J5m9FmzyVTHMd BPTOxSPYW8VR6ytTBdgZ3pEX091qKTCLrZ0kZv7zTKihkmPc4pby51srDK5ISKQnL3 oQi+Pm+GE6oKBtJ2BKk7Vxo5Y7CQhMz/Gu2PLghY= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 13 Oct 2025 12:40:20 +0200 Subject: [PATCH 3/4] x86/um/vdso: Panic when vDSO can not be allocated MIME-Version: 1.0 Message-Id: <20251013-uml-vdso-cleanup-v1-3-a079c7adcc69@weissschuh.net> References: <20251013-uml-vdso-cleanup-v1-0-a079c7adcc69@weissschuh.net> In-Reply-To: <20251013-uml-vdso-cleanup-v1-0-a079c7adcc69@weissschuh.net> To: Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?q?Th?= =?utf-8?q?omas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1760352023; l=1313; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=4oJNqNidl2yJO66qwAhbfNuPC9Nd39kyLTxqx4jOV1A=; b=dNsqX7tCXD0nmEmuX7XmNq+Gkr9NBaN5EnQIDs+gLqoWtgE1rNz+qLBSnei8UgVgKXGPto8Dy IYjFqpjkVZFBrU9VGjsBxaJJKuax2gYGiMBQNCPudJPVIYB2ThM3N2l X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251013_034029_140122_C1A34DEF X-CRM114-Status: GOOD ( 10.88 ) X-Spam-Score: -2.1 (--) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__The_vDSO_address_is_added_to_the_users?= =?unknown-8bit?q?pace_auxiliary_vectors?= =?unknown-8bit?q?_even_if_the_vDSO_was_not_allocated=2E_When_accessing_the_p?= =?unknown-8bit?q?age=2C_userspace_processes?= =?unknown-8bit?q?_will_crash=2E_Enforce_that_the_allocation_works=2E_Signed-?= =?unknown-8bit?q?off-by=3A_Thomas_Wei=C3=9Fschuh?= =?unknown-8bit?q?_=3Clinux=40weissschuh=2Enet=3E_---_arch/x86/um/vdso/vma=2E?= =?unknown-8bit?q?c_=7C_12_+_1_file_changed=2C?= =?unknown-8bit?q?_1_insertion=28+=29=2C_11_deletions=28-=29_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=28-2=2E1_points=2C_5=2E0_re?= =?unknown-8bit?q?quired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from_author=27s?= =?unknown-8bit?q?_domain?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= =?unknown-8bit?q?_-1=2E9_BAYES=5F00_______________BODY=3A_Bayes_spam_probabi?= =?unknown-8bit?q?lity_is_0_to_1=25?= =?unknown-8bit?q?_=5Bscore=3A_0=2E0000=5D?= X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The vDSO address is added to the userspace auxiliary vectors even if the vDSO was not allocated. When accessing the page, userspace processes will crash. Enforce that the allocation works. Signed-off-by: Thomas Weißschuh --- arch/x86/um/vdso/vma.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/arch/x86/um/vdso/vma.c b/arch/x86/um/vdso/vma.c index dc8dfb2abd80..51a2b9f2eca9 100644 --- a/arch/x86/um/vdso/vma.c +++ b/arch/x86/um/vdso/vma.c @@ -10,7 +10,6 @@ #include #include -static unsigned int __read_mostly vdso_enabled = 1; unsigned long um_vdso_addr; static struct page *um_vdso; @@ -25,17 +24,11 @@ static int __init init_vdso(void) um_vdso = alloc_page(GFP_KERNEL); if (!um_vdso) - goto oom; + panic("Cannot allocate vdso\n"); copy_page(page_address(um_vdso), vdso_start); return 0; - -oom: - printk(KERN_ERR "Cannot allocate vdso\n"); - vdso_enabled = 0; - - return -ENOMEM; } subsys_initcall(init_vdso); @@ -48,9 +41,6 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) .pages = &um_vdso, }; - if (!vdso_enabled) - return 0; - if (mmap_write_lock_killable(mm)) return -EINTR; From patchwork Mon Oct 13 10:40:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 2149193 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=M+J9doAn; dkim=pass (1024-bit key; unprotected) header.d=weissschuh.net header.i=@weissschuh.net header.a=rsa-sha256 header.s=mail header.b=C/IUQwJR; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4clYlp14MHz1yHw for ; Mon, 13 Oct 2025 21:40:37 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SaOiceD8AzIEGCDQ5kBv+r0GHHl/O1zjqW5YawrIHbs=; b=M+J9doAnmQzbC45Cp9exrapkhS qC04IXF3I+xUA1D/jTu4wjq/wpO7UIcE1s3UmtMIZH+z5zkVmWZKY5K8ErpFofH1B4zXlyzq7UORT WWzoi0AsPxuyoKZtdgtjHzbdChrLzTRyqI6qvAlFS89Yl6g2m5LwLfp5+4A7RRNCcvk4PUo412oKL vlKAcfP8AP6lkukMzz3J0PbG12P89zrheKZPpQeRT+OX13SC6Uw0aRnyfVeG+8lbV8GHrXJbl2kk0 U0mfPpRZvxbV/ibjtxmzuKejRsnvz3vY/TC1ZM4HKlFNqGxcJGS1YvSUneooMeTa+Z5YM4RrcYH2R 9UIxAq4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v8Fym-0000000Cv9X-1Qui; Mon, 13 Oct 2025 10:40:36 +0000 Received: from todd.t-8ch.de ([2a01:4f8:c010:41de::1]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1v8Fyj-0000000Cv58-3k4c for linux-um@lists.infradead.org; Mon, 13 Oct 2025 10:40:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1760352024; bh=fzbFR5HRnGrKHRndRJ8HHP3IHBABgYcit+jrA4C+kmQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=C/IUQwJRljYYCG64In1mr1nBxn9Tmc/5hOpZiMh09bqkYMVVIFFirEqV+s66BiwcS /PZlG7UCuvio8IhpNmitlH2pvfLYu+7G3KxBZHxqATtPFcD+f1Jh0w84XMh4K6COw1 SW+LaqUQkqMUtV1Isj6A3RRL/FzEElq3Vsf/0rI0= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 13 Oct 2025 12:40:21 +0200 Subject: [PATCH 4/4] x86/um/vdso: Drop VDSO64-y from Makefile MIME-Version: 1.0 Message-Id: <20251013-uml-vdso-cleanup-v1-4-a079c7adcc69@weissschuh.net> References: <20251013-uml-vdso-cleanup-v1-0-a079c7adcc69@weissschuh.net> In-Reply-To: <20251013-uml-vdso-cleanup-v1-0-a079c7adcc69@weissschuh.net> To: Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?q?Th?= =?utf-8?q?omas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1760352023; l=749; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=fzbFR5HRnGrKHRndRJ8HHP3IHBABgYcit+jrA4C+kmQ=; b=oTuqtMKWBTQHe1Og6mGe7pRgLqIMi3izMEb85Zh1vxzG84LlxI8l3H7Rp3s14EZTLfbcb5KzH H3XYP1eH6S6B3wX0SQEBZCcMsonIIQAMT74yuPXPlK5isdMR19SfGO3 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251013_034034_076210_C90A0ECF X-CRM114-Status: UNSURE ( 7.67 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__This_symbol_is_unnecessary=2C_remove_i?= =?unknown-8bit?q?t=2E_Signed-off-by=3A_Thomas?= =?unknown-8bit?q?_Wei=C3=9Fschuh_=3Clinux=40weissschuh=2Enet=3E_---_arch/x86?= =?unknown-8bit?q?/um/vdso/Makefile_=7C_7_++-----?= =?unknown-8bit?q?_1_file_changed=2C_2_insertions=28+=29=2C_5_deletions=28-?= =?unknown-8bit?q?=29_diff_--git_a/arch/x86/um/vdso/Makefile?= =?unknown-8bit?q?_b/arch/x86/um/vdso/Makefile_index_7478d11dacb7=2E=2E8a7c8b?= =?unknown-8bit?q?37cb6e_100644_---_a/arch/x86/um/vdso/Makefile?= =?unknown-8bit?q?_+++_b/arch/x86/um/vdso/Makefile_=40=40_-3=2C16_+3=2C13_=40?= =?unknown-8bit?q?=40_=23_Building_=5B=2E=2E=2E=5D_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=28-2=2E1_points=2C_5=2E0_re?= =?unknown-8bit?q?quired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from_author=27s?= =?unknown-8bit?q?_domain?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= =?unknown-8bit?q?_-1=2E9_BAYES=5F00_______________BODY=3A_Bayes_spam_probabi?= =?unknown-8bit?q?lity_is_0_to_1=25?= =?unknown-8bit?q?_=5Bscore=3A_0=2E0000=5D?= X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This symbol is unnecessary, remove it. Signed-off-by: Thomas Weißschuh --- arch/x86/um/vdso/Makefile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86/um/vdso/Makefile b/arch/x86/um/vdso/Makefile index 7478d11dacb7..8a7c8b37cb6e 100644 --- a/arch/x86/um/vdso/Makefile +++ b/arch/x86/um/vdso/Makefile @@ -3,16 +3,13 @@ # Building vDSO images for x86. # -VDSO64-y := y - -vdso-install-$(VDSO64-y) += vdso.so - +vdso-install-y += vdso.so # files to link into the vdso vobjs-y := vdso-note.o um_vdso.o # files to link into kernel -obj-$(VDSO64-y) += vdso.o vma.o +obj-y += vdso.o vma.o vobjs := $(foreach F,$(vobjs-y),$(obj)/$F)