udf: Improve table length check to avoid possible overflow
authorJan Kara <jack@suse.cz>
Tue, 10 Jul 2012 15:58:04 +0000 (17:58 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 7 Oct 2012 21:37:55 +0000 (23:37 +0200)
commit6b8040006ca5c3bb62be3c8ceb377bbfd358d076
treedef96b0a91a296e84f20a82ff969b43814a1a08f
parent65ff664e2f099decc176a151670d6ecb9b6efb60
udf: Improve table length check to avoid possible overflow

commit 57b9655d01ef057a523e810d29c37ac09b80eead upstream.

When a partition table length is corrupted to be close to 1 << 32, the
check for its length may overflow on 32-bit systems and we will think
the length is valid. Later on the kernel can crash trying to read beyond
end of buffer. Fix the check to avoid possible overflow.

CC: stable@vger.kernel.org
Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Willy Tarreau <w@1wt.eu>
fs/udf/super.c