From nobody Thu Mar 21 10:13:04 2024 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V0h9X5vS5z5Fkbw for ; Thu, 21 Mar 2024 10:13:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V0h9X3D0dz44HH for ; Thu, 21 Mar 2024 10:13:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711015984; a=rsa-sha256; cv=none; b=bjuaPswK9l8B4sf4bEc5A4w1PDgTc6R5albBLU77kvQILGBm/iZcSf3CV60ce5dv9W8LZu 3Imlqnht9ZtJ/k9u+1Zx0OECJ7YwuZAnRGxCWzBDSxoMR/mr1cHLK27xVzHSgeWpJzznn5 VYu3HAwHUU4ZK7j9UlRwlUqXdLkeMLdUC83GOWf2U/tkD+o8rJ9PSn2OQhwxuc1nukbb4c bSLfh13YBOVDFC8liyozoQ3VcgIIm46BC5msfbnevBnFvbbwXjQOVrIbMgzjse0byExflX SkIbySsw2y8jHR42m/WxpIVyhJuAN5QSKh0UrSHpvG/7MEZUwNgdQWiSr8pVfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711015984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iZmFgbdO/Znfleyrj6lqwX9zqwy3EtgCf0mQ8GIMfOo=; b=jAGKS8cENQ10LxViyV34v1dtKhSoehuEz9V/of+RcZlaMCoNliuYU0Lz4Hvng5z4g+puo9 QUDSiMtjzGhcy6WmYo3bWmUxSEuFOKh2mUNv+JVC25qnS/gGChprivxG05a6pz1ltj+9r9 6+781b5y2ooSGgFceLokj/fvOGTCXBubvIMauHtJV38K97xu14Fih9xE6YjBbQiNwyZm+J WjDXYpW5PU2n6E+bny0ZJPO7BOHd2GKXOnMt5TXzEv9cisHxqAY6nCB5erlSf6tc0eGtQD +9WiYzJaIQDXXSkOIzpxo8B1h/U9VIfZO0Yd9l97la0T2EMbB3NtxsTNGbCu5Q== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V0h9X2nfczWmh for ; Thu, 21 Mar 2024 10:13:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 42LAD43T070209 for ; Thu, 21 Mar 2024 10:13:04 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 42LAD404070208 for bugs@FreeBSD.org; Thu, 21 Mar 2024 10:13:04 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 277861] corrupt ELF file can crash llvm-objdump in printSymbolVersionDefinition() Date: Thu, 21 Mar 2024 10:13:04 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: rtm@lcs.mit.edu X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D277861 Bug ID: 277861 Summary: corrupt ELF file can crash llvm-objdump in printSymbolVersionDefinition() Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: rtm@lcs.mit.edu Created attachment 249368 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D249368&action= =3Dedit broken ELF file that crashes llvm-objdump in printSymbolVersionDefinition() This line in printSymbolVersionDefinition() in llvm-project/llvm/tools/llvm-objdump/ELFDump.cpp forms a pointer using a value pulled from the ELF file (vd_aux) without a sanity check: const uint8_t *BufAux =3D Buf + Verdef->vd_aux; It may be that the subsequent uses of vda_next and vd_next have a similar problem. I've attached an ELF file that crashes objdump due to a huge vd_aux: # freebsd-version 15.0-CURRENT # objdump --version LLVM (http://llvm.org/): LLVM version 17.0.6 Optimized build with assertions. ... # objdump -p objdump2a.exe objdump2a.exe: file format elf32-lanai Program Header: objdump: warning: 'objdump2a.exe': section [index 7] has invalid sh_entsize: expected 8, but got 5 Version definitions: 1 0x00 0x7650bc00 PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the crash backtrace. Stack dump: 0. Program arguments: objdump -p objdump2a.exe #0 0x0000000001230c41 PrintStackTrace /usr/src/contrib/llvm-project/llvm/lib/Support/Unix/Signals.inc:602:13 #1 0x000000000122f0b5 RunSignalHandlers /usr/src/contrib/llvm-project/llvm/lib/Support/Signals.cpp:105:18 #2 0x0000000001231365 SignalHandler /usr/src/contrib/llvm-project/llvm/lib/Support/Unix/Signals.inc:0:3 #3 0x00000008255ae5ff handle_signal /usr/src/lib/libthr/thread/thr_sig.c:0= :3 #4 0x00000008255adbbb thr_sighandler /usr/src/lib/libthr/thread/thr_sig.c:244:1 #5 0x00000008223cd2d3 ([vdso]+0x2d3) #6 0x0000000000de60d7 read /usr/src/contrib/llvm-project/llvm/include/llvm/Support/Endian.h:66:3 #7 0x0000000000de60d7 read /usr/src/contrib/llvm-project/llvm/include/llvm/Support/Endian.h:77:10 #8 0x0000000000de60d7 operator unsigned int /usr/src/contrib/llvm-project/llvm/include/llvm/Support/Endian.h:216:12 #9 0x0000000000de60d7 printSymbolVersionDefinition > /usr/src/contrib/llvm-project/llvm/tools/llvm-objdump/ELFDump.cpp:398:45 #10 0x0000000000de60d7 printSymbolVersion /usr/src/contrib/llvm-project/llvm/tools/llvm-objdump/ELFDump.cpp:425:7 #11 0x0000000000de60d7 printPrivateHeaders /usr/src/contrib/llvm-project/llvm/tools/llvm-objdump/ELFDump.cpp:432:3 #12 0x0000000000e6a13c dumpObject /usr/src/contrib/llvm-project/llvm/tools/llvm-objdump/llvm-objdump.cpp:2815= :7 #13 0x0000000000e654b0 dumpInput /usr/src/contrib/llvm-project/llvm/tools/llvm-objdump/llvm-objdump.cpp:0:5 #14 0x0000000000e654b0 for_each, std::__1::allocator > *>, void (*)(llvm::StringRef)> /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/__algorithm/for_each.h:= 26:5 #15 0x0000000000e654b0 for_each, std::__1::allocator >, std::__1::allocator, std::__1::allocator > > > &, void (*)(llvm::StringRef)> /usr/src/contrib/llvm-project/llvm/include/llvm/ADT/STLExtras.h:1731:10 #16 0x0000000000e654b0 main /usr/src/contrib/llvm-project/llvm/tools/llvm-objdump/llvm-objdump.cpp:3248= :3 #17 0x0000000828d4d0aa __libc_start1 /usr/src/lib/libc/csu/libc_start1.c:15= 7:2 Segmentation fault (core dumped) --=20 You are receiving this mail because: You are the assignee for the bug.=