]> git.baikalelectronics.ru Git - kernel.git/commit
dm writecache: fix a crash due to reading past end of dirty_bitmap
authorMikulas Patocka <mpatocka@redhat.com>
Thu, 16 Aug 2018 16:23:19 +0000 (12:23 -0400)
committerMike Snitzer <snitzer@redhat.com>
Thu, 16 Aug 2018 17:43:01 +0000 (13:43 -0400)
commitd331714515442118357d0ca6b0b0fdad2406a29f
treeb983945975d697c37ac0193d18ca022cca4c3fb0
parent905c319666746ddfb2688250d817e8e017e51eef
dm writecache: fix a crash due to reading past end of dirty_bitmap

wc->dirty_bitmap_size is in bytes so must multiply it by 8, not by
BITS_PER_LONG, to get number of bitmap_bits.

Fixes crash in find_next_bit() that was reported:
https://bugzilla.kernel.org/show_bug.cgi?id=200819

Reported-by: edo.rus@gmail.com
Fixes: 6e57b578596f ("dm: add writecache target")
Cc: stable@vger.kernel.org # 4.18
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-writecache.c