From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95799 invoked by alias); 16 Oct 2018 07:18:20 -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 95714 invoked by uid 48); 16 Oct 2018 07:18:12 -0000 From: "wcventure at 126 dot com" To: elfutils-devel@sourceware.org Subject: [Bug libdw/23782] New: Negative-size-param problem in dwfl_getmodules.c in libdw, please use the POC to reproduce this bug. Date: Tue, 16 Oct 2018 07:18:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: libdw 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: 2018-q4/txt/msg00039.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D23782 Bug ID: 23782 Summary: Negative-size-param problem in dwfl_getmodules.c in libdw, please use the POC to reproduce this bug. Product: elfutils Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: libdw Assignee: unassigned at sourceware dot org Reporter: wcventure at 126 dot com CC: elfutils-devel at sourceware dot org Target Milestone: --- Created attachment 11331 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D11331&action=3Ded= it POC1 Hi, We are doing research on fuzz testing and our fuzzer caught a Negative-size-param problem in the latest elfutils(v0.174) code base. The funciton dwfl_getmodules in dwfl_getmodules.c library does not ensure a non-negative size. Those inputs will cause the Negative-size-param Problem, Segmentation fault. I have confirmed them with address sanitizer.=20 Please use the =E2=80=9C ./eu-readelf $POC -w =E2=80=9D to reproduce the bu= g. If you have any questions, please let me know. Thank you. The ASAN dumps the stack trace as follows: =3D=3D31028=3D=3DERROR: AddressSanitizer: negative-size-param: (size=3D-4) #0 0x7ff2abbf4866 (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x41866) #1 0x4973ad in print_debug_frame_section /media/hjwang/01D3344861A8D2E0/wcventure/Project/elfutils/src/readelf.c:6626 #2 0x4598f3 in print_debug /media/hjwang/01D3344861A8D2E0/wcventure/Project/elfutils/src/readelf.c:111= 60 #3 0x45e00a in process_elf_file /media/hjwang/01D3344861A8D2E0/wcventure/Project/elfutils/src/readelf.c:996 #4 0x45e00a in process_dwflmod /media/hjwang/01D3344861A8D2E0/wcventure/Project/elfutils/src/readelf.c:760 #5 0x7ff2ab8be2f4 in dwfl_getmodules /media/hjwang/01D3344861A8D2E0/wcventure/Project/elfutils/libdwfl/dwfl_getm= odules.c:86 #6 0x40d055 in process_file /media/hjwang/01D3344861A8D2E0/wcventure/Project/elfutils/src/readelf.c:868 #7 0x4058f1 in main /media/hjwang/01D3344861A8D2E0/wcventure/Project/elfutils/src/readelf.c:350 #8 0x7ff2aaf4682f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) #9 0x4064d8 in _start (/media/hjwang/01D3344861A8D2E0/wcventure/Project/elfutils/build/bin/eu-rea= delf+0x4064d8) Address 0x7ff2acca407d is a wild pointer. SUMMARY: AddressSanitizer: negative-size-param (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x41866) =3D=3D31028=3D=3DABORTING Aborted --=20 You are receiving this mail because: You are on the CC list for the bug.