Skip to content

Commit 81eebd5

Browse files
committed
Merge tag 'for-5.16/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
Pull device mapper fixes from Mike Snitzer: - Fix use after free in DM btree remove's rebalance_children() - Fix DM integrity data corruption, introduced during 5.16 merge, due to improper use of bvec_kmap_local() * tag 'for-5.16/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm integrity: fix data corruption due to improper use of bvec_kmap_local dm btree remove: fix use after free in rebalance_children()
2 parents 1744a22 + 1cef171 commit 81eebd5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/md/dm-integrity.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1963,7 +1963,7 @@ static bool __journal_read_write(struct dm_integrity_io *dio, struct bio *bio,
19631963
n_sectors -= bv.bv_len >> SECTOR_SHIFT;
19641964
bio_advance_iter(bio, &bio->bi_iter, bv.bv_len);
19651965
retry_kmap:
1966-
mem = bvec_kmap_local(&bv);
1966+
mem = kmap_local_page(bv.bv_page);
19671967
if (likely(dio->op == REQ_OP_WRITE))
19681968
flush_dcache_page(bv.bv_page);
19691969

drivers/md/persistent-data/dm-btree-remove.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,9 @@ static int rebalance_children(struct shadow_spine *s,
423423

424424
memcpy(n, dm_block_data(child),
425425
dm_bm_block_size(dm_tm_get_bm(info->tm)));
426-
dm_tm_unlock(info->tm, child);
427426

428427
dm_tm_dec(info->tm, dm_block_location(child));
428+
dm_tm_unlock(info->tm, child);
429429
return 0;
430430
}
431431

0 commit comments

Comments
 (0)