Date: Thu, 7 Jan 2010 02:00:16 GMT From: dfilter@FreeBSD.ORG (dfilter service) To: freebsd-fs@FreeBSD.org Subject: Re: bin/138043: commit references a PR Message-ID: <201001070200.o0720GmS046833@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/138043; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: bin/138043: commit references a PR Date: Thu, 7 Jan 2010 01:57:22 +0000 (UTC) Author: delphij Date: Thu Jan 7 01:57:13 2010 New Revision: 201713 URL: http://svn.freebsd.org/changeset/base/201713 Log: MFC r176575: In pass1(), cap inosused to fs_ipg rather than allowing arbitrary number read from cylinder group. Chances that we read a smarshed cylinder group, and we can not 100% trust information it has supplied. fsck_ffs(8) will crash otherwise for some cases. PR: bin/138043 Reminded by: mckusick Modified: stable/5/sbin/fsck_ffs/pass1.c Directory Properties: stable/5/sbin/fsck_ffs/ (props changed) Modified: stable/5/sbin/fsck_ffs/pass1.c ============================================================================== --- stable/5/sbin/fsck_ffs/pass1.c Thu Jan 7 01:56:35 2010 (r201712) +++ stable/5/sbin/fsck_ffs/pass1.c Thu Jan 7 01:57:13 2010 (r201713) @@ -93,9 +93,11 @@ pass1(void) inumber = c * sblock.fs_ipg; setinodebuf(inumber); getblk(&cgblk, cgtod(&sblock, c), sblock.fs_cgsize); - if (sblock.fs_magic == FS_UFS2_MAGIC) + if (sblock.fs_magic == FS_UFS2_MAGIC) { inosused = cgrp.cg_initediblk; - else + if (inosused > sblock.fs_ipg) + inosused = sblock.fs_ipg; + } else inosused = sblock.fs_ipg; if (got_siginfo) { printf("%s: phase 1: cyl group %d of %d (%d%%)\n", _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001070200.o0720GmS046833>