[PATCH] D119296: KCFI sanitizer

Sami Tolvanen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 2 11:22:26 PDT 2022


samitolvanen added inline comments.


================
Comment at: lld/ELF/Symbols.cpp:553
+  // incompatible declarations for the same function.
+  if (isWeak() && getName().startswith("__kcfi_typeid_") &&
+      cast<Defined>(this)->value != other.value)
----------------
MaskRay wrote:
> samitolvanen wrote:
> > MaskRay wrote:
> > > This change looks like a hack.
> > I agree, this is not ideal. The request from LKML was to produce a warning when we link object files with different values for these weak symbols. What would be the best way to do this in LLD?
> I need to read through the code to suggest a solution.
> 
> If you can provide additional context like LKML URIs, that'll be great.
Here's the latest LKML thread: https://lore.kernel.org/lkml/20220513202159.1550547-1-samitolvanen@google.com/

Rasmus brought up the concern with `__kcfi_typeid_` mismatches between object files here: https://lore.kernel.org/lkml/9bd2db3e-2955-66ba-574e-7976bdd95a8e@rasmusvillemoes.dk/

He didn't specifically request a warning, but I feel like that would be a reasonable response in this situation.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119296/new/

https://reviews.llvm.org/D119296



More information about the cfe-commits mailing list