From nobody Mon Oct 4 17:10:24 2021 X-Original-To: ports-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 D8ED210F812E for ; Mon, 4 Oct 2021 17:10:24 +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 4HNS005kLZz3k8Q for ; Mon, 4 Oct 2021 17:10:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 A18911CCFC for ; Mon, 4 Oct 2021 17:10:24 +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 194HAOgK095973 for ; Mon, 4 Oct 2021 17:10:24 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 194HAOm9095972 for ports-bugs@FreeBSD.org; Mon, 4 Oct 2021 17:10:24 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: ports-bugs@FreeBSD.org Subject: [Bug 258930] sysutils/fusefs-ntfs: corrupt file system can cause seg fault in ntfs_attr_record_resize() Date: Mon, 04 Oct 2021 17:10:24 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: rtm@lcs.mit.edu X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ports-bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc flagtypes.name 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: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports-bugs@freebsd.org X-BeenThere: freebsd-ports-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D258930 Bug ID: 258930 Summary: sysutils/fusefs-ntfs: corrupt file system can cause seg fault in ntfs_attr_record_resize() Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: ports-bugs@FreeBSD.org Reporter: rtm@lcs.mit.edu CC: freebsd@dussan.org Flags: maintainer-feedback?(freebsd@dussan.org) CC: freebsd@dussan.org Created attachment 228440 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D228440&action= =3Dedit sysutils/fusefs-ntfs: this disk image causes a seg fault in ntfs_attr_record_resize() The attached corrupt NTFS disk image causes this call to memmove() in ntfs_attr_record_resize() to crash: memmove((u8 *)a + new_size, (u8 *)a + attr_size, old_size - ((u8 *)a - (u8 *)m) - attr_size); I believe problem is that the third argument is negative -- or actually huge, since size_t is unsigned. % gunzip ntx7.img.gz=20 % sudo mdconfig -f ntx7.img=20 md0 % sudo ntfs-3g /dev/md0p1 /mnt Did not find any restart pages in $LogFile and it was not empty. The file system wasn't safely closed on Windows. Fixing. ntfs_attr_find: Corrupt inode (2): Input/output error Non-positive free clusters (0)! Non-positive free clusters (0)! Segmentation fault % ntfs-3g --version ntfs-3g 2017.3.23 external FUSE 29 % uname -a FreeBSD xxx 13.0-RELEASE-p4 FreeBSD 13.0-RELEASE-p4 #0: Tue Aug 24 07:33:27= UTC 2021=20=20=20=20 root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC= =20 amd64 The backtrace: #0 0x00000000402a725a in memmove () from /lib/libc.so.7 #1 0x00000000400b0d56 in ntfs_attr_record_resize (m=3D0x409d6400, a=3D0x40= 9d6508,=20 new_size=3D80) at attrib.c:4536 #2 0x00000000400b31f8 in ntfs_attr_update_mapping_pairs_i (na=3D0x40810500= ,=20 from_vcn=3D0, holes=3D) at attrib.c:5795 #3 0x00000000400af714 in ntfs_attr_update_mapping_pairs (na=3D0x409d6558,= =20 from_vcn=3D1107296256) at attrib.c:6003 #4 0x00000000400aed3a in ntfs_attr_pwrite_i (na=3D0x40810500, pos=3D0, cou= nt=3D0,=20 b=3D) at attrib.c:2249 #5 0x00000000400ae360 in ntfs_attr_pwrite (na=3D0x40810500, pos=3D0, count= =3D8192,=20 b=3D0x3fffffc758) at attrib.c:2351 #6 0x00000000400c68a8 in ntfs_empty_logfile (na=3D0x40810500) at logfile.c= :731 #7 0x00000000400d60e2 in ntfs_logfile_reset (vol=3D) at volume.c:1673 #8 0x00000000400d5ed6 in ntfs_device_mount (dev=3D,=20 flags=3D) at volume.c:1268 #9 0x00000000400d6478 in ntfs_mount (name=3D, flags=3D43620= 7616) at volume.c:1386 --=20 You are receiving this mail because: You are the assignee for the bug.=