Linux kbuild/kconfig development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	"Paul Walmsley" <paul.walmsley@sifive.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Alexandre Ghiti" <alex@ghiti.fr>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nick Desaulniers" <nick.desaulniers+lkml@gmail.com>,
	"Bill Wendling" <morbo@google.com>,
	"Justin Stitt" <justinstitt@google.com>,
	"Andy Lutomirski" <luto@kernel.org>,
	"Vincenzo Frascino" <vincenzo.frascino@arm.com>,
	"Kees Cook" <kees@kernel.org>, "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>,
	"Richard Weinberger" <richard@nod.at>,
	"Anton Ivanov" <anton.ivanov@cambridgegreys.com>,
	"Johannes Berg" <johannes@sipsolutions.net>,
	"Russell King" <linux@armlinux.org.uk>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Will Deacon" <will@kernel.org>,
	"Madhavan Srinivasan" <maddy@linux.ibm.com>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"WANG Xuerui" <kernel@xen0n.name>,
	"Heiko Carstens" <hca@linux.ibm.com>,
	"Vasily Gorbik" <gor@linux.ibm.com>,
	"Alexander Gordeev" <agordeev@linux.ibm.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"Sven Schnelle" <svens@linux.ibm.com>,
	"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Thomas Gleixner" <tglx@kernel.org>,
	"Christophe Leroy" <chleroy@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>,
	"Nicolas Schier" <nsc@kernel.org>
Cc: linux-mm@kvack.org, linux-s390@vger.kernel.org,
	linux-kbuild@vger.kernel.org, "Jan Stancek" <jstancek@redhat.com>,
	"Arnaldo Carvalho de Melo" <acme@redhat.com>,
	"Peter Zijlstra" <peterz@infradead.org>
Subject: Re: [PATCH v6 05/11] powerpc/vdso: Enable the vdsocheck tool
Date: Tue, 24 Nov 2026 13:53:09 +0000	[thread overview]
Message-ID: <sashiko-outbox-231259@kernel.org> (raw)
In-Reply-To: <20261123-vdso-absolute-reloc-v6-5-161e218dd217@linutronix.de>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] powerpc/vdso: missing PCREL relocations in
  allowed_relocations_for_machine()
- [High] powerpc/vdso: unignored .rela.opd in
  allowed_relocations_for_machine()
--

commit 52616a4e4f7df565d936b44f34a023f9e1864af3
Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de>

powerpc/vdso: Enable the vdsocheck tool

This commit enables the vdsocheck build-time validation tool for 32-bit and
64-bit PowerPC vDSO objects and defines their allowed ELF relocation types.

> diff --git a/lib/vdso/check/vdsocheck.rs b/lib/vdso/check/vdsocheck.rs
> index 0d5ceaca34d7c..da58ff220eab6 100644
> --- a/lib/vdso/check/vdsocheck.rs
> +++ b/lib/vdso/check/vdsocheck.rs
> @@ -69,6 +69,33 @@ fn allowed_relocations_for_machine(machine: u16) -> Option<AllowedRelocations<'s
>              ..Default::default()
>          }
>          .into(),
> +        bindings::EM_PPC => AllowedRelocations {
> +            in_object_file: &[
> +                10,  /* R_PPC_REL24 */
> +                11,  /* R_PPC_REL14 */
> +                26,  /* R_PPC_REL32 */
> +                249, /* R_PPC_REL16 */
> +                250, /* R_PPC_REL16_LO */
> +                251, /* R_PPC_REL16_HI */
> +                252, /* R_PPC_REL16_HA */
> +            ],
> +            ..Default::default()
> +        }
> +        .into(),
> +        bindings::EM_PPC64 => AllowedRelocations {
> +            in_object_file: &[
> +                10,  /* R_PPC64_REL24 */
> +                11,  /* R_PPC64_REL14 */
> +                26,  /* R_PPC64_REL32 */
> +                44,  /* R_PPC64_REL64 */
> +                249, /* R_PPC64_REL16 */
> +                250, /* R_PPC64_REL16_LO */
> +                251, /* R_PPC64_REL16_HI */
> +                252, /* R_PPC64_REL16_HA */
> +            ],
> +            ..Default::default()
> +        }
> +        .into(),
>          _ => None,
>      }
>  }

[Severity: High]
Does the bindings::EM_PPC64 entry break 64-bit vDSO builds when
CONFIG_PPC_KERNEL_PCREL is enabled?

