[PATCH v2 08/12] crypto: x86/sm4 - fix crash with CFI enabled

Sami Tolvanen samitolvanen at google.com
Fri Nov 18 12:53:01 PST 2022


On Fri, Nov 18, 2022 at 12:27 PM Sami Tolvanen <samitolvanen at google.com> wrote:
>
> On Fri, Nov 18, 2022 at 12:10 PM Eric Biggers <ebiggers at kernel.org> wrote:
> > Sami, is it expected that a CFI check isn't being generated for the indirect
> > call to 'func' in sm4_avx_cbc_decrypt()?  I'm using LLVM commit 4a7be42d922af0.
>
> If the compiler emits an indirect call, it should also emit a CFI
> check. What's the assembly code it generates here?

With CONFIG_RETPOLINE, the check is emitted as expected, but I can
reproduce this issue without retpolines. It looks like the cfi-type
attribute is dropped from the machine instruction in one of the X86
specific passes. I'll take a look.

Sami



More information about the linux-arm-kernel mailing list