]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
In fsck_ffs pass1, prevent the inosused variable from wrapping.
authorkib <kib@FreeBSD.org>
Fri, 14 Apr 2017 15:22:00 +0000 (15:22 +0000)
committerkib <kib@FreeBSD.org>
Fri, 14 Apr 2017 15:22:00 +0000 (15:22 +0000)
commit2cfeb7bc135948b85e7d073532e69c952539be67
treec193dddf4b30533a6ce268ae20250c56aacd0291
parent1120d44b7f02d2225cfb7301b109545387d0b18e
In fsck_ffs pass1, prevent the inosused variable from wrapping.

The loop that scans the used inode map when soft updates is in use
assumes that the inosused variable is signed.  However, ino_t is
unsigned, so the loop invariant is incorrect and the check for
inosused wrapping to < 0 can never be true.

Instead of checking for wrap after the fact just prevent it from
happening in the first place.

PR: 218592
Submitted by: Todd Miller <todd.miller@courtesan.com>
Reviewed by: mckusick
MFC after: 1 week
sbin/fsck_ffs/pass1.c