summaryrefslogtreecommitdiff
path: root/block/blk-settings.c
diff options
context:
space:
mode:
authorAlden Tondettar <alden.tondettar@gmail.com>2017-01-15 15:31:56 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-08 10:26:06 +0200
commit0fc89de6ee777cf48a291505164da2c5eef17311 (patch)
treedada99a8a845adea1f83482d17eb896794df7280 /block/blk-settings.c
parenteaf9616e406c05c30bb7366be4aae631a715c7ae (diff)
partitions/efi: Fix integer overflow in GPT size calculation
[ Upstream commit c5082b70adfe8e1ea1cf4a8eff92c9f260e364d2 ] If a GUID Partition Table claims to have more than 2**25 entries, the calculation of the partition table size in alloc_read_gpt_entries() will overflow a 32-bit integer and not enough space will be allocated for the table. Nothing seems to get written out of bounds, but later efi_partition() will read up to 32768 bytes from a 128 byte buffer, possibly OOPSing or exposing information to /proc/partitions and uevents. The problem exists on both 64-bit and 32-bit platforms. Fix the overflow and also print a meaningful debug message if the table size is too large. Signed-off-by: Alden Tondettar <alden.tondettar@gmail.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Jens Axboe <axboe@fb.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'block/blk-settings.c')
0 files changed, 0 insertions, 0 deletions