summaryrefslogtreecommitdiff
path: root/drivers/md/dm-unstripe.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-11-06 07:56:47 -1000
committerLinus Torvalds <torvalds@linux-foundation.org>2024-11-06 07:56:47 -1000
commit9e23acf024895a50306508880a075efa18656322 (patch)
tree1cb8d7abded88c993c812de4b08098764d3e602a /drivers/md/dm-unstripe.c
parent0951fede4e5215e4529a3b711ac94fc84f90eca8 (diff)
parentc0ade5d98979585d4f5a93e4514c2e9a65afa08d (diff)
downloadlinux-9e23acf024895a50306508880a075efa18656322.tar.gz
linux-9e23acf024895a50306508880a075efa18656322.tar.bz2
linux-9e23acf024895a50306508880a075efa18656322.zip
Merge tag 'for-6.12/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
Pull device mapper fixes from Mikulas Patocka: - fix memory safety bugs in dm-cache - fix restart/panic logic in dm-verity - fix 32-bit unsigned integer overflow in dm-unstriped - fix a device mapper crash if blk_alloc_disk fails * tag 'for-6.12/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm cache: fix potential out-of-bounds access on the first resume dm cache: optimize dirty bit checking with find_next_bit when resizing dm cache: fix out-of-bounds access to the dirty bitset when resizing dm cache: fix flushing uninitialized delayed_work on cache_ctr error dm cache: correct the number of origin blocks to match the target length dm-verity: don't crash if panic_on_corruption is not selected dm-unstriped: cast an operand to sector_t to prevent potential uint32_t overflow dm: fix a crash if blk_alloc_disk fails
Diffstat (limited to 'drivers/md/dm-unstripe.c')
-rw-r--r--drivers/md/dm-unstripe.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-unstripe.c b/drivers/md/dm-unstripe.c
index 48587c16c445..e8a9432057dc 100644
--- a/drivers/md/dm-unstripe.c
+++ b/drivers/md/dm-unstripe.c
@@ -85,8 +85,8 @@ static int unstripe_ctr(struct dm_target *ti, unsigned int argc, char **argv)
}
uc->physical_start = start;
- uc->unstripe_offset = uc->unstripe * uc->chunk_size;
- uc->unstripe_width = (uc->stripes - 1) * uc->chunk_size;
+ uc->unstripe_offset = (sector_t)uc->unstripe * uc->chunk_size;
+ uc->unstripe_width = (sector_t)(uc->stripes - 1) * uc->chunk_size;
uc->chunk_shift = is_power_of_2(uc->chunk_size) ? fls(uc->chunk_size) - 1 : 0;
tmp_len = ti->len;