bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/21881] New: Memory leak in demangle


From: security-tps at google dot com
Subject: [Bug binutils/21881] New: Memory leak in demangle
Date: Tue, 01 Aug 2017 20:09:09 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=21881

            Bug ID: 21881
           Summary: Memory leak in demangle
           Product: binutils
           Version: 2.28
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: security-tps at google dot com
  Target Milestone: ---

Created attachment 10307
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10307&action=edit
binutils docker file

Hello binutils team,

As part of our fuzzing efforts at Google, we have identified an issue affecting
binutils (tested with revision 2.28.51 (git: branch master, commit
1b19ec971047a074486e6b775dc1969aa13f30fb)).  To reproduce we are attaching a
dockerfile to help compiling the project with the LLVM taking advantage of the
sanitizers that it offers.

Attached is a dockerfile that can be used for reproduction.  More information
about how to use the dockerfile can be found here: 
https://docs.docker.com/engine/reference/builder/
TL;DR instructions:
mkdir binutils
cp Dockerfile /path/to/binutils
docker build --no-cache /path/to/binutils
docker run -it <image id>
(from another terminal, outside the container):
docker cp /path/to/attached/reproducer <container id>:/fuzzing/
https://docs.docker.com/engine/reference/commandline/cp/
(back inside the container) /fuzzing/repro.sh /fuzzing/reproducer

Alternatively, and depending on the bug, you could use gcc, valgrind or other
instrumentation tools to aid in the investigation.

The sanitizer error that we encountered is here:

==23== ERROR: libFuzzer: out-of-memory (used: 2369Mb; limit: 2048Mb)
   To change the out-of-memory limit use -rss_limit_mb=<N>

Live Heap Allocations: 11282956931 bytes from 20 allocations; showing top 50%
11280523256 byte(s) (99%) in 1 allocation(s)
    #0 0x4cd488 in __interceptor_malloc
(/fuzzing/binutils-gdb/build/demangle_fuzzer+0x4cd488)
    #1 0x52f179 in xmalloc /fuzzing/binutils-gdb/libiberty/xmalloc.c:147:12
    #2 0x50fb7e in demangle_template
/fuzzing/binutils-gdb/libiberty/cplus-dem.c:2228:27
    #3 0x50e30d in demangle_signature
/fuzzing/binutils-gdb/libiberty/cplus-dem.c:1691:18
    #4 0x50bc20 in internal_cplus_demangle
/fuzzing/binutils-gdb/libiberty/cplus-dem.c:1257:14
    #5 0x50a99c in cplus_demangle
/fuzzing/binutils-gdb/libiberty/cplus-dem.c:918:9
    #6 0x50847d in LLVMFuzzerTestOneInput
/fuzzing/binutils-gdb/build/../libiberty/demangle_fuzzer.cc:11:20
    #7 0x535eec in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*,
unsigned long) (/fuzzing/binutils-gdb/build/demangle_fuzzer+0x535eec)
    #8 0x52f3bc in main (/fuzzing/binutils-gdb/build/demangle_fuzzer+0x52f3bc) 

We will gladly work with you so you can successfully confirm and reproduce this
issue. Do let us know if you have any feedback surrounding the documentation.

Once you have reproduced the issue, we’d appreciate to learn your expected
timeline for an update to be released. With any fix, please attribute the
report to “Google Autofuzz project”.

We are also pleased to inform you that your project is eligible for inclusion
to the OSS-Fuzz project, which can provide additional continuous fuzzing, and
encourage you to investigate integration options
(https://github.com/google/oss-fuzz/blob/master/docs/new_project_guide.md).

Don’t hesitate to let us know if you have any questions!

Google AutoFuzz Team

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]