From nobody Tue Feb 10 11:56:27 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19CA2303A00 for ; Mon, 13 Oct 2025 10:48:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760352508; cv=none; b=EtoGrlLa3Jh0uyezafGluFT+UVn0r21SGof+uFaBWbKmXwC12ch09ohQG6AgEqsdrE1yVusA0QpMrLgpidP6sCAqrq9/Y9XK3YNYfK+63xpmvoqYlimUAmU/ywdBP2VDlSR5YN1g9kxV8W+fLNu4aRLA294/XIGhzGfOZQXwjeA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760352508; c=relaxed/simple; bh=4oJNqNidl2yJO66qwAhbfNuPC9Nd39kyLTxqx4jOV1A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eqktGMFj3oaOjypl/a/G5M1qXwb5yhXCAWGV8FgBe1p0HQlSug1wSB29mMlEx88L4py7Eh8b4F2Yayk6KpWST81hlorVQVsISHQQjVuZsKxf32/vgMIwGXPvJwkaD+I4Z1FWw53/fFqWP/tZuLbIF/pwOC84wyeq5EBwWTFdzoo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=tbCze3m1; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="tbCze3m1" 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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?Thomas_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= 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=C3=9Fschuh --- 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 =20 -static unsigned int __read_mostly vdso_enabled =3D 1; unsigned long um_vdso_addr; static struct page *um_vdso; =20 @@ -25,17 +24,11 @@ static int __init init_vdso(void) =20 um_vdso =3D alloc_page(GFP_KERNEL); if (!um_vdso) - goto oom; + panic("Cannot allocate vdso\n"); =20 copy_page(page_address(um_vdso), vdso_start); =20 return 0; - -oom: - printk(KERN_ERR "Cannot allocate vdso\n"); - vdso_enabled =3D 0; - - return -ENOMEM; } subsys_initcall(init_vdso); =20 @@ -48,9 +41,6 @@ int arch_setup_additional_pages(struct linux_binprm *bprm= , int uses_interp) .pages =3D &um_vdso, }; =20 - if (!vdso_enabled) - return 0; - if (mmap_write_lock_killable(mm)) return -EINTR; =20 --=20 2.51.0