Re: [PATCH v5 17/24] powerpc/vdso: Enable the vdsocheck tool
From: Thomas Weißschuh
Date: Wed Sep 09 2026 - 02:12:18 EST
On Tue, Sep 08, 2026 at 04:41:09PM +0200, Christophe Leroy (CS GROUP) wrote:
(...)
> > diff --git a/arch/powerpc/kernel/vdso/Makefile b/arch/powerpc/kernel/vdso/Makefile
> > index 368759f81708..ca20b91b4373 100644
> > --- a/arch/powerpc/kernel/vdso/Makefile
> > +++ b/arch/powerpc/kernel/vdso/Makefile
> > @@ -81,9 +81,9 @@ targets += vdso64.lds
> > CPPFLAGS_vdso64.lds += -P -C
> > # link rule for the .so file, .lds has to be first
> > -$(obj)/vdso32.so.dbg: $(obj)/vdso32.lds $(obj-vdso32) $(obj)/vgettimeofday-32.o $(obj)/vgetrandom-32.o $(obj)/crtsavres-32.o FORCE
> > +$(obj)/vdso32.so.dbg: $(obj)/vdso32.lds $(obj-vdso32) $(obj)/vgettimeofday-32.o $(obj)/vgetrandom-32.o $(obj)/crtsavres-32.o $(vdsocheck) FORCE
> > $(call if_changed,vdso32ld_and_check)
> > -$(obj)/vdso64.so.dbg: $(obj)/vdso64.lds $(obj-vdso64) $(obj)/vgettimeofday-64.o $(obj)/vgetrandom-64.o FORCE
> > +$(obj)/vdso64.so.dbg: $(obj)/vdso64.lds $(obj-vdso64) $(obj)/vgettimeofday-64.o $(obj)/vgetrandom-64.o $(vdsocheck) FORCE
> > $(call if_changed,vdso64ld_and_check)
> > # assembly rules for the .S files
> > diff --git a/lib/vdso/check/vdsocheck.rs b/lib/vdso/check/vdsocheck.rs
> > index e45a1fbc6829..429bdcd65818 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: &[
> > + bindings::R_PPC_REL24,
>
> Not sure this is correct, see commit 42ed6d56ade2 ("powerpc/vdso: Block
> R_PPC_REL24 relocations")
(...)
The mentioned commit prevents the relocation in the final vDSO,
while my patch allows it in the intermediate object files.
In the final vDSO no relocations are accepted whatsovever.