From nobody Sun Feb 8 21:09:33 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 76D3CB652; Thu, 6 Mar 2025 14:07:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741270057; cv=none; b=Zgyny1Ln5KGcCLS1lJKz090KrSb3wzpqhBbSwajyg2Zv5vVQf16n1PEi438K9ZOMxhEhFzZNb29EWdP4LgMaD5dmNBMTlVXLdxHRJzxr2+wcTSc1DELcqluObKVwdq9PSkrhTUTXtRIst4tbg5yiLdDjZOA3Da3NchXx2DrfflU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741270057; c=relaxed/simple; bh=GhEXSN/EM4VFU8qGPpnHfmR43DlwyLm89ZZtl0vemMo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tOdPT9LYjbI66GQI3MlFiux5hyRmgTjR2Ku6K8wqmoU598xssCJJXI0ENcGJWeG+PlhAqzx3i0pVLxdECeNsMn1Zj7iMaxOXIgFstIwQO9heqim8Txe1XM+gFltUkuhisj329JsxuXTFRiIou+owQ9qYyrPin8k809nIvQVjv/Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=OLdamC+0; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=coZCgYVN; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="OLdamC+0"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="coZCgYVN" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1741270053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5Ubr7/L5tlTtmEcuGV6Bs6axhRGY5gsCdk+sKdxBFeI=; b=OLdamC+0QwGUeZLi0swRrOxjOz7vw8sadVtV3db53IswICETxhMgbaJr5skvAGTID8l+oq w1VJiB/y9F3sK8A+iDWozNWEPJlcSyL7KoA2t+jz8Cktq2tAnyQU2dv1YJf74Nk9J7O/uk B3fk34M/BUtCTxNoWOJS0WFMahIh1BTvrr3egtVDbSGRWKa6TVxtttwHRCJlaU1vz8Yw40 TR7zFXkZqtJsXx3ZCIeo8y9pgHXy8C7tlJ3iz/eQ0YEUAN3Z8zNgsXtMCEAp9w+rWgReTa 3bNHR80I7469WrgdbIzRpwX+xHmhcasTEHVnDHqdRMBTtO4s00CYpJ3XmCaSFA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1741270053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5Ubr7/L5tlTtmEcuGV6Bs6axhRGY5gsCdk+sKdxBFeI=; b=coZCgYVNdFtBby1kBQpzeCtHT/4/yk0P6OJBRo9aJlUb3lIneRZbbnKv6kD3iAK7xEf8GD SmED21CO9SE3VLBw== Date: Thu, 06 Mar 2025 15:07:20 +0100 Subject: [PATCH v2 1/2] x86: vdso: Always reject undefined references during linking 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: <20250306-vdso-checkundef-v2-1-a26cc315fd73@linutronix.de> References: <20250306-vdso-checkundef-v2-0-a26cc315fd73@linutronix.de> In-Reply-To: <20250306-vdso-checkundef-v2-0-a26cc315fd73@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , "David S. Miller" , Andreas Larsson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1741270050; l=2103; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=GhEXSN/EM4VFU8qGPpnHfmR43DlwyLm89ZZtl0vemMo=; b=xGWwsJWhjPibKpAOr+k2aX0l8CG6oSOzAfSSPXMGXrJsGGYvIYZPzKtC28suQ1Dg1UsN+cCb+ 401hN39IZzSB3vkPvrm0DUBRmohzKw+Xvm+WEw1iHTiKFl3cYawymQO X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Instead of using a custom script to detect and fail on undefined references, use --no-undefined for all VDSO linker invocations. Drop the now unused checkundef.sh script. Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/x86/entry/vdso/Makefile | 7 +++---- arch/x86/entry/vdso/checkundef.sh | 10 ---------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile index c9216ac4fb1eb8c1e5bc5e33b41e9e40c7924cbf..99de18d88bc39f8f83f35e55402= 8efd0a76fccec 100644 --- a/arch/x86/entry/vdso/Makefile +++ b/arch/x86/entry/vdso/Makefile @@ -32,7 +32,7 @@ targets +=3D $(foreach x, 64 x32 32, vdso-image-$(x).c vd= so$(x).so vdso$(x).so.dbg =20 CPPFLAGS_vdso.lds +=3D -P -C =20 -VDSO_LDFLAGS_vdso.lds =3D -m elf_x86_64 -soname linux-vdso.so.1 --no-undef= ined \ +VDSO_LDFLAGS_vdso.lds =3D -m elf_x86_64 -soname linux-vdso.so.1 \ -z max-page-size=3D4096 =20 $(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE @@ -151,10 +151,9 @@ $(obj)/vdso32.so.dbg: $(obj)/vdso32/vdso32.lds $(vobjs= 32) FORCE quiet_cmd_vdso =3D VDSO $@ cmd_vdso =3D $(LD) -o $@ \ $(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \ - -T $(filter %.lds,$^) $(filter %.o,$^) && \ - sh $(src)/checkundef.sh '$(NM)' '$@' + -T $(filter %.lds,$^) $(filter %.o,$^) =20 -VDSO_LDFLAGS =3D -shared --hash-style=3Dboth --build-id=3Dsha1 \ +VDSO_LDFLAGS =3D -shared --hash-style=3Dboth --build-id=3Dsha1 --no-undefi= ned \ $(call ld-option, --eh-frame-hdr) -Bsymbolic -z noexecstack =20 quiet_cmd_vdso_and_check =3D VDSO $@ diff --git a/arch/x86/entry/vdso/checkundef.sh b/arch/x86/entry/vdso/checku= ndef.sh deleted file mode 100755 index 7ee90a9b549da32c9c12d694215b89d08645574c..000000000000000000000000000= 0000000000000 --- a/arch/x86/entry/vdso/checkundef.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -nm=3D"$1" -file=3D"$2" -$nm "$file" | grep '^ *U' > /dev/null 2>&1 -if [ $? -eq 1 ]; then - exit 0 -else - echo "$file: undefined symbols found" >&2 - exit 1 -fi --=20 2.48.1 From nobody Sun Feb 8 21:09:33 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 BC0C0823DE; Thu, 6 Mar 2025 14:07:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741270057; cv=none; b=WO58b6efvy5R+9Ks4dqPrUzhXY09kPrsWhIgTNzoOthx4ef239AOmyQFSd0oBpv9VBzkvcxdATy3GWw6bZtiZ9Fn0qehpO2KouA8gToCAwwtkJHHABURJHLcH+QGxYGd40YXf0VTdQ4GD6lWwAEXjNbfMcqM2wk2WfBUe2CI3jM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741270057; c=relaxed/simple; bh=ACBl2Fq/Y+AeDxVyAuPw9jDrfJIgt71CLxWbfrKoGm4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=P2+xLJZQ34quS5vYT3eZeOFGxL+XKVULM071x5zdiB1YgVE3ejhmIIe0i/lty75SsKI3b9sncV9Z+nXEJ3NJQj0yt1Tb1S49qh7/JuxhPLKGMbbtC7QNgL4OXkZxl6MHxtfhCSWh8jM7JHDs1caQqo5K06pfHWgNWLGaAJa1lSk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Quig70Xo; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=e3b4mAdk; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Quig70Xo"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="e3b4mAdk" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1741270053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2crXcGvedM/l/P9SdD7SNW7ifDpTDKg+mtvUD2PYjsM=; b=Quig70XohAnNH332230EP8SIZNq+5lokc88kZRdKaR74Iq7Jb5Av6vEtdEXjslyBtDrRke gV55lCqAOOdIePJAALaLSiokDiCpVb4CTe+NFfSKrgqc0mSi4bhWOcPjHULDC+rS6BRAPF TqkaxxL7btm+O/qhJgi3KjGUe6zBG+nJKughRzoTSeIPjJm4JnuJ7c3SwobhAUi/43mXin ZtcN+PddciItSACrjL3yk2X+8BpixdXWzUbHtc126iLkrDXICcsGANmpEOvf2rdZbEHlf+ ZNYIYd4Xi/nGVvP4Hz1ig8xueWbZAKiFmZx2BwpDGbONqZDQYgnSxJ0sAnvnOA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1741270053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2crXcGvedM/l/P9SdD7SNW7ifDpTDKg+mtvUD2PYjsM=; b=e3b4mAdkyWPAKE5CDWiWdjOx0TIl9bm+abod421qjbK1Us+ybqyoIFW8CBJUoJqEFmH9ud yne7yCCthEdsxkBA== Date: Thu, 06 Mar 2025 15:07:21 +0100 Subject: [PATCH v2 2/2] sparc: vdso: Always reject undefined references during linking 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: <20250306-vdso-checkundef-v2-2-a26cc315fd73@linutronix.de> References: <20250306-vdso-checkundef-v2-0-a26cc315fd73@linutronix.de> In-Reply-To: <20250306-vdso-checkundef-v2-0-a26cc315fd73@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , "David S. Miller" , Andreas Larsson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1741270050; l=1993; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=ACBl2Fq/Y+AeDxVyAuPw9jDrfJIgt71CLxWbfrKoGm4=; b=UuaTRkXYjiIVxjUdQQMpfDmQC4YBDeYk6fa+gs14FSvUDvzMsPh0HIlcGVWDoQEtKJqZ5fQMd QecvT4zWUjQAxoJa5AXsLFgb2hu7KYO3I/RvjFhkmLnFCKpJin4t1ro X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Instead of using a custom script to detect and fail on undefined references, use --no-undefined for all VDSO linker invocations. Drop the now unused checkundef.sh script. Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/sparc/vdso/Makefile | 7 +++---- arch/sparc/vdso/checkundef.sh | 10 ---------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/arch/sparc/vdso/Makefile b/arch/sparc/vdso/Makefile index 50ec2978cda5397841daad6ffdc9682811b9b38e..fdc4a8f5a49c5b27fbaee861b24= e8b31cfe64477 100644 --- a/arch/sparc/vdso/Makefile +++ b/arch/sparc/vdso/Makefile @@ -22,7 +22,7 @@ targets +=3D $(foreach x, 32 64, vdso-image-$(x).c vdso$(= x).so vdso$(x).so.dbg) =20 CPPFLAGS_vdso.lds +=3D -P -C =20 -VDSO_LDFLAGS_vdso.lds =3D -m elf64_sparc -soname linux-vdso.so.1 --no-unde= fined \ +VDSO_LDFLAGS_vdso.lds =3D -m elf64_sparc -soname linux-vdso.so.1 \ -z max-page-size=3D8192 =20 $(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE @@ -101,7 +101,6 @@ $(obj)/vdso32.so.dbg: FORCE \ quiet_cmd_vdso =3D VDSO $@ cmd_vdso =3D $(LD) -nostdlib -o $@ \ $(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \ - -T $(filter %.lds,$^) $(filter %.o,$^) && \ - sh $(src)/checkundef.sh '$(OBJDUMP)' '$@' + -T $(filter %.lds,$^) $(filter %.o,$^) =20 -VDSO_LDFLAGS =3D -shared --hash-style=3Dboth --build-id=3Dsha1 -Bsymbolic +VDSO_LDFLAGS =3D -shared --hash-style=3Dboth --build-id=3Dsha1 -Bsymbolic = --no-undefined diff --git a/arch/sparc/vdso/checkundef.sh b/arch/sparc/vdso/checkundef.sh deleted file mode 100644 index 2d85876ffc32519ab8a0702917fedd31293cd9da..000000000000000000000000000= 0000000000000 --- a/arch/sparc/vdso/checkundef.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -objdump=3D"$1" -file=3D"$2" -$objdump -t "$file" | grep '*UUND*' | grep -v '#scratch' > /dev/null 2>&1 -if [ $? -eq 1 ]; then - exit 0 -else - echo "$file: undefined symbols found" >&2 - exit 1 -fi --=20 2.48.1