Re: vmlinux.o: warning: objtool: do_user_addr_fault+0x1052: __stack_chk_fail() is missing a __noreturn annotation
From: Nathan Chancellor
Date: Tue Dec 31 2024 - 16:06:10 EST
+ objtool folks
On Tue, Dec 31, 2024 at 10:18:15AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: ccb98ccef0e543c2bd4ef1a72270461957f3d8d0
> commit: 7582b7be16d0ba90e3dbd9575a730cabd9eb852a kprobes: remove dependency on CONFIG_MODULES
> date: 8 months ago
> config: x86_64-buildonly-randconfig-006-20241231 (https://download.01.org/0day-ci/archive/20241231/202412311010.rrcATd3z-lkp@xxxxxxxxx/config)
> compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241231/202412311010.rrcATd3z-lkp@xxxxxxxxx/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202412311010.rrcATd3z-lkp@xxxxxxxxx/
>
> All warnings (new ones prefixed by >>):
>
> vmlinux.o: warning: objtool: x64_sys_call+0x23b9: __x64_sys_exit() is missing a __noreturn annotation
> >> vmlinux.o: warning: objtool: do_user_addr_fault+0x1052: __stack_chk_fail() is missing a __noreturn annotation
Is the solution to mark __stack_chk_fail() explicitly as __noreturn?
It is my understanding that __stack_chk_fail() should implicitly be
__noreturn, as GCC's documentation states that if a target customizes
the stack protector failure function, it should involve a call to a
noreturn function [1]. Should this warning take into account the
global_noreturn list to avoid warning in these cases? I suspect that
would take care of the other warning in in this configuration.
[1]: https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gccint/Stack-Smashing-Protection.html
Cheers,
Nathan