Re: [PATCH] objtool/rust: add one more `noreturn` Rust function

From: Miguel Ojeda
Date: Wed Feb 12 2025 - 17:29:14 EST


On Sun, Jan 12, 2025 at 3:40 PM Miguel Ojeda <ojeda@xxxxxxxxxx> wrote:
>
> Starting with Rust 1.85.0 (currently in beta, to be released 2025-02-20),
> under some kernel configurations with `CONFIG_RUST_DEBUG_ASSERTIONS=y`,
> one may trigger a new `objtool` warning:
>
> rust/kernel.o: warning: objtool: _R...securityNtB2_11SecurityCtx8as_bytes()
> falls through to next function _R...core3ops4drop4Drop4drop()
>
> due to a call to the `noreturn` symbol:
>
> core::panicking::assert_failed::<usize, usize>
>
> Thus add it to the list so that `objtool` knows it is actually `noreturn`.
> Do so matching with `strstr` since it is a generic.
>
> See commit 56d680dd23c3 ("objtool/rust: list `noreturn` Rust functions")
> for more details.
>
> Cc: <stable@xxxxxxxxxxxxxxx> # Needed in 6.12.y only (Rust is pinned in older LTSs).
> Signed-off-by: Miguel Ojeda <ojeda@xxxxxxxxxx>

Applied to `rust-fixes` -- thanks everyone!

[ Updated Cc: stable@ to include 6.13.y. - Miguel ]

Cheers,
Miguel