Re: [PATCH 2/3] rust: hrtimer: declare cfi_encoding for hrtimer_restart

From: Alice Ryhl

Date: Tue Oct 20 2026 - 04:13:39 EST


On Mon, Oct 19, 2026 at 11:34:38PM +0000, Sami Tolvanen 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>

Missing

Cc: stable@xxxxxxxxxxxxxxx

otherwise LGTM:

Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>