[llvm-bugs] [Bug 26033] New: The correct implementation of __cfi_slowpath

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jan 5 11:03:12 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26033

            Bug ID: 26033
           Summary: The correct implementation of __cfi_slowpath
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: hjl.tools at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

ControlFlowIntegrityDesign.rst has

CFI_SlowPath
------------

The slow path check is implemented in compiler-rt library as

.. code-block:: none

  void __cfi_slowpath(uint64 CallSiteTypeId, void *TargetAddr)

This functions loads a shadow value for ``TargetAddr``, finds the
address of __cfi_check as described above and calls that.

However __cfi_slowpath is implemented as

xtern "C" SANITIZER_INTERFACE_ATTRIBUTE
void __cfi_slowpath(uptr CallSiteTypeId, void *Ptr) {
  uptr Addr = (uptr)Ptr;
  VReport(3, "__cfi_slowpath: %zx, %p\n", CallSiteTypeId, Ptr);
  ShadowValue sv = ShadowValue::load(Addr);
  if (sv.is_invalid()) {
    VReport(2, "CFI: invalid memory region for a function pointer (shadow==0):
%p\n", Ptr);
    Die();
  }

uptr != uint64 for 32-bit target.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160105/ae591f4f/attachment-0001.html>


More information about the llvm-bugs mailing list