<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Stack-overflow in demangler (8)"
   href="https://bugs.llvm.org/show_bug.cgi?id=32885">32885</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Stack-overflow in demangler (8)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++abi
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </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>All Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dungnguy@comp.nus.edu.sg
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Dear All,

This bug was found with AFLGo, a directed version of AFL/AFLFast. Thanks also
to Marcel Böhme and Van-Thuan Pham.

First, you need to build the project
(<a href="https://github.com/llvm-mirror/libcxxabi/blob/master/fuzz/cxa_demangle_fuzzer.cpp">https://github.com/llvm-mirror/libcxxabi/blob/master/fuzz/cxa_demangle_fuzzer.cpp</a>)
to obtain the binary file.

To reproduce:
$ for Z in $(seq 1 15000); do printf "Z"; done > test; echo "" >> test; cat
test | ./cxa_demangle_fuzzer
Segmentation fault

ASAN says:
==22186==ERROR: AddressSanitizer: stack-overflow on address 0x7ffe28a30a40 (pc
0x00000060f40a bp 0x7ffe28a315d0 sp 0x7ffe28a30a40 T0)
    #0 0x60f409 in char const* __cxxabiv1::(anonymous
namespace)::parse_name<__cxxabiv1::(anonymous namespace)::Db>(char const*, char
const*, __cxxabiv1::(anonymous namespace)::Db&, bool*)
/src/llvm_libcxxabi/src/cxa_demangle.cpp:4214
    #1 0x51e3f7 in char const* __cxxabiv1::(anonymous
namespace)::parse_encoding<__cxxabiv1::(anonymous namespace)::Db>(char const*,
char const*, __cxxabiv1::(anonymous namespace)::Db&)
/src/llvm_libcxxabi/src/cxa_demangle.cpp:4577:29
    #2 0x60ffbc in char const* __cxxabiv1::(anonymous
namespace)::parse_local_name<__cxxabiv1::(anonymous namespace)::Db>(char
const*, char const*, __cxxabiv1::(anonymous namespace)::Db&, bool*)
/src/llvm_libcxxabi/src/cxa_demangle.cpp:4138:25
    #3 0x60ffbc in char const* __cxxabiv1::(anonymous
namespace)::parse_name<__cxxabiv1::(anonymous namespace)::Db>(char const*, char
const*, __cxxabiv1::(anonymous namespace)::Db&, bool*)
/src/llvm_libcxxabi/src/cxa_demangle.cpp:4233
    #4 0x51e3f7 in char const* __cxxabiv1::(anonymous
namespace)::parse_encoding<__cxxabiv1::(anonymous namespace)::Db>(char const*,
char const*, __cxxabiv1::(anonymous namespace)::Db&)
/src/llvm_libcxxabi/src/cxa_demangle.cpp:4577:29
    #5 0x60ffbc in char const* __cxxabiv1::(anonymous
namespace)::parse_local_name<__cxxabiv1::(anonymous namespace)::Db>(char
const*, char const*, __cxxabiv1::(anonymous namespace)::Db&, bool*)
/src/llvm_libcxxabi/src/cxa_demangle.cpp:4138:25
    #6 0x60ffbc in char const* __cxxabiv1::(anonymous
namespace)::parse_name<__cxxabiv1::(anonymous namespace)::Db>(char const*, char
const*, __cxxabiv1::(anonymous namespace)::Db&, bool*)
/src/llvm_libcxxabi/src/cxa_demangle.cpp:4233
    #7 0x51e3f7 in char const* __cxxabiv1::(anonymous
namespace)::parse_encoding<__cxxabiv1::(anonymous namespace)::Db>(char const*,
char const*, __cxxabiv1::(anonymous namespace)::Db&)
/src/llvm_libcxxabi/src/cxa_demangle.cpp:4577:29
    #8 0x60ffbc in char const* __cxxabiv1::(anonymous
namespace)::parse_local_name<__cxxabiv1::(anonymous namespace)::Db>(char
const*, char const*, __cxxabiv1::(anonymous namespace)::Db&, bool*)
/src/llvm_libcxxabi/src/cxa_demangle.cpp:4138:25
    ...

Regards,
Manh-Dung Nguyen</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>