You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Linux Kernel 6.19.8 - Build Failure: objtool flags 'naked' returns in MITIGATION_RETHUNK build #1077
Thank you for the report. Yes, we are aware of the problem, and hope in the future to build the "OS-agnostic" portion of the kernel modules with -mfunction-return=thunk-extern. In the meantime, if you disable CONFIG_OBJTOOL_WERROR, then this will "only" be a warning rather than a build error.
Or, alternatively, to actually get properly and safely compiled versions of the binary files that produce the errors, due to not, at present, being shipped in such a state: #1015 (comment)
However, there seems to be a missing step somewhere that has started to cause new kernel splats like this after updating from 610.57.04 to 615.71.09 with Ubuntu 26.04's new nvidia-driver-615-open package:
Unpatched return thunk in use. This should not happen!
WARNING: CPU: 3 PID: 248 at arch/x86/kernel/cpu/bugs.c:3830 __warn_thunk+0x25/0x30
...
CPU: 3 UID: 0 PID: 248 Comm: (udev-worker) Tainted: G O T 6.18.55aquos+ #73 VOLUNTARY
...
Call Trace:
<TASK>
warn_thunk_thunk+0x16/0x30
nv_vasprintf+0x2b/0xd0 [nvidia_modeset]
? __kmalloc_noprof+0x2f6/0x570
? __kmalloc_cache_noprof+0x10a/0x4b0
? nvkms_exit+0x900/0x900 [nvidia_modeset]
? nvVEvoLog+0x33/0xa0 [nvidia_modeset]
? nvEvoLog+0x4a/0x60 [nvidia_modeset]
? __register_chrdev+0xe0/0xe0
? nvKmsModuleLoad+0x24/0x200 [nvidia_modeset]
? down+0x19/0x60
? nvkms_init+0x1a7/0x1000 [nvidia_modeset]
? do_one_initcall+0x5b/0x2a0
? do_init_module+0x7f/0x270
? init_module_from_file+0x86/0xc0
? idempotent_init_module+0x18c/0x280
? __x64_sys_finit_module+0x5a/0xa0
? do_syscall_64+0x73/0x280
? entry_SYSCALL_64_after_hwframe+0x55/0x5d
</TASK>
---[ end trace 0000000000000000 ]---
nvidia-modeset: Loading NVIDIA UNIX Open Kernel Mode Setting Driver for x86_64 615.71.09 Release Build (dvs-builder@U22-I3-F05-2-4) Fri Sep 4 22:15:27 UTC 2026
I have worked around it by running this to add missing return_sites metadata to nv-modeset-kernel.o_binary and rebuilt, which prevents the warning:
sudo <path to my kernel build dir>/tools/objtool/objtool --rethunk --module --link /usr/src/nvidia-615.71.09/nvidia-modeset/nv-modeset-kernel.o_binary
Apparently, this is more than just noise and causes some inefficient code paths (jumping thru warn_thunk_thunk each time, though its only logged once):
void __warn_thunk(void)
{
WARN_ONCE(1, "Unpatched return thunk in use. This should not happen!\n");
}
Activity
ullahsamee commentedon Mar 25, 2026
The # Fix for Kernel 6.19 RETHUNK build errors is in the Kbuild file, add
OBJECT_FILES_NON_STANDARD := yAfter
NV_BUILD_TYPE ?= releasearitger commentedon Mar 30, 2026
Thank you for the report. Yes, we are aware of the problem, and hope in the future to build the "OS-agnostic" portion of the kernel modules with
-mfunction-return=thunk-extern. In the meantime, if you disable CONFIG_OBJTOOL_WERROR, then this will "only" be a warning rather than a build error.Fjodor42 commentedon Mar 30, 2026
Or, alternatively, to actually get properly and safely compiled versions of the binary files that produce the errors, due to not, at present, being shipped in such a state: #1015 (comment)
tofurky commentedon Oct 10, 2026
61dcc93 (615.71.09) added the suggested
-mfunction-return=thunk-externto nvidia-modeset's Makefile:However, there seems to be a missing step somewhere that has started to cause new kernel splats like this after updating from 610.57.04 to 615.71.09 with Ubuntu 26.04's new nvidia-driver-615-open package:
I have worked around it by running this to add missing
return_sitesmetadata tonv-modeset-kernel.o_binaryand rebuilt, which prevents the warning:Apparently, this is more than just noise and causes some inefficient code paths (jumping thru
warn_thunk_thunkeach time, though its only logged once):