milos-linux/drivers/md
Junrui Luo f9ddb621b2 md/raid10: fix divide-by-zero in setup_geo() with zero far_copies
commit 9aa6d860b0 upstream.

setup_geo() extracts near_copies (nc) and far_copies (fc) from the
user-provided layout parameter without checking for zero. When fc=0
with the "improved" far set layout selected, 'geo->far_set_size =
disks / fc' triggers a divide-by-zero.

Validate nc and fc immediately after extraction, returning -1 if
either is zero.

Fixes: 475901aff1 ("MD RAID10: Improve redundancy for 'far' and 'offset' algorithms (part 1)")
Cc: stable@vger.kernel.org
Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
Link: https://lore.kernel.org/linux-raid/SYBPR01MB7881A5E2556806CC1D318582AF232@SYBPR01MB7881.ausprd01.prod.outlook.com
Signed-off-by: Yu Kuai <yukuai@fnnas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-05-14 15:31:13 +02:00
..
bcache bcache: fix cached_dev.sb_bio use-after-free and crash 2026-04-22 13:32:22 +02:00
dm-pcache Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
dm-vdo dm vdo encodings: clean up header and version functions 2026-01-27 17:00:25 +01:00
persistent-data dm-thin: fix metadata refcount underflow 2026-05-14 15:31:12 +02:00
dm-audit.c
dm-audit.h
dm-bio-prison-v1.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-bio-prison-v1.h
dm-bio-prison-v2.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-bio-prison-v2.h
dm-bio-record.h
dm-bufio.c dm-bufio: avoid redundant buffer_tree lookups 2026-01-19 15:39:21 +01:00
dm-builtin.c
dm-cache-background-tracker.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-cache-background-tracker.h
dm-cache-block-types.h
dm-cache-metadata.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-cache-metadata.h
dm-cache-policy-internal.h
dm-cache-policy-smq.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-cache-policy.c
dm-cache-policy.h
dm-cache-target.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-clone-metadata.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-clone-metadata.h
dm-clone-target.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-core.h Revert "dm: fix a race condition in retrieve_deps" 2026-01-28 15:44:02 +01:00
dm-crypt.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
dm-delay.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-dust.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-ebs-target.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-era-target.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-exception-store.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-exception-store.h dm-snapshot: fix 'scheduling while atomic' on real-time kernels 2025-12-10 19:28:22 +01:00
dm-flakey.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-ima.c
dm-ima.h
dm-init.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-integrity.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
dm-io-rewind.c
dm-io-tracker.h
dm-io.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-ioctl.c dm: fix a buffer overflow in ioctl processing 2026-05-14 15:31:12 +02:00
dm-kcopyd.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-linear.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-log-userspace-base.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-log-userspace-transfer.c
dm-log-userspace-transfer.h
dm-log-writes.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-log.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-mpath.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-mpath.h
dm-path-selector.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-path-selector.h
dm-ps-historical-service-time.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-ps-io-affinity.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-ps-queue-length.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-ps-round-robin.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-ps-service-time.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-raid.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-raid1.c dm mirror: fix integer overflow in create_dirty_log() 2026-05-07 06:14:13 +02:00
dm-region-hash.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-rq.c - dm-verity: various optimizations and fixes related to forward error 2026-02-11 17:04:21 -08:00
dm-rq.h
dm-snap-persistent.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
dm-snap-transient.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-snap.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
dm-stats.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
dm-stats.h
dm-stripe.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-switch.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-sysfs.c
dm-table.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-target.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-thin-metadata.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-thin-metadata.h
dm-thin.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-uevent.c
dm-uevent.h
dm-unstripe.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-verity-fec.c dm-verity-fec: fix reading parity bytes split across blocks (take 3) 2026-05-14 15:31:13 +02:00
dm-verity-fec.h dm-verity-fec: fix the size of dm_verity_fec_io::erasures 2026-05-14 15:31:13 +02:00
dm-verity-loadpin.c
dm-verity-target.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-verity-verify-sig.c dm-verity: fix section mismatch error 2026-01-21 14:06:23 +01:00
dm-verity-verify-sig.h dm-verity: fix section mismatch error 2026-01-21 14:06:23 +01:00
dm-verity.h dm-verity: consolidate the BH and normal work structs 2026-01-14 13:18:08 +01:00
dm-writecache.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-zero.c
dm-zone.c dm: use READ_ONCE in dm_blk_report_zones 2026-01-14 13:12:21 +01:00
dm-zoned-metadata.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
dm-zoned-reclaim.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-zoned-target.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dm-zoned.h
dm.c dm: use bio_clone_blkg_association 2026-01-26 15:36:22 +01:00
dm.h
Kconfig dm-verity: allow REED_SOLOMON to be 'm' if DM_VERITY is 'm' 2026-01-04 20:35:32 +01:00
Makefile
md-autodetect.c
md-bitmap.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
md-bitmap.h
md-cluster.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
md-cluster.h
md-linear.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
md-llbitmap.c md/md-llbitmap: raise barrier before state machine transition 2026-05-07 06:14:09 +02:00
md.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
md.h md: fix return value of mddev_trylock 2026-02-02 15:39:55 +08:00
raid0.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
raid0.h
raid1-10.c md/raid5: use mempool to allocate stripe_request_ctx 2026-01-26 13:11:29 +08:00
raid1.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
raid1.h md: remove recovery_disabled 2026-01-26 13:17:38 +08:00
raid5-cache.c md/raid5: validate payload size before accessing journal metadata 2026-05-07 06:14:09 +02:00
raid5-log.h
raid5-ppl.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
raid5.c md/raid5: fix soft lockup in retry_aligned_read() 2026-05-07 06:14:09 +02:00
raid5.h md: remove recovery_disabled 2026-01-26 13:17:38 +08:00
raid10.c md/raid10: fix divide-by-zero in setup_geo() with zero far_copies 2026-05-14 15:31:13 +02:00
raid10.h md: remove recovery_disabled 2026-01-26 13:17:38 +08:00