From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70796 invoked by alias); 11 Jan 2019 06:37:35 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 70452 invoked by uid 48); 11 Jan 2019 06:37:31 -0000 From: "wcventure at 126 dot com" To: elfutils-devel@sourceware.org Subject: [Bug general/24086] New: Multiple memory leak issues were discovered in in libelf and libdwelf Date: Fri, 11 Jan 2019 06:37:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: general X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: wcventure at 126 dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2019-q1/txt/msg00024.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D24086 Bug ID: 24086 Summary: Multiple memory leak issues were discovered in in libelf and libdwelf Product: elfutils Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: general Assignee: unassigned at sourceware dot org Reporter: wcventure at 126 dot com CC: elfutils-devel at sourceware dot org Target Milestone: --- Created attachment 11532 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D11532&action=3Ded= it POC Hi there,=20 We have discover lots of memory leak in libelf and libdwelf. Multiple memory leak issues were discovered in libelf and libdwelf, as distributed in Elfut= ils 0.174.=20 There are many heap allocations. But these heap allocations didn't dealloca= te in the end.=20 Please use the "./eu-strip $POC" to reproduce the bug. The ASAN dumps the stack trace as follows: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D22066=3D=3DERROR: LeakSanitizer: detected memory leaks >=20 > Direct leak of 6712 byte(s) in 1 object(s) allocated from: > #0 0x7f3aeabb6d78 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/= libasan.so.4+0xded78) > #1 0x7f3aea8b5a38 in allocate_elf /home/wencheng/Experiment/elfutils/= libelf/common.h:74 > #2 0x7f3aea8b5a38 in elf_clone /home/wencheng/Experiment/elfutils/lib= elf/elf_clone.c:56 >=20 > Direct leak of 96 byte(s) in 1 object(s) allocated from: > #0 0x7f3aeabb6d78 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/= libasan.so.4+0xded78) > #1 0x7f3aea39b1b2 in dwelf_strtab_init /home/wencheng/Experiment/elfu= tils/libdwelf/dwelf_strtab.c:94 > #2 0x44406d in process_file /home/wencheng/Experiment/elfutils/src/st= rip.c:769 >=20 > Indirect leak of 4080 byte(s) in 1 object(s) allocated from: > #0 0x7f3aeabb6b90 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/= libasan.so.4+0xdeb90) > #1 0x7f3aea39a787 in morememory /home/wencheng/Experiment/elfutils/li= bdwelf/dwelf_strtab.c:120 > #2 0x7f3aea39a787 in newstring /home/wencheng/Experiment/elfutils/lib= dwelf/dwelf_strtab.c:161 > #3 0x7f3aea39a787 in strtab_add /home/wencheng/Experiment/elfutils/li= bdwelf/dwelf_strtab.c:221 >=20 > Indirect leak of 1120 byte(s) in 28 object(s) allocated from: > #0 0x7f3aeabb6d78 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/= libasan.so.4+0xded78) > #1 0x7f3aea82ab3e in elf_newscn /home/wencheng/Experiment/elfutils/li= belf/elf_newscn.c:125 >=20 > Indirect leak of 288 byte(s) in 1 object(s) allocated from: > #0 0x7f3aeabb6f80 in realloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+= 0xdef80) > #1 0x7f3aea812223 in elf32_newphdr /home/wencheng/Experiment/elfutils= /libelf/elf32_newphdr.c:134 >=20 > Indirect leak of 240 byte(s) in 1 object(s) allocated from: > #0 0x7f3aeabb6b90 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/= libasan.so.4+0xdeb90) > #1 0x7f3aea39bd0c in dwelf_strtab_finalize /home/wencheng/Experiment/= elfutils/libdwelf/dwelf_strtab.c:322 > #2 0x7f3aea56c2bf (/home/wencheng/Experiment/elfutils/build/lib/libd= w.so.1+0x3852bf) >=20 > SUMMARY: AddressSanitizer: 12536 byte(s) leaked in 33 allocation(s). --=20 You are receiving this mail because: You are on the CC list for the bug.