Date: Fri, 01 Oct 2021 09:49:31 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 258833] corrupt disk image can cause g_label_ntfs_taste to hang the kernel Message-ID: <bug-258833-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D258833 Bug ID: 258833 Summary: corrupt disk image can cause g_label_ntfs_taste to hang the kernel Product: Base System Version: 13.0-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: rtm@lcs.mit.edu Created attachment 228310 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D228310&action= =3Dedit disk image that causes g_label_ntfs_taste to hang the kernel The attached disk image causes g_label_ntfs_taste to freeze my kernel. To see this: % gunzip ntx1.img.gz % sudo mdconfig -f ntx1.img Or I can write ntx1.img to a USB memory stick with % dd bs=3D512 if=3Dntx1.img of=3D/dev/da0 conv=3Dsync and it will hang my system as soon as I insert it. Here's what I'm running: 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 problem is that these lines in g_label_ntfs_taste() can generate negative values if the disk content is bad, which g_read_data() &c don't handle well: recsize =3D (mftrecsz > 0) ? (mftrecsz * bf->bf_bps * bf->bf_spc) : (1 = << -mft voloff =3D bf->bf_mftcn * bf->bf_spc * bf->bf_bps + recsize * NTFS_VOLUMEINO; --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-258833-227>