From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 845BF3858400; Wed, 22 Dec 2021 00:35:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 845BF3858400 From: "evvers at ya dot ru" To: elfutils-devel@sourceware.org Subject: [Bug libdw/28720] New: UBSan: member access within misaligned address 0x7f6e8d80f142 for type 'struct Elf32_Phdr', which requires 4 byte alignment Date: Wed, 22 Dec 2021 00:35:52 +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: Wed, 22 Dec 2021 00:35:52 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28720 Bug ID: 28720 Summary: UBSan: member access within misaligned address 0x7f6e8d80f142 for type 'struct Elf32_Phdr', which requires 4 byte alignment 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 13872 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D13872&action=3Ded= it File triggering misaligned access While I was testing https://sourceware.org/pipermail/elfutils-devel/2021q4/004584.html I passed FUZZ_TIME=3D3600 to the test to run it for an hour and in the process it ra= n into another misaligned access. Just to make sure it isn't https://sourceware.org/bugzilla/show_bug.cgi?id=3D28685 I pulled the master branch with the "fuzz" branch included. It can be reproduced with `./src/stack`: ``` autoreconf -i -f ./configure --enable-maintainer-mode --enable-sanitize-undefined make -j$(nproc) V=3D1 UBSAN_OPTIONS=3Dprint_stacktrace=3D1:print_summary=3D1 LD_LIBRARY_PATH=3D"./libdw;./libelf" ./src/stack --core ../SIGABRT.PC.7fffe516d84c.STACK.d7ffe76d7.CODE.-6.ADDR.0.INSTR.mov____%eax= ,%ebp.fuzz gelf_xlate.h:42:1: runtime error: member access within misaligned address 0x7f3827783142 for type 'struct Elf32_Phdr', which requires 4 byte alignment 0x7f3827783142: note: pointer points here 00 00 00 10 00 00 00 00 00 c5 00 10 00 00 00 00 00 00 00 10 00 00 00 00= 00 00 01 00 00 00 06 15 ^ #0 0x7f38295f992c in Elf32_cvt_Phdr /home/vagrant/elfutils/libelf/gelf_xlate.h:42 #1 0x7f38295f8363 in elf32_xlatetom /home/vagrant/elfutils/libelf/elf32_xlatetom.c:104 #2 0x7f382952a821 in dwfl_link_map_report /home/vagrant/elfutils/libdwfl/link_map.c:925 #3 0x7f382952de80 in _new.dwfl_core_file_report /home/vagrant/elfutils/libdwfl/core-file.c:548 #4 0x402fa0 in parse_opt /home/vagrant/elfutils/src/stack.c:595 #5 0x7f382878b471 in argp_parse (/lib64/libc.so.6+0x11e471) #6 0x4026aa in main /home/vagrant/elfutils/src/stack.c:695 #7 0x7f382869a55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f) #8 0x7f382869a60b in __libc_start_main_impl (/lib64/libc.so.6+0x2d60b) #9 0x402944 in _start (/home/vagrant/elfutils/src/stack+0x402944) SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior gelf_xlate.h:42:1 in ``` --=20 You are receiving this mail because: You are on the CC list for the bug.=