Thread (13 messages) 13 messages, 6 authors, 2025-11-06

Re: [mainline]Error while running make modules_install command

From: Dimitri John Ledkov <hidden>
Date: 2025-11-04 20:36:09
Also in: linux-kbuild, lkml, stable

On Tue, 4 Nov 2025 at 18:12, Omar Sandoval [off-list ref] wrote:
On Tue, Nov 04, 2025 at 04:54:38PM +0530, Venkat Rao Bagalkote wrote:
quoted
On 04/11/25 4:47 pm, Samir M wrote:
quoted
Hello,


I am observing below error while running the make modules_install
command on latest mainline kernel on IBM Power11 server.


Error:
DEPMOD  /lib/modules/6.18.0-rc4
depmod: ERROR: kmod_builtin_iter_next:
quoted
quoted
unexpected string without modname prefix
IBM CI has also reported this error.


Error:


depmod: ERROR: kmod_builtin_iter_next: unexpected string without modname
prefix
  INSTALL /boot
depmod: ERROR: kmod_builtin_iter_next: unexpected string without modname
prefix
depmod: ERROR: kmod_builtin_iter_next: unexpected string without modname
prefix


Git bisect is pointing to below commit as first bad commit.


d50f21091358b2b29dc06c2061106cdb0f030d03 is the first bad commit
commit d50f21091358b2b29dc06c2061106cdb0f030d03
Author: Dimitri John Ledkov [off-list ref]
Date:   Sun Oct 26 20:21:00 2025 +0000

    kbuild: align modinfo section for Secureboot Authenticode EDK2 compat

    Previously linker scripts would always generate vmlinuz that has
sections
    aligned. And thus padded (correct Authenticode calculation) and unpadded
    calculation would be same. As in https://github.com/rhboot/pesign
userspace
    tool would produce the same authenticode digest for both of the
following
    commands:

        pesign --padding --hash --in ./arch/x86_64/boot/bzImage
        pesign --nopadding --hash --in ./arch/x86_64/boot/bzImage

    The commit 3e86e4d74c04 ("kbuild: keep .modinfo section in
    vmlinux.unstripped") added .modinfo section of variable length.
Depending
    on kernel configuration it may or may not be aligned.

    All userspace signing tooling correctly pads such section to calculation
    spec compliant authenticode digest.

    However, if bzImage is not further processed and is attempted to be
loaded
    directly by EDK2 firmware, it calculates unpadded Authenticode digest
and
    fails to correct accept/reject such kernel builds even when propoer
    Authenticode values are enrolled in db/dbx. One can say EDK2 requires
    aligned/padded kernels in Secureboot.

    Thus add ALIGN(8) to the .modinfo section, to esure kernels irrespective
of
    modinfo contents can be loaded by all existing EDK2 firmware builds.

    Fixes: 3e86e4d74c04 ("kbuild: keep .modinfo section in
vmlinux.unstripped")
    Cc: stable@vger.kernel.org
    Signed-off-by: Dimitri John Ledkov [off-list ref]
    Link:
https://patch.msgid.link/20251026202100.679989-1-dimitri.ledkov@surgut.co.uk
    Signed-off-by: Nathan Chancellor [off-list ref]

 include/asm-generic/vmlinux.lds.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drgn's CI hit this same failure. FWIW, the commit fixed by this bisected
commit, 3e86e4d74c04 ("kbuild: keep .modinfo section in
vmlinux.unstripped"), also results in ELF segments of size 0 in vmlinux
for some configurations, which confused drgn until I added a workaround
(https://github.com/osandov/drgn/commit/2a9053de8796af866fd720a3c8c23013595d391a).
So there's some funkiness in this area.
The expectation is that said section is removed from the final binary.
But the fact that it is present with 0 length, indicates incorrect
linking. It also now makes sense why on x86/arm it is tripping up
section alignment.

As it is likely that it is the same underlying issue that such segment
exists in the first place.

I wonder if the original implementation of moving sections about and
when/where the builtin module info is kept is not as tidy as it was
intended to be.

I wonder if we should:
- rollback to the state of how things were before that feature was added
- keep the production / stripped / installed kernel build as is
- reshuffle of how modinfo is preserved in the unstripped kernel with
a bespoke linker script

Such that hopefully we have correct alignment, without any zero length segments.

Or possibly even link / split the built-in module info somewhere else entirely.

As in revert both:
- d50f21091358b (kbuild: align modinfo section for Secureboot
Authenticode EDK2 compat, 2025-10-26)
- 3e86e4d74c049 (kbuild: keep .modinfo section in vmlinux.unstripped,
2025-09-18)

And try implementing the keeping of .modinfo section again.

Better structure tests, after linking would be nice to catch such
issues, because linker scripts are hard and trying to understand how a
linker script change affects the result.

-- 
Regards,

Dimitri.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help