Skip to contentSkip to conversation

xfsprogs: fix integer overflow in xlog_find_verify_cycle

PATCH VIVEK TRIVEDI 1 participant 1 message Dec 4, 2015

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines

Ummm, in isolation that change is technically correct, but when you look at what bufblks contains it is clearly wrong. nbblks is an int, so "1 << ffs(nbblks)" should not be larger than an int.

Quoted 8 lines

i.e. bufblks is simply a count of blocks in the log, which by definition cannot be more than an int (in fact, 2^31 / 2^9 is the largest legal value it can have). Hence it can't be larger than an int, and all the functions it is passed to expect it to be an int...

Hence the use of xfs_daddr_t is wrong, and that's the first thing that needs fixing....

thanks for review!
I will resend updated patch.
thanks!
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs