Re: [PATCH 2/3] rust: hrtimer: declare cfi_encoding for hrtimer_restart
From: Andreas Hindborg
Date: Wed Oct 21 2026 - 16:03:05 EST
"Sami Tolvanen" <samitolvanen@xxxxxxxxxx> writes:
> 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>
Acked-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
Best regards,
Andreas Hindborg