[PATCH] D141444: [GCOV] Set !kcfi_type metadata for indirectly called functions

Sami Tolvanen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 10 16:26:32 PST 2023


samitolvanen created this revision.
Herald added subscribers: Enna1, hiraditya.
Herald added a project: All.
samitolvanen requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

With CONFIG_GCOV_KERNEL, the Linux kernel indirectly calls the
__llvm_gcov_* functions generated by LLVM. With -fsanitize=kcfi,
these calls are made from instrumented code and fail indirect
call checks as they don't have !kcfi_type metadata. Similarly
to D138945 <https://reviews.llvm.org/D138945>, set type metadata for these functions to allow GCOV
and KCFI to be both enabled.

Link: https://github.com/ClangBuiltLinux/linux/issues/1778


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141444

Files:
  llvm/include/llvm/Transforms/Utils/ModuleUtils.h
  llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
  llvm/lib/Transforms/Utils/ModuleUtils.cpp
  llvm/test/Transforms/GCOVProfiling/kcfi.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141444.488027.patch
Type: text/x-patch
Size: 5380 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230111/f7619145/attachment.bin>


More information about the llvm-commits mailing list