From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5DC563858430; Tue, 4 Jan 2022 21:37:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5DC563858430 From: "mark at klomp dot org" To: elfutils-devel@sourceware.org Subject: [Bug libdw/28720] UBSan: member access within misaligned address 0x7f6e8d80f142 for type 'struct Elf32_Phdr', which requires 4 byte alignment Date: Tue, 04 Jan 2022 21:37:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: mark at klomp dot org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: mark at klomp dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: Tue, 04 Jan 2022 21:37:53 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28720 --- Comment #10 from Mark Wielaard --- (In reply to Evgeny Vereshchagin from comment #8) > (In reply to Mark Wielaard from comment #7) > > commit 9f70a762ab88ceebb8a48a7c9c3ce39ff7f205af > > Author: Mark Wielaard > > Date: Fri Dec 24 02:01:32 2021 +0100 > >=20 > > libdwfl: Calculate addr to read by hand in link_map.c read_addrs. > >=20=20=20=20=20 > > The gcc undefined sanitizer doesn't like the trick we use to calcul= ate > > the (possibly) unaligned addresses to read. So calculate them by ha= nd > > as unsigned char pointers. > >=20=20=20=20=20 > > https://sourceware.org/bugzilla/show_bug.cgi?id=3D28720 > >=20=20=20=20=20 > > Signed-off-by: Mark Wielaard > >=20 > > Which should this particular issue. >=20 >=20 > I'm not sure but it seems it can still be triggered with that commit appl= ied: > ``` > $ git log --oneline -5 > 9f70a762 (HEAD -> master, origin/master, origin/HEAD) libdwfl: Calculate > addr to read by hand in link_map.c read_addrs. > 5b490793 libdwfl: Call xlatetom on aligned buffers in dwfl_link_map_report > 1cf73965 libdwfl: Make sure dwfl_elf_phdr_memory_callback returns at least > minread > 4fdd8588 libdwfl: Always clean up build_id.memory > 8f8c78cc libdwfl: Handle unaligned Nhdr in dwfl_segment_report_module >=20 > $ autoreconf -i -f > $ ./configure --enable-maintainer-mode --enable-sanitize-undefined > $ make -j$(nproc) V=3D1 >=20 > $ UBSAN_OPTIONS=3Dprint_stacktrace=3D1:print_summary=3D1:halt_on_error=3D1 > LD_LIBRARY_PATH=3D"./libdw;./libelf" ./src/stack --core > ./attachment.cgi\?id\=3D13875 > gelf_xlate.h:48:1: runtime error: member access within misaligned address > 0x7f5cd5612077 for type 'struct Elf32_Dyn', which requires 4 byte alignme= nt That is a different issue than the one reported in comment #5. This bug might be split up for the different issues found. --=20 You are receiving this mail because: You are on the CC list for the bug.=