[llvm] [X86][KCFI] Do not emit a type prefix for nocf_check functions (PR #158133)
Sami Tolvanen via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 15 09:28:49 PDT 2025
samitolvanen wrote:
> I see this is only testing the IR level, but not the front-end.
Correct, this doesn't change the behavior for `nocf_check` in Clang.
> Do you want `-fsanitize=kcfi` to work with `nocf_check` regardless of `-fcf-protection`? I think it should -- there may actually be some value in being able to remove preambles for a function regardless of `-fcf-protection`. (This is the logic I'm implementing in the GCC KCFI.)
That sounds reasonable to me. Out of curiosity, `nocf_check` is currently limited to X86 only in Clang. Does your GCC KCFI implementation support `nocf_check` on other architectures too?
> That way we won't get these kinds of errors if someone tries to use `nocf_check`:
>
> ```
> kcfi-runtime.c:17:16: warning: 'nocf_check' attribute ignored; use -fcf-protection to enable the
> attribute [-Wignored-attributes]
> 17 | __attribute__((nocf_check))
> | ^
> ```
I think this isn't actually a problem in the kernel though, as `nocf_check` is only used with `CONFIG_X86_KERNEL_IBT`.
https://github.com/llvm/llvm-project/pull/158133
More information about the llvm-commits
mailing list