objtool/rust: add one more `noreturn` Rust function for Rust 1.86.0
authorMiguel Ojeda <ojeda@kernel.org>
Sun, 13 Apr 2025 00:23:38 +0000 (02:23 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 14 Apr 2025 15:02:49 +0000 (17:02 +0200)
Starting with Rust 1.86.0 (see upstream commit b151b513ba2b ("Insert null
checks for pointer dereferences when debug assertions are enabled") [1]),
under some kernel configurations with `CONFIG_RUST_DEBUG_ASSERTIONS=y`,
one may trigger a new `objtool` warning:

    rust/kernel.o: warning: objtool: _R..._6kernel9workqueue6system()
    falls through to next function _R...9workqueue14system_highpri()

due to a call to the `noreturn` symbol:

    core::panicking::panic_null_pointer_dereference

Thus add it to the list so that `objtool` knows it is actually `noreturn`.

See commit 56d680dd23c3 ("objtool/rust: list `noreturn` Rust functions")
for more details.

Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs).
Fixes: 56d680dd23c3 ("objtool/rust: list `noreturn` Rust functions")
Link: https://github.com/rust-lang/rust/commit/b151b513ba2b65c7506ec1a80f2712bbd09154d1
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20250413002338.1741593-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
tools/objtool/check.c

index 4a1f6c3169b3b6fb02c35759d79c3c8b86cf6db7..67006eeb30c88736ac0cf76ae8594e6bd0231c8e 100644 (file)
@@ -225,6 +225,7 @@ static bool is_rust_noreturn(const struct symbol *func)
               str_ends_with(func->name, "_4core9panicking14panic_nounwind")                            ||
               str_ends_with(func->name, "_4core9panicking18panic_bounds_check")                        ||
               str_ends_with(func->name, "_4core9panicking19assert_failed_inner")                       ||
+              str_ends_with(func->name, "_4core9panicking30panic_null_pointer_dereference")            ||
               str_ends_with(func->name, "_4core9panicking36panic_misaligned_pointer_dereference")      ||
               strstr(func->name, "_4core9panicking13assert_failed")                                    ||
               strstr(func->name, "_4core9panicking11panic_const24panic_const_")                        ||