| Message ID | 20251013-uml-vdso-cleanup-v1-3-a079c7adcc69@weissschuh.net |
|---|---|
| State | Accepted |
| Headers | show
Return-Path: <linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> 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 <incoming@patchwork.ozlabs.org>; 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?= <linux@weissschuh.net> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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 <richard@nod.at>, Anton Ivanov <anton.ivanov@cambridgegreys.com>, Johannes Berg <johannes@sipsolutions.net>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com> Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?q?Th?= =?utf-8?q?omas_Wei=C3=9Fschuh?= <linux@weissschuh.net> 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: <linux-um.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-um>, <mailto:linux-um-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-um/> List-Post: <mailto:linux-um@lists.infradead.org> List-Help: <mailto:linux-um-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-um>, <mailto:linux-um-request@lists.infradead.org?subject=subscribe> Sender: "linux-um" <linux-um-bounces@lists.infradead.org> Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
| Series |
x86/um/vdso: Cleanups
|
expand
|
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 <asm/elf.h> #include <linux/init.h> -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;
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 <linux@weissschuh.net> --- arch/x86/um/vdso/vma.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)