[all-commits] [llvm/llvm-project] def792: Fix KCFI types for generated functions with intege...
Sami Tolvanen via All-commits
all-commits at lists.llvm.org
Tue Oct 29 02:04:00 PDT 2024
Branch: refs/heads/release/19.x
Home: https://github.com/llvm/llvm-project
Commit: def7925c48337574df23156e3a8b23a8470cdc16
https://github.com/llvm/llvm-project/commit/def7925c48337574df23156e3a8b23a8470cdc16
Author: Sami Tolvanen <samitolvanen at users.noreply.github.com>
Date: 2024-10-29 (Tue, 29 Oct 2024)
Changed paths:
M clang/lib/CodeGen/CodeGenModule.cpp
M clang/test/CodeGen/kcfi-normalize.c
M llvm/lib/Transforms/Utils/ModuleUtils.cpp
A llvm/test/Transforms/GCOVProfiling/kcfi-normalize.ll
M llvm/test/Transforms/GCOVProfiling/kcfi.ll
Log Message:
-----------
Fix KCFI types for generated functions with integer normalization (#104826)
With -fsanitize-cfi-icall-experimental-normalize-integers, Clang
appends ".normalized" to KCFI types in CodeGenModule::CreateKCFITypeId,
which changes type hashes also for functions that don't have integer
types in their signatures. However, llvm::setKCFIType does not take
integer normalization into account, which means LLVM generated
functions with KCFI types, e.g. sanitizer constructors, will fail KCFI
checks when integer normalization is enabled in Clang.
Add a cfi-normalize-integers module flag to indicate integer
normalization is used, and append ".normalized" to KCFI types also in
llvm::setKCFIType to fix the type mismatch.
(cherry picked from commit e1c36bde0551977d4b2efae032af6dfc4b2b3936)
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list