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)
committerJan Kara <jack@suse.cz>
Tue, 10 Jul 2012 16:02:17 +0000 (18:02 +0200)
commit57b9655d01ef057a523e810d29c37ac09b80eead
tree2574c27c92170f6e580ac9d59c5719bffae994d1
parent44f4f729e7a143b08bd63c33cb78b3181d9f4716
udf: Improve table length check to avoid possible overflow

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>
fs/udf/super.c