[llvm-bugs] [Bug 32885] New: Stack-overflow in demangler (8)

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 2 03:27:25 PDT 2017


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

            Bug ID: 32885
           Summary: Stack-overflow in demangler (8)
           Product: libc++abi
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: dungnguy at comp.nus.edu.sg
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

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
(https://github.com/llvm-mirror/libcxxabi/blob/master/fuzz/cxa_demangle_fuzzer.cpp)
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

-- 
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/20170502/4b689619/attachment.html>


More information about the llvm-bugs mailing list