From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4D3A93858C60; Mon, 6 Dec 2021 11:39:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D3A93858C60 From: "evvers at ya dot ru" To: elfutils-devel@sourceware.org Subject: [Bug libdw/28654] New: There seems to be an infinite loop somewhere in dwfl_segment_report_module Date: Mon, 06 Dec 2021 11:39:31 +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: evvers at ya dot ru 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-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2021 11:39:31 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28654 Bug ID: 28654 Summary: There seems to be an infinite loop somewhere in dwfl_segment_report_module Product: elfutils Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: libdw Assignee: unassigned at sourceware dot org Reporter: evvers at ya dot ru CC: elfutils-devel at sourceware dot org Target Milestone: --- Created attachment 13822 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D13822&action=3Ded= it file triggering an infinite loop in dwfl_segment_report_module One of systemd fuzz targets discovered what seems to be an infinite loop in dwfl_segment_report_module. It can be reproduced by building the master bra= nch of the elfutils repository and passing the attachment to `./src/stack`: ``` $ git describe elfutils-0.186-7-g99782bd2 ``` ``` autoreconf -i -f ./configure --enable-maintainer-mode make -j$(nproc) V=3D1 LD_PRELOAD=3D"./libelf/libelf.so ./libdw/libdw.so" ./src/stack --core oss-fuzz-41572 ``` According to `eu-stack` it's in dwfl_segment_report_module ``` #0 0x00007fa48b3eecf3 dwfl_segment_report_module #1 0x00007fa48b3f2c88 dwfl_core_file_report@@ELFUTILS_0.158 #2 0x0000000000402ec7 parse_opt #3 0x00007fa48b0abf82 argp_parse #4 0x00000000004024eb main #5 0x00007fa48afc6b75 __libc_start_main #6 0x000000000040272e _start ``` It was also reported in https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3D41572 ``` ALARM: working on the last Unit for 61 seconds and the timeout value is 60 (use -timeout=3DN to change) =3D=3D782=3D=3D ERROR: libFuzzer: timeout after 61 seconds #0 0x52fdb1 in __sanitizer_print_stack_trace /src/llvm-project/compiler-rt/lib/asan/asan_stack.cpp:87:3 #1 0x4707e8 in fuzzer::PrintStackTrace() cxa_noexception.cpp:0 #2 0x455679 in fuzzer::Fuzzer::AlarmCallback() cxa_noexception.cpp:0 #3 0x7ff8fd7473bf in libpthread.so.0 #4 0x46e23c in HandleCmp /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerTracePC.cpp:390:31 #5 0x46e23c in __sanitizer_cov_trace_cmp8 /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerTracePC.cpp:483:15 #6 0x5f6edb in dwfl_segment_report_module /src/elfutils/libdwfl/dwfl_segment_report_module.c:546:29 #7 0x567135 in dwfl_core_file_report /src/elfutils/libdwfl/core-file.c:559:17 #8 0x55f280 in LLVMFuzzerTestOneInput /src/fuzz-dwfl-core.c:52:6 #9 0x456ca3 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) cxa_noexception.cpp:0 #10 0x4425b2 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsign= ed long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:324:6 #11 0x44807a in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned ch= ar const*, unsigned long)) cxa_noexception.cpp:0 #12 0x470fa2 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10 #13 0x7ff8fd53b0b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/libc-start.c:308:16 #14 0x41f83d in _start SUMMARY: libFuzzer: timeout ``` --=20 You are receiving this mail because: You are on the CC list for the bug.=