Re: [PATCH 2/3] rust: hrtimer: declare cfi_encoding for hrtimer_restart
From: Miguel Ojeda
Date: Tue Oct 20 2026 - 14:18:18 EST
On Tue, Oct 20, 2026 at 1:34 AM Sami Tolvanen <samitolvanen@xxxxxxxxxx> wrote:
>
> The hrtimer callbacks return bindings::hrtimer_restart, which bindgen
> generates as c_uint. C calls them through hrtimer->function, which
> returns enum hrtimer_restart. kCFI encodes enum types by name even with
> integer normalization, so the type ids never match and every call fails
> the CFI check.
>
> Generate hrtimer_restart as a newtype with a cfi_encoding, as is done
> for lru_status, and adapt HrTimerRestart to the newtype.
>
> Fixes: 8a8afe9349fb ("rust: hrtimer: introduce hrtimer support")
> Signed-off-by: Sami Tolvanen <samitolvanen@xxxxxxxxxx>
Andreas: with your Acked-by I can take this into `rust-fixes`.
Cheers,
Miguel