From nobody Mon Oct 04 16:43:26 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 BA5CA8D4BB7 for ; Mon, 4 Oct 2021 16:43:26 +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 4HNRNt4qzWz3Qnf for ; Mon, 4 Oct 2021 16:43:26 +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 868EC1C9CA for ; Mon, 4 Oct 2021 16:43:26 +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 194GhQk9085807 for ; Mon, 4 Oct 2021 16:43:26 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 194GhQ3x085806 for ports-bugs@FreeBSD.org; Mon, 4 Oct 2021 16:43:26 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 258929] sysutils/fusefs-ntfs: ntfs-3g can seg fault if a directory entry is corrupt Date: Mon, 04 Oct 2021 16:43:26 +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 Some People 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=3D258929 Bug ID: 258929 Summary: sysutils/fusefs-ntfs: ntfs-3g can seg fault if a directory entry is corrupt Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Some People 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 228439 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D228439&action= =3Dedit sysutils/fusefs-ntfs: this disk image causes ntfs-3g to seg fault due to a corrupt directory entry ntfs_inode_lookup_by_name() doesn't adequately bounds-check the ie loop variable. If ir->index.entries_offset is huge, then ie =3D &ir->index + ir->index.entries_offset will be a wild pointer. If in addition ir->index.index_length is huge, then the for-loop's check that ie < index_end won't be effective. And the for loop will crash when it tries to check that ie + ie->key_length < index_end, because ie isn't valid. I've attached a demo disk image. % gunzip ntx6.img.gz % sudo mdconfig -f ntx6.img % sudo ntfs-3g /dev/md0p1 /mnt 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 ntfs_inode_lookup_by_name (dir_ni=3D0x40869320, uname=3D0x40842010,=20 uname_len=3D7) at dir.c:307 #1 0x00000000400bb0b0 in ntfs_pathname_to_inode (vol=3D0x40845000, parent= =3D0x0,=20 pathname=3D) at dir.c:782 #2 0x00000000400d113a in ntfs_open_secure (vol=3D) at security.c:4482 #3 0x00000000400d5dca in ntfs_device_mount (dev=3D,=20 flags=3D436207616) at volume.c:1243 #4 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.=