Re: [PATCH v3] ARM: imx: Fix suspend/resume crash with Clang CFI

From: Yo'av Moshe

Date: Tue Jul 21 2026 - 01:20:56 EST


On 2026-07-20 6:53 PM, Nick Desaulniers wrote:
>
> Are we able to just put __nocfi on the declaration of
> `imx6_suspend_in_ocram_fn`, rather than bother with a wrapper
> (imx6_suspend_in_ocram)? I don't know if that works, but surely you
> can test that quickly?
Thanks for the suggestion! I tested placing __nocfi directly on the
imx6_suspend_in_ocram_fn variable declaration:

static void (* __nocfi imx6_suspend_in_ocram_fn)(void __iomem *ocram_vbase);

Unfortunately, Clang ignores no_sanitize("cfi") on variable declarations and
emits a compiler warning:

warning: 'no_sanitize' attribute argument 'cfi' not supported on a
global variable [-Wignored-attributes]

Because Clang ignores it, it still injects the CFI check at the call site.
I tested this on physical hardware (Kobo Clara HD), and it crashes on suspend.

Best regards,
Yo'av