linux-stable/drivers/md
Florian-Ewald Mueller 0aa9838e78 md/bitmap: Fix bitmap chunk size overflow issues
commit 4555211190 upstream.

- limit bitmap chunk size internal u64 variable to values not overflowing
  the u32 bitmap superblock structure variable stored on persistent media
- assign bitmap chunk size internal u64 variable from unsigned values to
  avoid possible sign extension artifacts when assigning from a s32 value

The bug has been there since at least kernel 4.0.
Steps to reproduce it:
1: mdadm -C /dev/mdx -l 1 --bitmap=internal --bitmap-chunk=256M -e 1.2
-n2 /dev/rnbd1 /dev/rnbd2
2 resize member device rnbd1 and rnbd2 to 8 TB
3 mdadm --grow /dev/mdx --size=max

The bitmap_chunksize will overflow without patch.

Cc: stable@vger.kernel.org

Signed-off-by: Florian-Ewald Mueller <florian-ewald.mueller@ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-07 11:15:55 +01:00
..
bcache bcache: fix set_at_max_writeback_rate() for multiple attached devices 2022-10-21 12:39:22 +02:00
persistent-data dm bufio: Add flags argument to dm_bufio_client_create 2022-07-28 17:46:14 -04:00
Kconfig
Makefile hardening updates for v5.20-rc1 2022-08-02 14:38:59 -07:00
dm-audit.c
dm-audit.h
dm-bio-prison-v1.c
dm-bio-prison-v1.h
dm-bio-prison-v2.c
dm-bio-prison-v2.h
dm-bio-record.h
dm-bufio.c dm bufio: Fix missing decrement of no_sleep_enabled if dm_bufio_client_create failed 2022-11-26 09:27:48 +01:00
dm-builtin.c
dm-cache-background-tracker.c
dm-cache-background-tracker.h
dm-cache-block-types.h
dm-cache-metadata.c dm cache: Fix ABBA deadlock between shrink_slab and dm_cache_metadata_abort 2023-01-07 11:15:48 +01:00
dm-cache-metadata.h dm cache: fix typo in 2 comment blocks 2022-07-07 11:49:37 -04:00
dm-cache-policy-internal.h
dm-cache-policy-smq.c
dm-cache-policy.c
dm-cache-policy.h
dm-cache-target.c dm cache: set needs_check flag after aborting metadata 2023-01-07 11:15:49 +01:00
dm-clone-metadata.c
dm-clone-metadata.h
dm-clone-target.c dm clone: Fix UAF in clone_dtr() 2023-01-07 11:15:49 +01:00
dm-core.h dm table: audit all dm_table_get_target() callers 2022-07-07 11:49:34 -04:00
dm-crypt.c dm-crypt: provide dma_alignment limit in io_hints 2022-11-26 09:27:40 +01:00
dm-delay.c dm: simplify basic targets 2022-05-05 17:31:35 -04:00
dm-dust.c
dm-ebs-target.c - Add flags argument to dm_bufio_client_create and introduce 2022-08-06 11:09:55 -07:00
dm-era-target.c dm era: commit metadata in postsuspend after worker stops 2022-06-21 13:35:01 -04:00
dm-exception-store.c
dm-exception-store.h
dm-flakey.c dm/dm-flakey: Use the new blk_opf_t type 2022-07-14 12:14:31 -06:00
dm-ima.c dm table: audit all dm_table_get_target() callers 2022-07-07 11:49:34 -04:00
dm-ima.h
dm-init.c
dm-integrity.c dm integrity: Fix UAF in dm_integrity_dtr() 2023-01-07 11:15:49 +01:00
dm-io-rewind.c dm: add two stage requeue mechanism 2022-07-07 11:49:32 -04:00
dm-io-tracker.h
dm-io.c dm/core: Combine request operation type and flags 2022-07-14 12:14:31 -06:00
dm-ioctl.c dm ioctl: fix misbehavior if list_versions races with module loading 2022-11-26 09:27:48 +01:00
dm-kcopyd.c - Refactor DM core's mempool allocation so that it clearer by not 2022-08-02 14:21:25 -07:00
dm-linear.c libnvdimm for 5.19 2022-05-27 15:49:30 -07:00
dm-log-userspace-base.c
dm-log-userspace-transfer.c
dm-log-userspace-transfer.h
dm-log-writes.c dm-log-writes: set dma_alignment limit in io_hints 2022-12-02 17:43:16 +01:00
dm-log.c dm mirror log: Use the new blk_opf_t type 2022-07-14 12:14:31 -06:00
dm-mpath.c dm mpath: provide high-resolution timer to HST for bio-based 2022-05-09 15:39:23 -04:00
dm-mpath.h
dm-path-selector.c
dm-path-selector.h dm mpath: provide high-resolution timer to HST for bio-based 2022-05-09 15:39:23 -04:00
dm-ps-historical-service-time.c dm mpath: provide high-resolution timer to HST for bio-based 2022-05-09 15:39:23 -04:00
dm-ps-io-affinity.c
dm-ps-queue-length.c
dm-ps-round-robin.c
dm-ps-service-time.c
dm-raid.c md: unlock mddev before reap sync_thread in action_store 2022-08-02 17:14:40 -06:00
dm-raid1.c dm/core: Reduce the size of struct dm_io_request 2022-07-14 12:14:31 -06:00
dm-region-hash.c
dm-rq.c dm: unexport dm_get_reserved_rq_based_ios 2022-06-29 12:46:05 -04:00
dm-rq.h
dm-snap-persistent.c - Add flags argument to dm_bufio_client_create and introduce 2022-08-06 11:09:55 -07:00
dm-snap-transient.c
dm-snap.c dm snapshot: fix typo in snapshot_map() comment 2022-07-07 11:49:39 -04:00
dm-stats.c dm stats: add cond_resched when looping over entries 2022-05-09 12:11:07 -04:00
dm-stats.h
dm-stripe.c dax: add .recovery_write dax_operation 2022-05-16 13:37:59 -07:00
dm-switch.c
dm-sysfs.c
dm-table.c - Refactor DM core's mempool allocation so that it clearer by not 2022-08-02 14:21:25 -07:00
dm-target.c dax: introduce DAX_RECOVERY_WRITE dax access mode 2022-05-16 13:35:56 -07:00
dm-thin-metadata.c dm thin: Use last transaction's pmd->root when commit failed 2023-01-07 11:15:48 +01:00
dm-thin-metadata.h
dm-thin.c dm thin: Fix UAF in run_timer_softirq() 2023-01-07 11:15:49 +01:00
dm-uevent.c
dm-uevent.h
dm-unstripe.c
dm-verity-fec.c dm bufio: Add flags argument to dm_bufio_client_create 2022-07-28 17:46:14 -04:00
dm-verity-fec.h
dm-verity-loadpin.c dm: verity-loadpin: Only trust verity targets with enforcement 2022-10-21 12:37:40 +02:00
dm-verity-target.c dm: verity-loadpin: Only trust verity targets with enforcement 2022-10-21 12:37:40 +02:00
dm-verity-verify-sig.c
dm-verity-verify-sig.h
dm-verity.h dm: verity-loadpin: Only trust verity targets with enforcement 2022-10-21 12:37:40 +02:00
dm-writecache.c - A few fixes for the DM verity and bufio changes from the 6.0 merge. 2022-08-11 19:46:48 -07:00
dm-zero.c
dm-zone.c - Refactor DM core's mempool allocation so that it clearer by not 2022-08-02 14:21:25 -07:00
dm-zoned-metadata.c - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
dm-zoned-reclaim.c
dm-zoned-target.c dm-zoned: cleanup dmz_fixup_devices 2022-07-06 06:46:26 -06:00
dm-zoned.h dm/dm-zoned: Use the enum req_op type 2022-07-14 12:14:31 -06:00
dm.c dm: track per-add_disk holder relations in DM 2022-12-31 13:25:59 +01:00
dm.h dm table: audit all dm_table_get_target() callers 2022-07-07 11:49:34 -04:00
md-autodetect.c md: return the allocated devices from md_alloc 2022-08-02 17:22:46 -06:00
md-bitmap.c md/bitmap: Fix bitmap chunk size overflow issues 2023-01-07 11:15:55 +01:00
md-bitmap.h
md-cluster.c md: Fix spelling mistake in comments 2022-08-02 17:14:44 -06:00
md-cluster.h
md-faulty.c
md-linear.c md: remove most calls to bdevname 2022-05-22 23:07:21 -07:00
md-linear.h
md-multipath.c md: remove most calls to bdevname 2022-05-22 23:07:21 -07:00
md-multipath.h
md.c md: fix a crash in mempool_free 2023-01-04 11:26:30 +01:00
md.h md: return the allocated devices from md_alloc 2022-08-02 17:22:46 -06:00
raid0.c md/raid0, raid10: Don't set discard sectors for request queue 2022-12-31 13:26:44 +01:00
raid0.h
raid1-10.c
raid1.c md/raid1: stop mdx_raid1 thread when raid1 array run failed 2022-12-31 13:26:44 +01:00
raid1.h
raid5-cache.c md/raid5-cache: Annotate pslot with __rcu notation 2022-08-02 17:14:32 -06:00
raid5-log.h md/raid5-ppl: Drop unused argument from ppl_handle_flush_request() 2022-08-02 17:14:31 -06:00
raid5-ppl.c md/raid5-ppl: Drop unused argument from ppl_handle_flush_request() 2022-08-02 17:14:31 -06:00
raid5.c md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d 2022-10-21 12:39:23 +02:00
raid5.h md/raid5: Ensure batch_last is released before sleeping for quiesce 2022-08-02 21:08:53 -06:00
raid10.c md/raid0, raid10: Don't set discard sectors for request queue 2022-12-31 13:26:44 +01:00
raid10.h