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)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 2 Aug 2012 13:37:46 +0000 (14:37 +0100)
commitc17fcfb52422d098dde1ccdc4a3d24a7ceeb33e2
treeec7c3b691db41e14d34a6af42c3349fc5e221a03
parente44be732863c136e9560c6bf7bf9b9d709a59fca
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.

Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/udf/super.c