With CONFIG_PPC_KERNEL_PCREL=y, CFUNC() appends @notoc in
arch/powerpc/include/asm/ppc_asm.h, so cvdso_call in gettimeofday.S and
getrandom.S emits R_PPC64_REL24_NOTOC (116).  In addition,
vgettimeofday-64.o and vgetrandom-64.o are compiled with KBUILD_CFLAGS
(which includes -mpcrel) and emit R_PPC64_REL24_NOTOC (116) and
R_PPC64_PCREL34 (132), causing vdsocheck to reject the object files and fail
the build.

[Severity: High]
Will vdsocheck also fail the build on 64-bit big-endian kernels using ELFv1
(CONFIG_PPC64_ELF_ABI_V1=y)?

Under -mabi=elfv1, the compiler emits function descriptors in .opd for the
global C functions in vgettimeofday-64.o and vgetrandom-64.o, producing a
.rela.opd section with R_PPC64_ADDR64 (38) and R_PPC64_TOC (51) relocations.
Although arch/powerpc/kernel/vdso/vdso64.lds.S discards *(.opd) during the
final link, vdsocheck runs on the intermediate object files first and
rejects .rela.opd unless it is listed in ignored_object_file_sections.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261123-vdso-absolute-reloc-v6-0-161e218dd217@linutronix.de?part=5

  reply	other threads:[~2026-11-24 13:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 13:50 [PATCH v6 00/11] vdso: Reject absolute relocations during build Thomas Weißschuh
2026-11-23 13:50 ` [PATCH v6 01/11] vdso: Add the vdsocheck tool Thomas Weißschuh
2026-11-24 13:52   ` sashiko-bot
2026-11-23 13:50 ` [PATCH v6 02/11] x86/vdso: Enable " Thomas Weißschuh
2026-11-23 13:50 ` [PATCH v6 03/11] ARM: vdso: " Thomas Weißschuh
2026-11-24 13:53   ` sashiko-bot
2026-11-23 13:50 ` [PATCH v6 04/11] arm64: " Thomas Weißschuh
2026-11-24 13:53   ` sashiko-bot
2026-11-23 13:50 ` [PATCH v6 05/11] powerpc/vdso: " Thomas Weißschuh
2026-11-24 13:53   ` sashiko-bot [this message]
2026-11-23 13:50 ` [PATCH v6 06/11] riscv: vdso: " Thomas Weißschuh
2026-11-23 13:50 ` [PATCH v6 07/11] LoongArch: vDSO: " Thomas Weißschuh
2026-11-24 13:53   ` sashiko-bot
2026-11-23 13:50 ` [PATCH v6 08/11] s390/vdso: " Thomas Weißschuh
2026-11-23 13:51 ` [PATCH v6 09/11] MIPS: vdso: " Thomas Weißschuh
2026-11-24 13:53   ` sashiko-bot
2026-11-23 13:51 ` [PATCH v6 10/11] sparc: " Thomas Weißschuh
2026-11-23 13:51 ` [PATCH v6 11/11] vDSO: Automatically enable VDSO_CHECK Thomas Weißschuh
2026-11-24 13:53   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-231259@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=acme@redhat.com \
    --cc=agordeev@linux.ibm.com \
    --cc=alex.gaynor@gmail.com \
    --cc=alex@ghiti.fr \
    --cc=aliceryhl@google.com \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=borntraeger@linux.ibm.com \
    --cc=bp@alien8.de \
    --cc=catalin.marinas@arm.com \
    --cc=chenhuacai@kernel.org \
    --cc=chleroy@kernel.org \
    --cc=dakr@kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=gary@garyguo.net \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=hpa@zytor.com \
    --cc=johannes@sipsolutions.net \
    --cc=jstancek@redhat.com \
    --cc=justinstitt@google.com \
    --cc=kees@kernel.org \
    --cc=kernel@xen0n.name \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lossin@kernel.org \
    --cc=luto@kernel.org \
    --cc=maddy@linux.ibm.com \
    --cc=mingo@redhat.com \
    --cc=morbo@google.com \
    --cc=mpe@ellerman.id.au \
    --cc=nathan@kernel.org \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=npiggin@gmail.com \
    --cc=nsc@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=peterz@infradead.org \
    --cc=richard@nod.at \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=svens@linux.ibm.com \
    --cc=tglx@kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=tmgross@umich.edu \
    --cc=tsbogend@alpha.franken.de \
    --cc=vincenzo.frascino@arm.com \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox