<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - The correct implementation of __cfi_slowpath"
   href="https://llvm.org/bugs/show_bug.cgi?id=26033">26033</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>The correct implementation of __cfi_slowpath
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>hjl.tools@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>