From nobody Fri May 12 10:44:32 2023 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 4QHlkm3yR6z4Bqs1 for ; Fri, 12 May 2023 10:44:32 +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 4QHlkm28TJz3gyR for ; Fri, 12 May 2023 10:44:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683888272; 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=Q6YMsSsyk5ZikvAXyMuxlFqhCz4DAe+vtlGEu7Bqjmg=; b=uZs+caLElItFOG3+gjm8UI2DLxIVo6qbCDVj2chD/TL4aLnZlBHfLOE1x0znLNbrMeeBEF 1Incd3Ylis/8wlI3cW1uyFgrc5jvoQCa1zTZhC3Gn+pdMy25u1IpctYkWVpWah++g6RWjl huMAcS9vHytUUBvTJ5/noFUGOoyC2MvPeYRGSfFdUxpLyOyRJGTpXKV+G9tegKt0rdsnkL 0r4UCbelHdXVXxx5/8f4kRzI4509To7wx8V3ppu2MYip/aIfXQvq28W+5AUqo/sYIY6rAw EpdxSxPA5DKVXuMnm9je8MrT1bJYuTDKoM3HT+j1nI5ge11yU4Rd4+WgjBiAhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683888272; a=rsa-sha256; cv=none; b=VkLBO4iMyKD3AM0difAEZJqNkV9eLvtL0HqQCLofJaJCd/nVDGI/qNErMc9zDJAJYUzMK9 nf7eva/B0oHaxVBIzsVaf8IsMDJTPeyvfwRIcU7mg/Oz+q/8qCJ1NJBaqrrpDuqdvFGDjR u8ck2oXP1dXuutUHp9D4c5Pu/4S9F1NPsigQ1dBTK5siZ6+ZwzYMpW4ww8kX6/ztrYTkCs bOYfwDDiolfpUkzgvYHfzPbZcx4/ce18s4AlL9NjeDpBBXA54TXLGGMg1ijPbPW6dO3wx7 gCOUIsyd0nCQCHS59JjeKfaTSGEFc8zW2Nr5bTK/LQ05N5XNW+Jw43X7cdyoUw== 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 4QHlkm1FFRzXRN for ; Fri, 12 May 2023 10:44:32 +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 34CAiWrS042004 for ; Fri, 12 May 2023 10:44:32 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 34CAiWVe042003 for bugs@FreeBSD.org; Fri, 12 May 2023 10:44:32 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 271378] negative jt_size in ffs truncate journal record causes fsck to crash Date: Fri, 12 May 2023 10:44:32 +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 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271378 Bug ID: 271378 Summary: negative jt_size in ffs truncate journal record causes fsck to crash 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 242130 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D242130&action= =3Dedit gzipped ffs image with bad journal record that causes fsck to crash in ino_trunc If a truncate journal record has a negative size, suj.c's ino_trunc() will index di_db[] with a negative index here: lastlbn =3D lblkno(fs, blkroundup(fs, size)); for (i =3D lastlbn; i < UFS_NDADDR; i++) { if ((bn =3D DIP(dp, di_db[i])) =3D=3D 0) I've attached a gzipped file system image; here's the backtrace from fsck_ffs -y fsck22a.img: Program received signal SIGSEGV, Segmentation fault. Address not mapped to object. 0x000000000022aaca in ino_trunc (ino=3D3, size=3D-4420917493761) at suj.c:1= 329 1329 if ((bn =3D DIP(dp, di_db[i])) =3D=3D 0) (gdb) where #0 0x000000000022aaca in ino_trunc (ino=3D3, size=3D-4420917493761) at suj= .c:1329 #1 0x00000000002270f7 in cg_trunc (sc=3D0x800a8a8c0) at suj.c:1574 #2 0x0000000000226dc5 in cg_apply (apply=3D0x227090 ) at suj.c:1= 638 #3 0x0000000000225562 in suj_check (filesys=3D0x7fffffffed74 "junk") at suj.c:2460 #4 0x00000000002195c6 in checkfilesys (filesys=3D0x7fffffffed74 "junk") at main.c:356 #5 0x0000000000218f72 in main (argc=3D1, argv=3D0x7fffffffea20) at main.c:= 210 --=20 You are receiving this mail because: You are the assignee for the bug.=