From 33663c724656d32b9381705a6c8d773e92dc4697 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Tue, 26 Feb 2008 03:05:48 +0000 Subject: [PATCH] In pass2check(): Be more strict with the inode information before further processing the information. chk1 is more prone to crash when insane information is provided by the on-disk inode, and does not even work if the inode is being smarshed badly. --- sbin/fsck_ffs/pass2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/fsck_ffs/pass2.c b/sbin/fsck_ffs/pass2.c index c4fdd2a8a578..59a7a84c7d94 100644 --- a/sbin/fsck_ffs/pass2.c +++ b/sbin/fsck_ffs/pass2.c @@ -242,6 +242,8 @@ pass2check(struct inodesc *idesc) /* * check for "." */ + if (dirp->d_ino > maxino) + goto chk2; if (idesc->id_entryno != 0) goto chk1; if (dirp->d_ino != 0 && strcmp(dirp->d_name, ".") == 0) {