Re: [PATCH 1/3] rust: irq: declare cfi_encoding for irqreturn

From: Alice Ryhl

Date: Tue Oct 20 2026 - 04:16:26 EST


On Mon, Oct 19, 2026 at 11:34:37PM +0000, Sami Tolvanen wrote:
> The IRQ callbacks return c_uint. C calls them through irq_handler_t,
> which returns enum irqreturn. kCFI encodes enum types by name even with
> integer normalization, so the type ids never match and every call fails
> the CFI check.
>
> Generate irqreturn as a newtype with a cfi_encoding, as is done for
> lru_status, and return bindings::irqreturn_t from the callbacks.
>
> Fixes: 0851d34a8cc3 ("rust: irq: add support for non-threaded IRQs and handlers")
> Fixes: 135d40523244 ("rust: irq: add support for threaded IRQs and handlers")
> Signed-off-by: Sami Tolvanen <samitolvanen@xxxxxxxxxx>

Missing

Cc: stable@xxxxxxxxxxxxxxx

otherwise LGTM:

Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>