- User Since
- Mar 17 2020, 10:04 AM (125 w, 1 d)
Thu, Jul 28
- Ensured that we don't emit ENDBR64/32 as the type hash on X86.
Mon, Jul 25
Addressed conflicts with X86 retbleed mitigations (https://firstname.lastname@example.org/):
Fri, Jul 22
Based on the recent LKML discussions about X86 retbleed mitigations (https://email@example.com/), we're going to need some changes to the code generated for X86.
Mon, Jul 18
- Simplified AArch64 by dropping the KCFI_CHECK_BTI pseudo and just using a different caller-saved temporary register if needed.
- Added -verify-machineinstrs to llc tests.
Wed, Jul 13
Addressed Fangrui's feedback.
Tue, Jul 12
- Added a missing equivalency check to MachineInstr.
Jul 7 2022
Addressed the rest of Fangrui's comments after clarifying the open questions with him offline.
Jul 6 2022
Addressed Fangrui's feedback.
Jun 30 2022
Added a MIR parser test for cfi-type, address Nick's other feedback.
Jun 27 2022
- Moved to a standalone function for generating KCFI type hashes in Clang.
- Switched from pseudo instructions to a MachineInstr::ExtraInfo + SDNode attributes.
- Added KCFI passes for emitting the indirect call checks.
Jun 24 2022
Jun 22 2022
Fixed the debug output in InstCombine to use metadata as well.
Switched from prefix data + attribute to a metadata node based on previous discussion. This seems to be a cleaner solution overall.
Jun 17 2022
Rebased after ToT member function name changes.
Jun 10 2022
Jun 9 2022
- Per Fangrui's request, added comments explaining the X86 preamble format, and a note about it to the patch summary.
- Switched back to .weak for the __kcfi_typeid_ symbols to fix compatibility with LTO. Whether we need a warning for symbol value mismatches and how this should be implemented can be addressed later. The warning isn't critical for the functionality and mismatches should be extremely rare.
Jun 7 2022
- Addressed Fangrui's feedback.
- Renamed KCFI_* DAG nodes and pseudo instructions to CFI_* for now based on Joao's feedback. Still looking for more feedback on the best way to implement this part.
Jun 2 2022
- Changed Clang to emit operand bundles for indirect calls as pcc suggested, and dropped the llvm.kcfi.check intrinsic.
- Based on further LKML discussion, implemented arch-specific lowering that ensures the KCFI check can be placed immediately before the call instruction on X86.
- Switched to relative offsets in .kcfi_traps and fixed the __cfi_ preamble linkage on X86.
May 10 2022
Added a test for the Clang -O2 pipeline dropping unneeded checks.
May 9 2022
- Handle FP, LR, and XZR register arguments in the AArch64 llvm.kcfi.check lowering.
May 6 2022
Based on LKML feedback:
- Fixed a bug in Twine usage.
- Changed AArch64 to encode register information into the ESR and dropped .kcfi_traps generation for the arch.
- Changed X86 to generate valid instructions for the type data.
- Dropped the .kcfi_types section entirely.
May 3 2022
OK, I confirmed that we won't need this after all. I'll abandon this patch and revisit if it becomes necessary in future.
Apr 29 2022
- Renamed the builtin.
- Addressed Nick's comments.
Apr 28 2022
- Moved the KCFI pass to InstCombine
Apr 27 2022
- Added an LLVM pass to remove unneeded llvm.kcfi.check calls.
- Switched from zeros to 0xcc for x86 type identifier padding.
Apr 22 2022
Apr 21 2022
Apr 20 2022
Addressed another round of comments.
Apr 19 2022
Addressed Nick's comments.
Apr 13 2022
Dropped -fsanitize-kcfi-offset and added an error when used with -fpatchable-function-entry=N,M, where M > 0.
Alright, thanks for the feedback everyone! I'll abandon this patch and look into adding a built-in function instead.
Apr 11 2022
Apr 7 2022
Mar 29 2022
Note that this was split from D119296.
- Split the kcfi_unchecked attribute into a separate patch.
- Based on feedback from kernel developers, switched to 32-bit type identifiers, added the llvm.kcfi.check intrinsic with arch-specific lowering, and added sections for locating both type identifiers and traps.
- Addressed the remaining review comments.
Feb 9 2022
Thanks for the pointers, Aaron. I'll rework the attribute code and also address the issues Nick pointed out in the next revision.
Feb 8 2022
Dec 20 2021
Dec 10 2021
Addressed Nick's comments about NoCFIValue::handleOperandChangeImpl.
Applied pcc's changes.
Dec 9 2021
Based on more offline feedback from pcc, moved the conditional assignment handling from MCStreamer to MCObjectStreamer. This allows us to drop the emittedSymbols set as MCAssembler already keeps track of the symbols. As MCAsmStreamer now passes through the .lto_set_conditional directives, changed the tests to look at the generated objects instead.
Dec 3 2021
Changed the key of the pendingAssignments map to const MCSymbol * and switched from StringMap/Set to DenseMap/Set based on feedback from pcc.
Dec 1 2021
Nov 29 2021
Use standard l-value conversions, and add a test case for constexpr.
Nov 24 2021
Nov 23 2021
Changed the code to evaluate the argument as a constant expression.
Refactored to avoid evaluating the expression into an l-value.
Nov 19 2021
Renamed to .lto_set_conditional.
Updated tests to use # and reordered the CHECKs for clarity.
Nov 18 2021