From nobody Mon Feb 9 06:50:54 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 706692EE617 for ; Tue, 28 Oct 2025 09:17:22 +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=1761643044; cv=none; b=b86oFBz2prSdjVZHG8T59A1R8Xk5iPXAxCPDmor79ma8NsL5BSqaPrBNoNCTmdZ03lDYlEBeJee966RC5NINEJ8S1IMac/BXQn4YFmUb+FjiR7wtbKToatafRFTPGgIdYFuwJE4tUXsZrGMrq7rL1vjtIx6orKasJj94YWewSEI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761643044; c=relaxed/simple; bh=wVCfXhX9gFOuIM1xQSYX/MuDADsnjta9ksjbCV8j1aI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tgI0Twoes1K9J7dHZoeJI8sebAjRU+wBTWEc83ihOM2Sh/P45SM+13+HGcOGM+Cm++Sg+h/DpgcEJhvZParxIBb7a4i1+jLFK4fOqrGAUHBpAeIgResC4+riTDgF1871yEHmG6JmKmv1l3ZBf7TKaVtM8WopiFzFY3f6NXd//HQ= 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=A7PL0Uet; 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="A7PL0Uet" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1761643037; bh=wVCfXhX9gFOuIM1xQSYX/MuDADsnjta9ksjbCV8j1aI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=A7PL0Uetb0vlc4ijKa9jjavmz5+neq80T0IwIUe00l43iq8uhX14/EuBt+ppWAmDl KUf0q8mnw6o2DB3eCoB98duMuZSTfwBSxMkqpziZzyXFjCEzZw2205LxAL7wXOtD3W 32oxXXyxHPoHZBqibMOS/9ma5dHYKOaK9T1jjWzo= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 28 Oct 2025 10:15:36 +0100 Subject: [PATCH 01/10] um: Split out default elf_aux_platform 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: <20251028-uml-remove-32bit-pseudo-vdso-v1-1-e930063eff5f@weissschuh.net> References: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> In-Reply-To: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> To: Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Kees Cook Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1761643036; l=1040; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=wVCfXhX9gFOuIM1xQSYX/MuDADsnjta9ksjbCV8j1aI=; b=LhVFRghTmmP714gZhBulmaoihKd0f0VHzMs3eM+Bz2Cmqsv3SkDHbn+Naifonr7vh0qOBz1qm +z67DoHCAyeBU8AmUiQXuyNKzejI1lEP2jTG2CUIC4+3TqOBckzoq7J X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Setting all auxiliary vector values to default values if one of them was not provided by the host will discard perfectly fine values. Move the elf_aux_platform fallback to its own conditional. Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/um/os-Linux/elf_aux.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/um/os-Linux/elf_aux.c b/arch/um/os-Linux/elf_aux.c index 0a0f91cf4d6d..a62fe39e85c9 100644 --- a/arch/um/os-Linux/elf_aux.c +++ b/arch/um/os-Linux/elf_aux.c @@ -62,14 +62,16 @@ __init void scan_elf_aux( char **envp) } } if ( ! __kernel_vsyscall || ! vsyscall_ehdr || - ! elf_aux_hwcap || ! elf_aux_platform || + ! elf_aux_hwcap || ! page_size || (vsyscall_ehdr % page_size) ) { __kernel_vsyscall =3D 0; vsyscall_ehdr =3D 0; elf_aux_hwcap =3D 0; - elf_aux_platform =3D "i586"; } else { vsyscall_end =3D vsyscall_ehdr + page_size; } + + if (!elf_aux_platform) + elf_aux_platform =3D "i586"; } --=20 2.51.1.dirty From nobody Mon Feb 9 06:50:54 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 D5C192F616B for ; Tue, 28 Oct 2025 09:17:21 +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=1761643043; cv=none; b=DlsI5s4mownEZUCFi43PxNnxLJZpaWCGWPBhfUkARHP0Eunsmm06Eyq+20KyF04QAfCaUOMtbeVcRsDDrpmEBEAMzqnenVn2sPpLxExRq60iARnvFSvVMSZNUZ43hhh6kgbZm4/PycqT8gegJfCB7S60VU9Xg0Q0lh48VBblBig= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761643043; c=relaxed/simple; bh=YqbPywoFtgBAhJ6lpmIQMDms46YwcEmQamcwJS8MPbA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=m7ExysZoLNxY/vHAXXPtSKVYZGH6T7LmjmeXnkN3z6iTK6wEfNrSrQcQxMY/Krj2prTlBwHWbOfiG9/azW6KTzcrz7739DKz22kZUgseWb9dGWdxdyGQqr9oSJ6FNElRiuK5zHFupqD9Id/nBwdYRisGx/33l/GEQh5MJzfBY/4= 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=CE5XHoGR; 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="CE5XHoGR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1761643038; bh=YqbPywoFtgBAhJ6lpmIQMDms46YwcEmQamcwJS8MPbA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=CE5XHoGRDOoEaApc47qhv03YYfsONq7VVJBZYwGRaTvmwBAKafmHL//ik2DKXPkzf gmwMlPdlLoBW9Pslfdm3bV3rdqFBhSGicrpArS95CHSqRb+3j7c2ofH6sBIUnJNaYX IC6g6scpP8vwjDCqa6dH6izhO9s5oDYMgFcnwOeA= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 28 Oct 2025 10:15:37 +0100 Subject: [PATCH 02/10] x86/um: Move ELF_PLATFORM fallback to x86-specific code 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: <20251028-uml-remove-32bit-pseudo-vdso-v1-2-e930063eff5f@weissschuh.net> References: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> In-Reply-To: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> To: Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Kees Cook Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1761643036; l=1152; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=YqbPywoFtgBAhJ6lpmIQMDms46YwcEmQamcwJS8MPbA=; b=E3/22t0NPJGkRhdvBg2Xoo5C1xY8YBwldw9w21HcwS212L3vjfQkTyETGfgzLIK9fKxWFFmwW ah2FjRnmpmfB6dME8TsAbEtIgVmUPZDKctooDkcmJY7upgfRJ4JUimC X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The generic UM code should not have references to x86-specific value. Move the fallback into the x86-specific header. Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/um/os-Linux/elf_aux.c | 3 --- arch/x86/um/asm/elf.h | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/um/os-Linux/elf_aux.c b/arch/um/os-Linux/elf_aux.c index a62fe39e85c9..4aadb9ea5ae3 100644 --- a/arch/um/os-Linux/elf_aux.c +++ b/arch/um/os-Linux/elf_aux.c @@ -71,7 +71,4 @@ __init void scan_elf_aux( char **envp) else { vsyscall_end =3D vsyscall_ehdr + page_size; } - - if (!elf_aux_platform) - elf_aux_platform =3D "i586"; } diff --git a/arch/x86/um/asm/elf.h b/arch/x86/um/asm/elf.h index 62ed5d68a978..e7a045e01471 100644 --- a/arch/x86/um/asm/elf.h +++ b/arch/x86/um/asm/elf.h @@ -69,7 +69,8 @@ } while (0); =20 extern char * elf_aux_platform; -#define ELF_PLATFORM (elf_aux_platform) +#define ELF_PLATFORM_FALLBACK "i586" +#define ELF_PLATFORM (elf_aux_platform ?: ELF_PLATFORM_FALLBACK) =20 extern unsigned long vsyscall_ehdr; extern unsigned long vsyscall_end; --=20 2.51.1.dirty From nobody Mon Feb 9 06:50:54 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 49AE62FD696 for ; Tue, 28 Oct 2025 09:17:20 +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=1761643042; cv=none; b=Da/E2MAge0Zp/ZZy2zkp7qg6Luy3C4kGxwlkn2xGpYmp26bQLzpnP9+cI83siXh6t4vFvQdi9Tgmqrxv6UezUcVCfmZE3gLjsg5Eulq4givyGxyzKMpEfTmX315woOxGMCwzLy6S19YHuSV5Ix37zHuAYVCIStg+5W2FUGbVYBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761643042; c=relaxed/simple; bh=pLpK9WMmHxQL+UmXL2BRNL9YHlr3HJAmGpPpWZh9za0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=E33IPIWHTdfw4L6Vq+qsGX8oXZ9mH/5/B8qJl8EUCe2buXowuN9Y7T9VxOD87jRHTx3s+TTDat6jqhk962ZcBlZcW2cfjRK40B1X3F7hvrF4msF6ovm3HRX/xvyAyWTPMyGIMUqlEwxGm8tg0za8LizSzuVRU7chrlMuXUUgULk= 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=U+a6P211; 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="U+a6P211" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1761643037; bh=pLpK9WMmHxQL+UmXL2BRNL9YHlr3HJAmGpPpWZh9za0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=U+a6P211/4XvUxWAKsYQOUFks4HNaWzQk8OLSQf9m41OMxtrAQAM4Bw89Ces0WUiX v0AHKlr7R/J5zIR02pXLsR95jwlpU7cs9/lmyuvXp6pFW5X9JIFdzeidNG9xyOlrHO 2uNN9h3tYOgq87JRV/pzbYC8noegWMFq7VlBTxdE= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 28 Oct 2025 10:15:38 +0100 Subject: [PATCH 03/10] um: Split out default elf_aux_hwcap 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: <20251028-uml-remove-32bit-pseudo-vdso-v1-3-e930063eff5f@weissschuh.net> References: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> In-Reply-To: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> To: Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Kees Cook Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1761643036; l=941; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=pLpK9WMmHxQL+UmXL2BRNL9YHlr3HJAmGpPpWZh9za0=; b=O5gJ+jOwEsAHrk5KZPP4TwQau/fdz95vgKIKxfOYVp6/PV/ok0lwndsYaEsJfWY4HcGigVgsg LyWjDLG7c/TBFz9ODtVE6y69f4yeLZPtk2aonTCktjVxwFlAwClOMI2 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Setting all auxiliary vector values to default values if one of them was not provided by the host will discard perfectly fine values. Remove the elf_aux_platform fallback from the vDSO ones. As zero is the correct fallback anyways, don't create a new conditional. Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/um/os-Linux/elf_aux.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/um/os-Linux/elf_aux.c b/arch/um/os-Linux/elf_aux.c index 4aadb9ea5ae3..9ee0e3199790 100644 --- a/arch/um/os-Linux/elf_aux.c +++ b/arch/um/os-Linux/elf_aux.c @@ -62,11 +62,9 @@ __init void scan_elf_aux( char **envp) } } if ( ! __kernel_vsyscall || ! vsyscall_ehdr || - ! elf_aux_hwcap || ! page_size || (vsyscall_ehdr % page_size) ) { __kernel_vsyscall =3D 0; vsyscall_ehdr =3D 0; - elf_aux_hwcap =3D 0; } else { vsyscall_end =3D vsyscall_ehdr + page_size; --=20 2.51.1.dirty From nobody Mon Feb 9 06:50:54 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 E9A88261B99 for ; Tue, 28 Oct 2025 09:17:20 +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=1761643042; cv=none; b=RSbpFSyyl3b5Yn9KLCQwWUGo0+W17lMF5B3qCxxMdHftyNCpP01X9Vd1wxo0yu+lLrL85U+KT6TgbJ+VjQFSMNmwaXnYxjPwDCN9mIfq9M2no5fFg+cQYtZpwpq5bweH6zVGVq+AkMLH/fXTbdCJCwOGxBfJKqdOObnqw76tGrY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761643042; c=relaxed/simple; bh=cyZyLundsyMK8gnrV8YrT8OZRfND/4ZKZAJIIljhbPk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GDiTUexQIHvz8uhfN8dUaUw50+wdy5cyKxBjcjW/bLbixKINqAwGm1owX0j6E3XcrSfYYLyQKQs7WhWxWYL+8PksSk1IrBvtjTaaWtb3n2NXQP2mcfjipxKunORsR44BXrndF10Ndxj0t1TE0shYh7WnIORVoMGuFlYGknaMPvQ= 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=fOcEPXGU; 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="fOcEPXGU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1761643037; bh=cyZyLundsyMK8gnrV8YrT8OZRfND/4ZKZAJIIljhbPk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=fOcEPXGUde//TsAO89amRNfwk5vWdNVZYP+aINNzg7rgHGEX2bDHMTBjLH3TtKGFK Kfxb8beObEbV9UDf8PxXAbWah1gfqirT5lfg8X8kpKypwItBTK7eXx8G2XZBHI+tAT RU+j41JM3dcNxrsnz7E9s/vpjuUXU3Mw3KPPRRFM= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 28 Oct 2025 10:15:39 +0100 Subject: [PATCH 04/10] x86/um: Do not inherit vDSO from host 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: <20251028-uml-remove-32bit-pseudo-vdso-v1-4-e930063eff5f@weissschuh.net> References: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> In-Reply-To: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> To: Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Kees Cook Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1761643036; l=7417; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=cyZyLundsyMK8gnrV8YrT8OZRfND/4ZKZAJIIljhbPk=; b=ErJu3hMj+Bqp4vF/M1+WxLQlIk5OXTslG7g273YGeACre+TpEugV839ttL9O5pU9rApJw0PoY XrePoO60HNiANfsfcDOlfyYLgfmuAiPahGEaDHecL2nvssfzBLDgjok X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Inheriting the vDSO from the host is problematic. The values read from the time functions will not be correct for the UML kernel. Furthermore the start and end of the vDSO are not stable or detectable by userspace. Specifically the vDSO datapages start before AT_SYSINFO_EHDR and the vDSO itself is larger than a single page. This codepath is only used on 32bit x86 UML. In my testing with both 32bit and 64bit hosts the passthrough functionality has always been disabled anyways due to the checks against envp in scan_elf_aux(). Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/um/os-Linux/elf_aux.c | 27 --------------- arch/um/os-Linux/user_syms.c | 6 ---- arch/x86/um/Kconfig | 1 - arch/x86/um/Makefile | 1 - arch/x86/um/asm/elf.h | 29 ++-------------- arch/x86/um/elfcore.c | 78 ----------------------------------------= ---- 6 files changed, 3 insertions(+), 139 deletions(-) diff --git a/arch/um/os-Linux/elf_aux.c b/arch/um/os-Linux/elf_aux.c index 9ee0e3199790..f8927a5959d8 100644 --- a/arch/um/os-Linux/elf_aux.c +++ b/arch/um/os-Linux/elf_aux.c @@ -20,31 +20,15 @@ typedef Elf32_auxv_t elf_auxv_t; /* These are initialized very early in boot and never changed */ char * elf_aux_platform; extern long elf_aux_hwcap; -unsigned long vsyscall_ehdr; -unsigned long vsyscall_end; -unsigned long __kernel_vsyscall; =20 __init void scan_elf_aux( char **envp) { - long page_size =3D 0; elf_auxv_t * auxv; =20 while ( *envp++ !=3D NULL) ; =20 for ( auxv =3D (elf_auxv_t *)envp; auxv->a_type !=3D AT_NULL; auxv++) { switch ( auxv->a_type ) { - case AT_SYSINFO: - __kernel_vsyscall =3D auxv->a_un.a_val; - /* See if the page is under TASK_SIZE */ - if (__kernel_vsyscall < (unsigned long) envp) - __kernel_vsyscall =3D 0; - break; - case AT_SYSINFO_EHDR: - vsyscall_ehdr =3D auxv->a_un.a_val; - /* See if the page is under TASK_SIZE */ - if (vsyscall_ehdr < (unsigned long) envp) - vsyscall_ehdr =3D 0; - break; case AT_HWCAP: elf_aux_hwcap =3D auxv->a_un.a_val; break; @@ -56,17 +40,6 @@ __init void scan_elf_aux( char **envp) elf_aux_platform =3D (char *) (long) auxv->a_un.a_val; break; - case AT_PAGESZ: - page_size =3D auxv->a_un.a_val; - break; } } - if ( ! __kernel_vsyscall || ! vsyscall_ehdr || - ! page_size || (vsyscall_ehdr % page_size) ) { - __kernel_vsyscall =3D 0; - vsyscall_ehdr =3D 0; - } - else { - vsyscall_end =3D vsyscall_ehdr + page_size; - } } diff --git a/arch/um/os-Linux/user_syms.c b/arch/um/os-Linux/user_syms.c index a310ae27b479..67f6112318b6 100644 --- a/arch/um/os-Linux/user_syms.c +++ b/arch/um/os-Linux/user_syms.c @@ -31,12 +31,6 @@ extern void *memset(void *, int, size_t); EXPORT_SYMBOL(memset); #endif =20 -#ifdef CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA -/* needed for __access_ok() */ -EXPORT_SYMBOL(vsyscall_ehdr); -EXPORT_SYMBOL(vsyscall_end); -#endif - #ifdef _FORTIFY_SOURCE extern int __sprintf_chk(char *str, int flag, size_t len, const char *form= at); EXPORT_SYMBOL(__sprintf_chk); diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig index c52fb5cb8d21..798c6cc53e82 100644 --- a/arch/x86/um/Kconfig +++ b/arch/x86/um/Kconfig @@ -8,7 +8,6 @@ endmenu =20 config UML_X86 def_bool y - select ARCH_BINFMT_ELF_EXTRA_PHDRS if X86_32 select ARCH_USE_QUEUED_RWLOCKS select ARCH_USE_QUEUED_SPINLOCKS select DCACHE_WORD_ACCESS diff --git a/arch/x86/um/Makefile b/arch/x86/um/Makefile index b42c31cd2390..1767e6061b4d 100644 --- a/arch/x86/um/Makefile +++ b/arch/x86/um/Makefile @@ -18,7 +18,6 @@ obj-y =3D bugs_$(BITS).o delay.o fault.o \ ifeq ($(CONFIG_X86_32),y) =20 obj-y +=3D syscalls_32.o -obj-$(CONFIG_ELF_CORE) +=3D elfcore.o =20 subarch-y =3D ../lib/string_32.o ../lib/atomic64_32.o ../lib/atomic64_cx8_= 32.o subarch-y +=3D ../lib/cmpxchg8b_emu.o ../lib/atomic64_386_32.o diff --git a/arch/x86/um/asm/elf.h b/arch/x86/um/asm/elf.h index e7a045e01471..8d7df4684c38 100644 --- a/arch/x86/um/asm/elf.h +++ b/arch/x86/um/asm/elf.h @@ -72,32 +72,9 @@ extern char * elf_aux_platform; #define ELF_PLATFORM_FALLBACK "i586" #define ELF_PLATFORM (elf_aux_platform ?: ELF_PLATFORM_FALLBACK) =20 -extern unsigned long vsyscall_ehdr; -extern unsigned long vsyscall_end; -extern unsigned long __kernel_vsyscall; - -/* - * This is the range that is readable by user mode, and things - * acting like user mode such as get_user_pages. - */ -#define FIXADDR_USER_START vsyscall_ehdr -#define FIXADDR_USER_END vsyscall_end - - -/* - * Architecture-neutral AT_ values in 0-17, leave some room - * for more of them, start the x86-specific ones at 32. - */ -#define AT_SYSINFO 32 -#define AT_SYSINFO_EHDR 33 - -#define ARCH_DLINFO \ -do { \ - if ( vsyscall_ehdr ) { \ - NEW_AUX_ENT(AT_SYSINFO, __kernel_vsyscall); \ - NEW_AUX_ENT(AT_SYSINFO_EHDR, vsyscall_ehdr); \ - } \ -} while (0) +/* No user-accessible fixmap addresses, i.e. vsyscall */ +#define FIXADDR_USER_START 0 +#define FIXADDR_USER_END 0 =20 #else =20 diff --git a/arch/x86/um/elfcore.c b/arch/x86/um/elfcore.c deleted file mode 100644 index ef50662fc40d..000000000000 --- a/arch/x86/um/elfcore.c +++ /dev/null @@ -1,78 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include -#include -#include -#include -#include - -#include - - -Elf32_Half elf_core_extra_phdrs(struct coredump_params *cprm) -{ - return vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0; -} - -int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset) -{ - if ( vsyscall_ehdr ) { - const struct elfhdr *const ehdrp =3D - (struct elfhdr *) vsyscall_ehdr; - const struct elf_phdr *const phdrp =3D - (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); - int i; - Elf32_Off ofs =3D 0; - - for (i =3D 0; i < ehdrp->e_phnum; ++i) { - struct elf_phdr phdr =3D phdrp[i]; - - if (phdr.p_type =3D=3D PT_LOAD) { - ofs =3D phdr.p_offset =3D offset; - offset +=3D phdr.p_filesz; - } else { - phdr.p_offset +=3D ofs; - } - phdr.p_paddr =3D 0; /* match other core phdrs */ - if (!dump_emit(cprm, &phdr, sizeof(phdr))) - return 0; - } - } - return 1; -} - -int elf_core_write_extra_data(struct coredump_params *cprm) -{ - if ( vsyscall_ehdr ) { - const struct elfhdr *const ehdrp =3D - (struct elfhdr *) vsyscall_ehdr; - const struct elf_phdr *const phdrp =3D - (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); - int i; - - for (i =3D 0; i < ehdrp->e_phnum; ++i) { - if (phdrp[i].p_type =3D=3D PT_LOAD) { - void *addr =3D (void *) phdrp[i].p_vaddr; - size_t filesz =3D phdrp[i].p_filesz; - if (!dump_emit(cprm, addr, filesz)) - return 0; - } - } - } - return 1; -} - -size_t elf_core_extra_data_size(struct coredump_params *cprm) -{ - if ( vsyscall_ehdr ) { - const struct elfhdr *const ehdrp =3D - (struct elfhdr *)vsyscall_ehdr; - const struct elf_phdr *const phdrp =3D - (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); - int i; - - for (i =3D 0; i < ehdrp->e_phnum; ++i) - if (phdrp[i].p_type =3D=3D PT_LOAD) - return (size_t) phdrp[i].p_filesz; - } - return 0; -} --=20 2.51.1.dirty From nobody Mon Feb 9 06:50:54 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 D4F643016F7 for ; Tue, 28 Oct 2025 09:17: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=1761643045; cv=none; b=BOg75wU8GEGW4iNCfhdn6ErD/SKhdI8O78TohQR/vqKWGnMpRARA+1FEmiJm0kkkXwLosOjjVof/pNSjmx0zFldzMVZs9JVS6hXFFGx1nHTHKWrsbVJlm4sp/I7Mjnev26tb8qBdR3YH0JLl8KpGUduq2lHW+Kpb0Z8WhYzgZbA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761643045; c=relaxed/simple; bh=vszDF/cx4qHYXXIt4CCpd4y86yZhshQ+o4PVe1g7Y50=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OEhZdBt5rjXE5nux+TYUAiIUlBNYtWAa25wdhQH/7L2ie5EodL2dVsTnyfI+h03rfkbqzpplwHHLx2zs7E51y6I8xvbaYiM7F4wka8taLfEcZXehcMDrjTNs7k8I6mvZdQjfMz/IZk8aP18UgKWbV/OmukFfS8DwM6ecNOf9Rpo= 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=g4iOmek2; 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="g4iOmek2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1761643038; bh=vszDF/cx4qHYXXIt4CCpd4y86yZhshQ+o4PVe1g7Y50=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=g4iOmek2Pwb6uaHO9W+u8eso4VNQkDSU25wRqBElFVpQ8AW3A2IfvYY4xFaRdfeK6 zEYDZMZis6+oV/rFJ2NiXsUZGNdNOvetfhbmxtX9XJLFGpk9Pzfe6Yir6auEGfA+Be 3DzYkFALhdgDxn8UbMJq0+NthKJSN9gSw7gyLDRw= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 28 Oct 2025 10:15:40 +0100 Subject: [PATCH 05/10] x86/um: Drop gate area handling 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: <20251028-uml-remove-32bit-pseudo-vdso-v1-5-e930063eff5f@weissschuh.net> References: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> In-Reply-To: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> To: Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Kees Cook Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1761643036; l=2787; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=vszDF/cx4qHYXXIt4CCpd4y86yZhshQ+o4PVe1g7Y50=; b=o4JmUMvwtaLOa6D398C8FcQZo9AegfjrZ0mzUtV8o6ruPGtlXeeSvSB1/HNV+nBp+yjVHkJSq 0+5+Nf0zAGFCVqYDRn7QlgelnwkKGaCgWpd/sXbvXYOnmwS3ORxXiCa X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= With the removal of the vDSO passthrough from the host, FIXADDR_USER_START is always 0 and the gate area setup code is dead. Remove it. Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/um/include/asm/page.h | 4 ---- arch/x86/um/Makefile | 4 ++-- arch/x86/um/mem_32.c | 50 ------------------------------------------= ---- 3 files changed, 2 insertions(+), 56 deletions(-) diff --git a/arch/um/include/asm/page.h b/arch/um/include/asm/page.h index 6f54254aaf44..2d363460d896 100644 --- a/arch/um/include/asm/page.h +++ b/arch/um/include/asm/page.h @@ -96,8 +96,4 @@ extern unsigned long uml_physmem; =20 #endif /* __ASSEMBLER__ */ =20 -#ifdef CONFIG_X86_32 -#define __HAVE_ARCH_GATE_AREA 1 -#endif - #endif /* __UM_PAGE_H */ diff --git a/arch/x86/um/Makefile b/arch/x86/um/Makefile index 1767e6061b4d..f9ea75bf43ac 100644 --- a/arch/x86/um/Makefile +++ b/arch/x86/um/Makefile @@ -13,7 +13,7 @@ obj-y =3D bugs_$(BITS).o delay.o fault.o \ ptrace.o ptrace_$(BITS).o ptrace_user.o setjmp_$(BITS).o signal.o \ stub_segv.o \ sys_call_table_$(BITS).o sysrq_$(BITS).o tls_$(BITS).o \ - mem_$(BITS).o subarch.o os-Linux/ + subarch.o os-Linux/ =20 ifeq ($(CONFIG_X86_32),y) =20 @@ -26,7 +26,7 @@ subarch-y +=3D ../kernel/sys_ia32.o =20 else =20 -obj-y +=3D syscalls_64.o vdso/ +obj-y +=3D mem_64.o syscalls_64.o vdso/ =20 subarch-y =3D ../lib/csum-partial_64.o ../lib/memcpy_64.o \ ../lib/memmove_64.o ../lib/memset_64.o diff --git a/arch/x86/um/mem_32.c b/arch/x86/um/mem_32.c deleted file mode 100644 index 29b2203bc82c..000000000000 --- a/arch/x86/um/mem_32.c +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (C) 2011 Richard Weinberger - */ - -#include -#include - -static struct vm_area_struct gate_vma; - -static int __init gate_vma_init(void) -{ - if (!FIXADDR_USER_START) - return 0; - - vma_init(&gate_vma, NULL); - gate_vma.vm_start =3D FIXADDR_USER_START; - gate_vma.vm_end =3D FIXADDR_USER_END; - vm_flags_init(&gate_vma, VM_READ | VM_MAYREAD | VM_EXEC | VM_MAYEXEC); - gate_vma.vm_page_prot =3D PAGE_READONLY; - - return 0; -} -__initcall(gate_vma_init); - -struct vm_area_struct *get_gate_vma(struct mm_struct *mm) -{ - return FIXADDR_USER_START ? &gate_vma : NULL; -} - -int in_gate_area_no_mm(unsigned long addr) -{ - if (!FIXADDR_USER_START) - return 0; - - if ((addr >=3D FIXADDR_USER_START) && (addr < FIXADDR_USER_END)) - return 1; - - return 0; -} - -int in_gate_area(struct mm_struct *mm, unsigned long addr) -{ - struct vm_area_struct *vma =3D get_gate_vma(mm); - - if (!vma) - return 0; - - return (addr >=3D vma->vm_start) && (addr < vma->vm_end); -} --=20 2.51.1.dirty From nobody Mon Feb 9 06:50:54 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 B3BB7302747 for ; Tue, 28 Oct 2025 09:17:25 +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=1761643047; cv=none; b=uYU8FVreETLYroGQGwwbixXuoj+Ogf217MI/JQdTDWiJEsp7ELpbIDhuJyDn46spRF0aomiX1XWezlWfb1Soxc7vWHBBPbffAHBlKg9QBmUrPfTSiF3QMqvTPY0KTii76FhbHOQziAlgqw+q1FfyWf8dj3PPX7BsrcIONnQ60lU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761643047; c=relaxed/simple; bh=dydLLqvv9GfPDw2CeThambI3wNtkxs7fMg/amODW+pI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hUSVejGKQDZkfVXMLfnX9fdTECdJ8mo0DGF+L+PXslPxIfH9c9pazBlrCMfD4/oKMiHx53jP7S/xlSDdJHoHWEs7i4uuADFyy99PwDOwlZeBOGzoBr0arb/hKe4keq51OjWaN65Gs8wD06cZZnDUz7wWiRKSPMi67xOoL+ooj3o= 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=f4sGwxQZ; 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="f4sGwxQZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1761643043; bh=dydLLqvv9GfPDw2CeThambI3wNtkxs7fMg/amODW+pI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=f4sGwxQZpk7mblNTexMQtkekFpAHFYAQrtXOCJ/5kdC9miO83xedGgFpC5+8P9VsD FnkEQCobG/Fwu0j2tKtfV8f3JpnF1Hz1cZTD+BrsAXmsD1l2h2dNFnuz3Pn0az+5rg deu3+/bnFxLedVyg7+dkWj1EMj8oZL0QouL3vCOI= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 28 Oct 2025 10:15:41 +0100 Subject: [PATCH 06/10] um: Remove fixaddr_user_init() 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: <20251028-uml-remove-32bit-pseudo-vdso-v1-6-e930063eff5f@weissschuh.net> References: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> In-Reply-To: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> To: Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Kees Cook Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1761643036; l=3743; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=dydLLqvv9GfPDw2CeThambI3wNtkxs7fMg/amODW+pI=; b=FE436oxVhFe82l0jtHD/HvpcwSmrp0Hh5AuY180kd9J+qoZp3cVjbhqXIPrPYxLyuvokqHzrV 9kUcalb4qCOBnlsULjIBymngzXQ+6WLimdvyCFPdni/Bql4qjjT7o2T X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= With the removal of the vDSO passthrough from the host, FIXADDR_USER_START is always 0 and fixaddr_user_init() is dead code. Remove it. Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/um/kernel/mem.c | 107 -----------------------------------------------= ---- 1 file changed, 107 deletions(-) diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index dc938715ec9d..39c4a7e21c6f 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c @@ -84,109 +84,6 @@ void __init mem_init(void) kmalloc_ok =3D 1; } =20 -#if IS_ENABLED(CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA) -/* - * Create a page table and place a pointer to it in a middle page - * directory entry. - */ -static void __init one_page_table_init(pmd_t *pmd) -{ - if (pmd_none(*pmd)) { - pte_t *pte =3D (pte_t *) memblock_alloc_low(PAGE_SIZE, - PAGE_SIZE); - if (!pte) - panic("%s: Failed to allocate %lu bytes align=3D%lx\n", - __func__, PAGE_SIZE, PAGE_SIZE); - - set_pmd(pmd, __pmd(_KERNPG_TABLE + - (unsigned long) __pa(pte))); - BUG_ON(pte !=3D pte_offset_kernel(pmd, 0)); - } -} - -static void __init one_md_table_init(pud_t *pud) -{ -#if CONFIG_PGTABLE_LEVELS > 2 - pmd_t *pmd_table =3D (pmd_t *) memblock_alloc_low(PAGE_SIZE, PAGE_SIZE); - if (!pmd_table) - panic("%s: Failed to allocate %lu bytes align=3D%lx\n", - __func__, PAGE_SIZE, PAGE_SIZE); - - set_pud(pud, __pud(_KERNPG_TABLE + (unsigned long) __pa(pmd_table))); - BUG_ON(pmd_table !=3D pmd_offset(pud, 0)); -#endif -} - -static void __init one_ud_table_init(p4d_t *p4d) -{ -#if CONFIG_PGTABLE_LEVELS > 3 - pud_t *pud_table =3D (pud_t *) memblock_alloc_low(PAGE_SIZE, PAGE_SIZE); - if (!pud_table) - panic("%s: Failed to allocate %lu bytes align=3D%lx\n", - __func__, PAGE_SIZE, PAGE_SIZE); - - set_p4d(p4d, __p4d(_KERNPG_TABLE + (unsigned long) __pa(pud_table))); - BUG_ON(pud_table !=3D pud_offset(p4d, 0)); -#endif -} - -static void __init fixrange_init(unsigned long start, unsigned long end, - pgd_t *pgd_base) -{ - pgd_t *pgd; - p4d_t *p4d; - pud_t *pud; - pmd_t *pmd; - int i, j; - unsigned long vaddr; - - vaddr =3D start; - i =3D pgd_index(vaddr); - j =3D pmd_index(vaddr); - pgd =3D pgd_base + i; - - for ( ; (i < PTRS_PER_PGD) && (vaddr < end); pgd++, i++) { - p4d =3D p4d_offset(pgd, vaddr); - if (p4d_none(*p4d)) - one_ud_table_init(p4d); - pud =3D pud_offset(p4d, vaddr); - if (pud_none(*pud)) - one_md_table_init(pud); - pmd =3D pmd_offset(pud, vaddr); - for (; (j < PTRS_PER_PMD) && (vaddr < end); pmd++, j++) { - one_page_table_init(pmd); - vaddr +=3D PMD_SIZE; - } - j =3D 0; - } -} - -static void __init fixaddr_user_init( void) -{ - long size =3D FIXADDR_USER_END - FIXADDR_USER_START; - pte_t *pte; - phys_t p; - unsigned long v, vaddr =3D FIXADDR_USER_START; - - if (!size) - return; - - fixrange_init( FIXADDR_USER_START, FIXADDR_USER_END, swapper_pg_dir); - v =3D (unsigned long) memblock_alloc_low(size, PAGE_SIZE); - if (!v) - panic("%s: Failed to allocate %lu bytes align=3D%lx\n", - __func__, size, PAGE_SIZE); - - memcpy((void *) v , (void *) FIXADDR_USER_START, size); - p =3D __pa(v); - for ( ; size > 0; size -=3D PAGE_SIZE, vaddr +=3D PAGE_SIZE, - p +=3D PAGE_SIZE) { - pte =3D virt_to_kpte(vaddr); - pte_set_val(*pte, p, PAGE_READONLY); - } -} -#endif - void __init paging_init(void) { unsigned long max_zone_pfn[MAX_NR_ZONES] =3D { 0 }; @@ -199,10 +96,6 @@ void __init paging_init(void) =20 max_zone_pfn[ZONE_NORMAL] =3D high_physmem >> PAGE_SHIFT; free_area_init(max_zone_pfn); - -#if IS_ENABLED(CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA) - fixaddr_user_init(); -#endif } =20 /* --=20 2.51.1.dirty From nobody Mon Feb 9 06:50:54 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 D4E7C3016EB for ; Tue, 28 Oct 2025 09:17: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=1761643045; cv=none; b=gzxxkxCpmWbXmnu1KQwUzwILamHvaBv+XX0omagg79uS7b4SJE5XS6MSdi+e0WrZTcW+u/SZezYZBIKJe6DMLZvZYBDAJx5KMwp6K6E7DZIDEWHqh04cySZErK8Kx0ssI5xFpG97eREsgqWBTXlDU/2IPloArmvinYDY52TKNJ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761643045; c=relaxed/simple; bh=//QBJKcVdfGqAssYU8JT7yXYBZT3MIx6+94MEhcclCI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SQugEm8vpZ92O6ctXdsWzG/nroWs0CIM3rPy7mky6bBbFO4Bip90uCYhqKplvg05Aa3ZSw21WvIj+jBUPxsDphBqFjpqyIIUkwt4Vgr1DOBt0/qiC5tOvKCJqsGB3zR+M49GjdWn+OEaGH9uRzpOWDuGXrHcKkf1BefZjBaaIsA= 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=RkSCx4Jk; 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="RkSCx4Jk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1761643039; bh=//QBJKcVdfGqAssYU8JT7yXYBZT3MIx6+94MEhcclCI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=RkSCx4JkyF5lLQUNeM42rFHtDmCXVpviOOcGrnETa/0HpC4Zdw2nuYjdH/4PFl6LC M37gJsTtA9t48ctKGxpR9J+cgERSI2OA89fLXif/TGCIYqkwtsOm90oGVGKh+3v7/O FWcQuK43JhS2hqil05ihbYlwxNee1T0QddlgMNzU= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 28 Oct 2025 10:15:42 +0100 Subject: [PATCH 07/10] um: Remove redundant range check from __access_ok_vsyscall() 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: <20251028-uml-remove-32bit-pseudo-vdso-v1-7-e930063eff5f@weissschuh.net> References: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> In-Reply-To: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> To: Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Kees Cook Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1761643036; l=919; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=//QBJKcVdfGqAssYU8JT7yXYBZT3MIx6+94MEhcclCI=; b=Pyl9VMqLf2pp8Ulil0iQPsRNz8apL+lyucc74Nzhhix207oGH6tlAC45ZUnY4VWNUjWWKJQcx j1dxaqoDJmUBaathXH3i6r4J3xVGEUN8K6MC7Th5us+FKD8hWjRUdLv X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The only caller __access_ok() is already doing the same check through __addr_range_nowrap(). Remove the redundant check. Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/um/include/asm/uaccess.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/um/include/asm/uaccess.h b/arch/um/include/asm/uaccess.h index 1c6e0ae41b0c..3770bdeee100 100644 --- a/arch/um/include/asm/uaccess.h +++ b/arch/um/include/asm/uaccess.h @@ -17,8 +17,7 @@ =20 #define __access_ok_vsyscall(addr, size) \ (((unsigned long) (addr) >=3D FIXADDR_USER_START) && \ - ((unsigned long) (addr) + (size) <=3D FIXADDR_USER_END) && \ - ((unsigned long) (addr) + (size) >=3D (unsigned long)(addr))) + ((unsigned long) (addr) + (size) <=3D FIXADDR_USER_END)) =20 #define __addr_range_nowrap(addr, size) \ ((unsigned long) (addr) <=3D ((unsigned long) (addr) + (size))) --=20 2.51.1.dirty From nobody Mon Feb 9 06:50:54 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 DD9EE3019DE for ; Tue, 28 Oct 2025 09:17:24 +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=1761643046; cv=none; b=X00N9tNWvNr+vku61gNX4gVKL10ElrD43zwNM+CerOGgN9qamtFpxxjCghvClPvWjouLLxq1kzt30OgmbYDfLbwSuflrKPCHrMz+YGrZXXHeaRFmSkdA+WOdsl+dFy5Z4CgsE94fxJtrCmjuO1JPjBnlZ0xYVpHkrfFzZdlzugg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761643046; c=relaxed/simple; bh=CxIHi84E4Pt5K6l2BuyDuvOD5HSJpAj9jMAXhBrWhPI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=duA4fxRNT6fvnzgNQZoGLlfL7IVQ2rvLQhdYpyt4AWoqqrISLRMMC5u7auwsIRsigje2WWVDHxe9s/mKgSImqYZ2g4umnXaIq7HUtQyjyVHoMYQoxzl+SEVmqJmqzZU9ZrHrVrly9SdDJkg/E1U9prbXMRlt940xwFwnnTTAUPw= 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=KWo7sg0H; 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="KWo7sg0H" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1761643039; bh=CxIHi84E4Pt5K6l2BuyDuvOD5HSJpAj9jMAXhBrWhPI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=KWo7sg0HDLVwuJxbMVa0QVJzurgJIyDK1zw+ebn5phBhr3C7MAG7cMyz7E3fh1y4e avOz7YrsLk6fYH4IO4FdkTI/iNgikB3bVS59fqSLrIm96xlRBup9wuuqLoQcjwrxJc lbH0wPaZH2bjA7cpHu677LiCQ4taEjaAg3HuaoXc= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 28 Oct 2025 10:15:43 +0100 Subject: [PATCH 08/10] um: Remove __access_ok_vsyscall() 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: <20251028-uml-remove-32bit-pseudo-vdso-v1-8-e930063eff5f@weissschuh.net> References: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> In-Reply-To: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> To: Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Kees Cook Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1761643036; l=1320; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=CxIHi84E4Pt5K6l2BuyDuvOD5HSJpAj9jMAXhBrWhPI=; b=indsseQNY5fyzet23byGMfRz3iZPxGotar2HG8qPmnBRDzv8C40nHyUQRT0Da3oxy3nlZoEEs qs0pIYidKlJBq6P+Kh9ASIbrA6/scKN4tp4chTLKNoVkGLy5/Xl70ij X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= FIXADDR_USER_START and FIXADDR_USER_END are now always zero. Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/um/include/asm/uaccess.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/um/include/asm/uaccess.h b/arch/um/include/asm/uaccess.h index 3770bdeee100..0df9ea4abda8 100644 --- a/arch/um/include/asm/uaccess.h +++ b/arch/um/include/asm/uaccess.h @@ -15,10 +15,6 @@ (((unsigned long) (addr) < TASK_SIZE) && \ (((unsigned long) (addr) + (size)) < TASK_SIZE)) =20 -#define __access_ok_vsyscall(addr, size) \ - (((unsigned long) (addr) >=3D FIXADDR_USER_START) && \ - ((unsigned long) (addr) + (size) <=3D FIXADDR_USER_END)) - #define __addr_range_nowrap(addr, size) \ ((unsigned long) (addr) <=3D ((unsigned long) (addr) + (size))) =20 @@ -39,9 +35,7 @@ static inline int __access_ok(const void __user *ptr, uns= igned long size); static inline int __access_ok(const void __user *ptr, unsigned long size) { unsigned long addr =3D (unsigned long)ptr; - return __addr_range_nowrap(addr, size) && - (__under_task_size(addr, size) || - __access_ok_vsyscall(addr, size)); + return __addr_range_nowrap(addr, size) && __under_task_size(addr, size); } =20 #define __get_kernel_nofault(dst, src, type, err_label) \ --=20 2.51.1.dirty From nobody Mon Feb 9 06:50:54 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 BCCC13019DA for ; Tue, 28 Oct 2025 09:17:24 +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=1761643046; cv=none; b=s6lpYqY6bBwXsOFGxC8ya3NDn+MawEoi653HPhf5+ibqxpgEeuwhbm3AdPbPcO9ewPY2rwXxrEKIbpTnSRpM6xU4N7wjf+QCj9BQPsGonRWdh2nExzr9Pq2iEMtf3rHDevBmor7RaBS1JJeuR6qYvDi/x2+jPokxcPakHmvSEx0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761643046; c=relaxed/simple; bh=QvY+nAXDRHky/oaQZhIuoK3hf3WfhaB7cgzN/dQrG7M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oPUujpqD5xoWpSe1FOvi2t8JhFMabG3nrE0Z6RYCv4DGIeitV1xfwbs15Ja0tbBHHRSijoLqnz12jF7aLCLEN/dF4bKtCpd865aQUYV66O0fWADVFufrgLX9anb1mUm8zWjrGeGM4Ex5MrzUNA6+Xrk75mfiJ+oakozP3mViG9g= 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=EMVGtZMP; 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="EMVGtZMP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1761643039; bh=QvY+nAXDRHky/oaQZhIuoK3hf3WfhaB7cgzN/dQrG7M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=EMVGtZMPhsecf5rpkJJ/jcc3uyvDjTFHD2vNe/tl526UmuYjZKm36042T/jZYyorp fvLPcNE5mwYXs0SzI2Et9znl+dcWpVVVSfbmN7Bq3fMSrcw4jQr2MMgH6IjpcKI0z6 1x3jeHenNrFto9cZMgy3jsqz9/MfdcOnj4CBY3Mg= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 28 Oct 2025 10:15:44 +0100 Subject: [PATCH 09/10] x86/um: Remove FIXADDR_USER_START and FIXADDR_USE_END 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: <20251028-uml-remove-32bit-pseudo-vdso-v1-9-e930063eff5f@weissschuh.net> References: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> In-Reply-To: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> To: Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Kees Cook Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1761643036; l=1070; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=QvY+nAXDRHky/oaQZhIuoK3hf3WfhaB7cgzN/dQrG7M=; b=6eLwZ6/9TeBOy4ZjspiFcrQRDfICig8yzA6Y3xnYNYR2RoI6gjbrzGzbn6VKROBqqC7L1VjTm x5TBTjM7lAGDRSthAoXmnP69TGoARREVZ8AWHbT3bsy56gshRzuxU42 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= There are no users left. Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/x86/um/asm/elf.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/arch/x86/um/asm/elf.h b/arch/x86/um/asm/elf.h index 8d7df4684c38..fdd5a612f678 100644 --- a/arch/x86/um/asm/elf.h +++ b/arch/x86/um/asm/elf.h @@ -72,10 +72,6 @@ extern char * elf_aux_platform; #define ELF_PLATFORM_FALLBACK "i586" #define ELF_PLATFORM (elf_aux_platform ?: ELF_PLATFORM_FALLBACK) =20 -/* No user-accessible fixmap addresses, i.e. vsyscall */ -#define FIXADDR_USER_START 0 -#define FIXADDR_USER_END 0 - #else =20 /* x86-64 relocation types, taken from asm-x86_64/elf.h */ @@ -157,10 +153,6 @@ extern char * elf_aux_platform; =20 #define ELF_PLATFORM "x86_64" =20 -/* No user-accessible fixmap addresses, i.e. vsyscall */ -#define FIXADDR_USER_START 0 -#define FIXADDR_USER_END 0 - #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 struct linux_binprm; extern int arch_setup_additional_pages(struct linux_binprm *bprm, --=20 2.51.1.dirty From nobody Mon Feb 9 06:50:54 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 916B33019C3 for ; Tue, 28 Oct 2025 09:17:24 +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=1761643046; cv=none; b=T4O1e4iBXKo5DLDPz6kv8FdXCWRgjcY0Qb2DXIR2BHhJANdpc94DhCWfUxAu6JUGG6Qi96vgN19EOt//wXVtrbrBLgccA0doOtMlA5ullsmYZKkJT53igHtKSNpFiziZPn5wTl9rQmm3xq9E1XOpKJhaT0a2tPBV6BWxwX8WhOE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761643046; c=relaxed/simple; bh=jBXvd5o8xd7AxDkdev4MjEnueBp7q9FqgNwPncpJjP4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=caWij4YF6oWpQgMbl5bMWUzh+54iDORFlqdNaiYOWP8ghEeIef2FACa/WwEEIBgbxMf2Kkg0XU7wgYkl0F/bPntat3d+4xZYJ8FjX99bKIDL9Ux24zbPKTroO6RZsYM5J439zt/oqg6KHefVIuj09uYALmk3itCsTrC+Wd5Cb+o= 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=bhTSQc+M; 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="bhTSQc+M" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1761643039; bh=jBXvd5o8xd7AxDkdev4MjEnueBp7q9FqgNwPncpJjP4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bhTSQc+MY8Q4Cb+L9hfMs4rpSyUf5r09v4+C8O9IY/bbbuhUeh4np0tT66UmWWWFy a8OZaeJ8mBgHbZD8bQdIv0kZBBNNaw8+vPz9/f2gUJ41umiZ1ftofd4YJQOTG5lE7f wBsch4Zd6p/JxPiev10JnJhD5LKWA361L0jQQpNU= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 28 Oct 2025 10:15:45 +0100 Subject: [PATCH 10/10] um: Always set up AT_HWCAP and AT_PLATFORM 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: <20251028-uml-remove-32bit-pseudo-vdso-v1-10-e930063eff5f@weissschuh.net> References: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> In-Reply-To: <20251028-uml-remove-32bit-pseudo-vdso-v1-0-e930063eff5f@weissschuh.net> To: Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Kees Cook Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1761643036; l=3821; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=jBXvd5o8xd7AxDkdev4MjEnueBp7q9FqgNwPncpJjP4=; b=l/5J9hB4UN4Sm4P7Sd031ZesVQaS000sV+zNJuYPMvpNlqHe+eaZ7Dhvyr9wnNWMKKghulBXM bI1FX/3fgRwDwcgAxTVaiUY1rpJZ2iMUr1X0NnzY9WZIKRwnVaUfC9Y X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Historically the code to set up AT_HWCAP and AT_PLATFORM was only built for 32bit x86 as it was intermingled with the vDSO passthrough code. Now that vDSO passthrough has been removed, always pass through AT_HWCAP and AT_PLATFORM. Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/um/os-Linux/Makefile | 4 +--- arch/um/os-Linux/elf_aux.c | 7 ++++++- arch/um/os-Linux/main.c | 4 ---- arch/x86/um/Kconfig | 3 --- arch/x86/um/asm/elf.h | 7 ++++--- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/arch/um/os-Linux/Makefile b/arch/um/os-Linux/Makefile index 70c73c22f715..f8d672d570d9 100644 --- a/arch/um/os-Linux/Makefile +++ b/arch/um/os-Linux/Makefile @@ -6,7 +6,7 @@ # Don't instrument UML-specific code KCOV_INSTRUMENT :=3D n =20 -obj-y =3D execvp.o file.o helper.o irq.o main.o mem.o process.o \ +obj-y =3D elf_aux.o execvp.o file.o helper.o irq.o main.o mem.o process.o \ registers.o sigio.o signal.o start_up.o time.o tty.o \ umid.o user_syms.o util.o skas/ =20 @@ -14,8 +14,6 @@ CFLAGS_signal.o +=3D -Wframe-larger-than=3D4096 =20 CFLAGS_main.o +=3D -Wno-frame-larger-than =20 -obj-$(CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA) +=3D elf_aux.o - obj-$(CONFIG_SMP) +=3D smp.o =20 USER_OBJS :=3D $(user-objs-y) elf_aux.o execvp.o file.o helper.o irq.o \ diff --git a/arch/um/os-Linux/elf_aux.c b/arch/um/os-Linux/elf_aux.c index f8927a5959d8..72f416edf252 100644 --- a/arch/um/os-Linux/elf_aux.c +++ b/arch/um/os-Linux/elf_aux.c @@ -14,12 +14,17 @@ #include #include #include "internal.h" +#include =20 +#if __BITS_PER_LONG =3D=3D 64 +typedef Elf64_auxv_t elf_auxv_t; +#else typedef Elf32_auxv_t elf_auxv_t; +#endif =20 /* These are initialized very early in boot and never changed */ char * elf_aux_platform; -extern long elf_aux_hwcap; +long elf_aux_hwcap; =20 __init void scan_elf_aux( char **envp) { diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index 730723106228..7e114862a723 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c @@ -21,8 +21,6 @@ =20 #define STACKSIZE (8 * 1024 * 1024) =20 -long elf_aux_hwcap; - static void __init set_stklim(void) { struct rlimit lim; @@ -149,9 +147,7 @@ int __init main(int argc, char **argv, char **envp) install_fatal_handler(SIGINT); install_fatal_handler(SIGTERM); =20 -#ifdef CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA scan_elf_aux(envp); -#endif =20 change_sig(SIGPIPE, 0); ret =3D linux_main(argc, argv, envp); diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig index 798c6cc53e82..bdd7c8e39b01 100644 --- a/arch/x86/um/Kconfig +++ b/arch/x86/um/Kconfig @@ -34,8 +34,5 @@ config X86_64 config ARCH_HAS_SC_SIGNALS def_bool !64BIT =20 -config ARCH_REUSE_HOST_VSYSCALL_AREA - def_bool !64BIT - config GENERIC_HWEIGHT def_bool y diff --git a/arch/x86/um/asm/elf.h b/arch/x86/um/asm/elf.h index fdd5a612f678..22d0111b543b 100644 --- a/arch/x86/um/asm/elf.h +++ b/arch/x86/um/asm/elf.h @@ -68,9 +68,7 @@ pr_reg[16] =3D PT_REGS_SS(regs); \ } while (0); =20 -extern char * elf_aux_platform; #define ELF_PLATFORM_FALLBACK "i586" -#define ELF_PLATFORM (elf_aux_platform ?: ELF_PLATFORM_FALLBACK) =20 #else =20 @@ -151,7 +149,7 @@ extern char * elf_aux_platform; (pr_reg)[25] =3D 0; \ (pr_reg)[26] =3D 0; =20 -#define ELF_PLATFORM "x86_64" +#define ELF_PLATFORM_FALLBACK "x86_64" =20 #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 struct linux_binprm; @@ -180,6 +178,9 @@ struct task_struct; extern long elf_aux_hwcap; #define ELF_HWCAP (elf_aux_hwcap) =20 +extern char *elf_aux_platform; +#define ELF_PLATFORM (elf_aux_platform ?: ELF_PLATFORM_FALLBACK) + #define SET_PERSONALITY(ex) do {} while(0) =20 #endif --=20 2.51.1.dirty