Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-6.17/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm

Pull device mapper fixes from Mikulas Patocka:

- fix integer overflow in dm-stripe

- limit tag size in dm-integrity to 255 bytes

- fix 'alignment inconsistency' warning in dm-raid

* tag 'for-6.17/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
dm-raid: don't set io_min and io_opt for raid1
dm-integrity: limit MAX_TAG_SIZE to 255
dm-stripe: fix a possible integer overflow

+12 -6
+1 -1
drivers/md/dm-integrity.c
··· 133 133 commit_id_t commit_id; 134 134 }; 135 135 136 - #define MAX_TAG_SIZE (JOURNAL_SECTOR_DATA - JOURNAL_MAC_PER_SECTOR - offsetof(struct journal_entry, last_bytes[MAX_SECTORS_PER_BLOCK])) 136 + #define MAX_TAG_SIZE 255 137 137 138 138 #define METADATA_PADDING_SECTORS 8 139 139
+4 -2
drivers/md/dm-raid.c
··· 3813 3813 struct raid_set *rs = ti->private; 3814 3814 unsigned int chunk_size_bytes = to_bytes(rs->md.chunk_sectors); 3815 3815 3816 - limits->io_min = chunk_size_bytes; 3817 - limits->io_opt = chunk_size_bytes * mddev_data_stripes(rs); 3816 + if (chunk_size_bytes) { 3817 + limits->io_min = chunk_size_bytes; 3818 + limits->io_opt = chunk_size_bytes * mddev_data_stripes(rs); 3819 + } 3818 3820 } 3819 3821 3820 3822 static void raid_presuspend(struct dm_target *ti)
+7 -3
drivers/md/dm-stripe.c
··· 456 456 struct queue_limits *limits) 457 457 { 458 458 struct stripe_c *sc = ti->private; 459 - unsigned int chunk_size = sc->chunk_size << SECTOR_SHIFT; 459 + unsigned int io_min, io_opt; 460 460 461 461 limits->chunk_sectors = sc->chunk_size; 462 - limits->io_min = chunk_size; 463 - limits->io_opt = chunk_size * sc->stripes; 462 + 463 + if (!check_shl_overflow(sc->chunk_size, SECTOR_SHIFT, &io_min) && 464 + !check_mul_overflow(io_min, sc->stripes, &io_opt)) { 465 + limits->io_min = io_min; 466 + limits->io_opt = io_opt; 467 + } 464 468 } 465 469 466 470 static struct target_type stripe_target = {