mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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: [email protected]
Fixes: 48debafe4f ("dm: add writecache target")
Cc: [email protected] # 4.18
Signed-off-by: Mikulas Patocka <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
This commit is contained in:
parent
bc9e9cf040
commit
1e1132ea21
1 changed files with 1 additions and 1 deletions
|
|
@ -457,7 +457,7 @@ static void ssd_commit_flushed(struct dm_writecache *wc)
|
|||
COMPLETION_INITIALIZER_ONSTACK(endio.c),
|
||||
ATOMIC_INIT(1),
|
||||
};
|
||||
unsigned bitmap_bits = wc->dirty_bitmap_size * BITS_PER_LONG;
|
||||
unsigned bitmap_bits = wc->dirty_bitmap_size * 8;
|
||||
unsigned i = 0;
|
||||
|
||||
while (1) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue