public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "evv… via monorail" <monorail+v2.2672886254@chromium.org>
To: elfutils-devel@sourceware.org
Subject: Issue 60887 in oss-fuzz: elfutils:fuzz-libelf: Direct-leak in __libelf_decompress_zlib
Date: Sat, 29 Jul 2023 15:00:49 -0700	[thread overview]
Message-ID: <0000000000008b795d0601a754da@google.com> (raw)
In-Reply-To: <0=71cc74a7ba1af446b7ed6b9a08b414d9=179906139b10d40134117f89b865bd88=oss-fuzz@monorail-prod.appspotmail.com>

[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]


Comment #1 on issue 60887 by evv...@gmail.com: elfutils:fuzz-libelf: Direct-leak in __libelf_decompress_zlib
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60887#c1

The full backtrace is
```
==178009==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 1 byte(s) in 1 object(s) allocated from:
    #0 0x52efd6 in __interceptor_malloc /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:69:3
    #1 0x57a228 in __libelf_decompress_zlib /src/elfutils/libelf/elf_compress.c:370:19
    #2 0x57a987 in __libelf_decompress /src/elfutils/libelf/elf_compress.c:440:12
    #3 0x57a987 in __libelf_decompress_elf /src/elfutils/libelf/elf_compress.c:500:7
    #4 0x57629f in get_zdata /src/elfutils/libelf/elf_strptr.c:45:17
    #5 0x575c5e in elf_strptr /src/elfutils/libelf/elf_strptr.c:135:38
    #6 0x56c5b3 in fuzz_logic_one /src/fuzz-libelf.c:40:26
    #7 0x56cc7f in LLVMFuzzerTestOneInput /src/fuzz-libelf.c:88:3
```

I haven't figured out how to trigger that memory leak without the fuzz target
but as far as I can tell `fuzz_logic_one` was inspired by the elfgetzdata test in
the sense that it calls elf_nextscn/elf_strptr/elf_compress.

The code triggering the memory leak is
https://github.com/google/oss-fuzz/blob/24328c88fd610decaf311020ffc7073aec1db252/projects/elfutils/fuzz-libelf.c#L27C6-L27C20

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

  parent reply	other threads:[~2023-07-29 22:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0=71cc74a7ba1af446b7ed6b9a08b414d9=179906139b10d40134117f89b865bd88=oss-fuzz@monorail-prod.appspotmail.com>
2023-07-27 20:44 ` ClusterFuzz-External via monorail
2023-07-29 14:38   ` Mark Wielaard
2023-07-29 22:00 ` evv… via monorail [this message]
2023-07-30 12:03   ` Mark Wielaard
2023-08-03 18:08 ` ClusterFuzz-External via monorail

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0000000000008b795d0601a754da@google.com \
    --to=monorail+v2.2672886254@chromium.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=oss-fuzz@monorail-prod.appspotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).