]> git.karo-electronics.de Git - karo-tx-uboot.git/commit
ext4: Avoid out-of-bounds access of block bitmap
authorStefan Brüns <stefan.bruens@rwth-aachen.de>
Tue, 6 Sep 2016 02:36:50 +0000 (04:36 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 23 Sep 2016 13:02:40 +0000 (09:02 -0400)
commit0ceef3d3710960347fde6c57f12f3de6fe9cfaaf
tree72cac3cf807debecfaffe262c6d6994667a88edd
parenta9fa0ed183b7e156db0c711f2aad8d573fae3498
ext4: Avoid out-of-bounds access of block bitmap

If the blocksize is 1024, count is initialized with 1. Incrementing count
by 8 will never match (count == fs->blksz * 8), and ptr may be
incremented beyond the buffer end if the bitmap is filled. Add the
startblock offset after the loop.

Remove the second loop, as only the first iteration will be done.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
fs/ext4/ext4_common.c