Re: [PATCH v3] ARM: imx: Fix suspend/resume crash with Clang CFI
Sami Tolvanen <[email protected]> Wed, 22 Jul 2026 08:00:44 -0700
| Newsgroups | dev.linux.lists.llvm,dev.linux.lists.imx,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel,org.kernel.vger.stable |
|---|---|
| Message-ID | <CABCJKufhvTxmVm8y7xr4RWWKsoZk0h8UGBnem+F5fknnimaqPA@mail.gmail.com> |
On Wed, Jul 22, 2026 at 5:54 AM Yo'av Moshe <[email protected]> wrote: > > On 2026-07-21 8:09 PM, Nathan Chancellor wrote: > > Does using SYM_TYPED_FUNC_START for imx6_suspend() make that work? > > Something like this builds fine for me and I see > > __kcfi_typeid_imx6_suspend generated by Clang. > Hi Nathan, > > Thanks for the suggestion! > > Unfortunately my physical board died, so I couldn't test this on hardware. > However, I gave your patch a try under QEMU emulation (with CONFIG_CFI=y > and copying the 4-byte hash into OCRAM before fncpy), and it still > triggered a CFI panic when suspending: > > __und_svc_finish from imx6q_suspend_finish+0x78/0xd0 > > It seems like the hash generated for assembly doesn't match what the C code > expects at the call site. Are relocations applied to this code before the function is copied? Because SYM_TYPED_FUNC_START doesn't embed the actual CFI hash in the binary, just a reference to a symbol that contains the hash, and it relies on the kernel to apply relocations before indirect calls are made to the function. Sami