Public bug reported:

On Ubuntu 26.04 with linux-image-7.0.0-29-generic, no out-of-tree kernel
module will load. Modules build cleanly and sign correctly, but insmod
fails with "Invalid module format" and the kernel logs an invalid
relocation target.

Reproducer — a six-line module with no dependencies is enough:

  mkdir -p ~/hellomod && cd ~/hellomod
  printf '#include <linux/module.h>\nstatic int __init h(void){return 
0;}\nstatic void __exit 
b(void){}\nmodule_init(h);\nmodule_exit(b);\nMODULE_LICENSE("GPL");\n' > hello.c
  printf 'obj-m += hello.o\n' > Makefile
  make -C /lib/modules/$(uname -r)/build M=$PWD modules
  sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 \
    /var/lib/shim-signed/mok/MOK.priv /var/lib/shim-signed/mok/MOK.der hello.ko
  sudo insmod hello.ko

Expected: module loads.
Actual:   insmod: ERROR: could not insert module hello.ko: Invalid module format

dmesg:
  module: x86/modules: Invalid relocation target, existing value is
  nonzero for sec 41, idx 1, type 1, loc ffffffffc31564d0, val
  ffffffffc34c0010

readelf identifies the failing section as .gnu.linkonce.this_module. Its
relocation section contains only the two standard entries every kernel
module has:

  Offset   Type           Symbol
  0x138    R_X86_64_64    init_module + 0
  0x490    R_X86_64_64    cleanup_module + 0

Environment:
  Ubuntu 26.04 LTS
  Linux 7.0.0-29-generic #29-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 17 2026
  Kernel built with gcc 15.2.0 (Ubuntu 15.2.0-16ubuntu1), GNU ld 2.46
  Modules built with the same gcc 15.2.0 — vermagic matches
  linux-image, linux-headers and linux-modules are all 7.0.0-29.29, so
    there is no version skew between the running kernel and the build
    headers
  Secure Boot enabled, MOK enrolled, signing verified working (an
    unsigned module fails differently, with "Key was rejected by service")
  CONFIG_MODULE_COMPRESS_ZSTD=y
  CONFIG_MITIGATION_ITS=y, but the CPU reports "Not affected" and booting
    with indirect_target_selection=off makes no difference
  nvidia on this system is the prebuilt linux-modules-nvidia-595-open
    package, built alongside the kernel rather than via DKMS, so it is
    not a working out-of-tree counter-example. There are no other DKMS
    modules installed to compare against.

Originally found while trying to load tuxedo-drivers for keyboard
backlight control. Reproduced with tuxedo-drivers 4.22.3, tuxedo-drivers
4.21.0 and tuxedo-keyboard 3.2.10 — three releases across two unrelated
codebases, all failing identically — which is what led to the minimal
reproducer above.

Caveat: very small modules do appear to load (tuxedo_compatibility_check,
~12KB, loads fine), so there may be a discriminator I have not
identified, and the failure may not be as universal as the reproducer
suggests. No earlier kernel is installed on this system, so I have not
been able to test whether this is specific to the 7.0.0-29 ABI.

ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: linux-image-7.0.0-29-generic 7.0.0-29.29
ProcVersionSignature: Ubuntu 7.0.0-29.29-generic 7.0.12
Uname: Linux 7.0.0-29-generic x86_64
ApportVersion: 2.34.1-0ubuntu0.1
Architecture: amd64
AudioDevicesInUse:
 USER        PID ACCESS COMMAND
 /dev/snd/controlC1:  matt       5277 F.... wireplumber
 /dev/snd/controlC0:  matt       5277 F.... wireplumber
 /dev/snd/seq:        matt       5271 F.... pipewire
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Sat Aug 15 21:42:44 2026
InstallationDate: Installed on 2026-08-15 (0 days ago)
InstallationMedia: Ubuntu 26.04 "Resolute Raccoon" - Release amd64 (20260423.1)
IwDevWlp5s0f0Link: Not connected.
Lsusb:
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 001 Device 002: ID 1e7d:2c2e ROCCAT Lua Mouse
 Bus 001 Device 003: ID 5986:2170 Bison Electronics Inc. BisonCam,NB Pro
 Bus 001 Device 004: ID 8087:0036 Intel Corp. BE200 Bluetooth
 Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
MachineType: 3XS Gamer
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
ProcFB: 0 i915drmfb
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-7.0.0-29-generic 
root=UUID=7cabd3ec-7315-40bf-9c08-7a571a4ec64a ro quiet splash 
indirect_target_selection=off 
crashkernel=2G-4G:320M,4G-32G:512M,32G-64G:1024M,64G-128G:2048M,128G-:4096M
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 12/05/2025
dmi.bios.release: 7.8
dmi.bios.vendor: INSYDE Corp.
dmi.bios.version: 1.07.08
dmi.board.asset.tag: Tag 12345
dmi.board.name: V3xxSNR
dmi.board.vendor: Notebook
dmi.board.version: Not Applicable
dmi.chassis.asset.tag: No Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: No Enclosure
dmi.chassis.version: N/A
dmi.ec.firmware.release: 9.5
dmi.modalias: 
dmi:bvnINSYDECorp.:bvr1.07.08:bd12/05/2025:br7.8:efr9.5:svn3XS:pnGamer:pvrNotApplicable:rvnNotebook:rnV3xxSNR:rvrNotApplicable:cvnNoEnclosure:ct10:cvrN/A:sku562254:pfaScanComputers:
dmi.product.family: Scan Computers
dmi.product.name: Gamer
dmi.product.sku: 562254
dmi.product.version: Not Applicable
dmi.sys.vendor: 3XS

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug resolute wayland-session

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2163585

Title:
  No out-of-tree kernel module can load on 7.0.0-29-generic: "Invalid
  relocation target" on R_X86_64_64 against .gnu.linkonce.this_module

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2163585/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to