linux-yocto/drivers/md
Nigel Croxon 10c6021a60 raid10: cleanup memleak at raid10_make_request
[ Upstream commit 43806c3d5b ]

If raid10_read_request or raid10_write_request registers a new
request and the REQ_NOWAIT flag is set, the code does not
free the malloc from the mempool.

unreferenced object 0xffff8884802c3200 (size 192):
   comm "fio", pid 9197, jiffies 4298078271
   hex dump (first 32 bytes):
     00 00 00 00 00 00 00 00 88 41 02 00 00 00 00 00  .........A......
     08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
   backtrace (crc c1a049a2):
     __kmalloc+0x2bb/0x450
     mempool_alloc+0x11b/0x320
     raid10_make_request+0x19e/0x650 [raid10]
     md_handle_request+0x3b3/0x9e0
     __submit_bio+0x394/0x560
     __submit_bio_noacct+0x145/0x530
     submit_bio_noacct_nocheck+0x682/0x830
     __blkdev_direct_IO_async+0x4dc/0x6b0
     blkdev_read_iter+0x1e5/0x3b0
     __io_read+0x230/0x1110
     io_read+0x13/0x30
     io_issue_sqe+0x134/0x1180
     io_submit_sqes+0x48c/0xe90
     __do_sys_io_uring_enter+0x574/0x8b0
     do_syscall_64+0x5c/0xe0
     entry_SYSCALL_64_after_hwframe+0x76/0x7e

V4: changing backing tree to see if CKI tests will pass.
The patch code has not changed between any versions.

Fixes: c9aa889b03 ("md: raid10 add nowait support")
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
Link: https://lore.kernel.org/linux-raid/c0787379-9caa-42f3-b5fc-369aed784400@redhat.com
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-07-17 18:30:52 +02:00
..
bcache bcache: fix NULL pointer in cache_set_flush() 2025-07-10 15:57:32 +02:00
persistent-data dm array: fix cursor index when skipping across block boundaries 2025-01-23 17:15:48 +01:00
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-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-12 11:58:52 +01:00
dm-cache-metadata.h
dm-cache-policy-internal.h
dm-cache-policy-smq.c dm cache policy smq: ensure IO doesn't prevent cleaner policy progress 2023-08-03 10:22:46 +02:00
dm-cache-policy.c
dm-cache-policy.h
dm-cache-target.c dm cache: prevent BUG_ON by blocking retries on failed device resumes 2025-06-04 14:37:58 +02:00
dm-clone-metadata.c bitmap: introduce generic optimized bitmap_size() 2024-09-04 13:23:16 +02:00
dm-clone-metadata.h
dm-clone-target.c dm clone: call kmem_cache_destroy() in dm_clone_init() error path 2023-05-11 23:00:40 +09:00
dm-core.h dm: limit the number of targets and parameter size area 2024-02-23 08:55:14 +01:00
dm-crypt.c dm-crypt: track tag_offset in convert_context 2025-03-13 12:50:28 +01:00
dm-delay.c dm-delay: fix a race between delay_presuspend and delay_bio 2023-12-03 07:31:25 +01:00
dm-dust.c
dm-ebs-target.c dm-ebs: don't set the flag DM_TARGET_PASSES_INTEGRITY 2025-01-23 17:15:51 +01:00
dm-era-target.c dm era: commit metadata in postsuspend after worker stops 2022-06-29 09:03:20 +02:00
dm-exception-store.c
dm-exception-store.h
dm-flakey.c dm flakey: fix a crash with invalid table line 2023-05-11 23:00:40 +09:00
dm-ima.c
dm-ima.h
dm-init.c dm init: Handle minors larger than 255 2024-09-12 11:07:47 +02:00
dm-integrity.c dm-integrity: fix a warning on invalid table line 2025-05-09 09:39:37 +02:00
dm-io-tracker.h
dm-io.c
dm-ioctl.c dm resume: don't return EINVAL when signalled 2024-09-04 13:23:16 +02:00
dm-kcopyd.c
dm-linear.c
dm-log-userspace-base.c
dm-log-userspace-transfer.c
dm-log-userspace-transfer.h
dm-log-writes.c
dm-log.c dm mirror log: clear log bits up to BITS_PER_LONG boundary 2022-06-29 09:03:20 +02:00
dm-mpath.c
dm-mpath.h
dm-path-selector.c
dm-path-selector.h
dm-ps-historical-service-time.c dm mpath: only use ktime_get_ns() in historical selector 2022-04-20 09:34:13 +02:00
dm-ps-io-affinity.c
dm-ps-queue-length.c
dm-ps-round-robin.c
dm-ps-service-time.c
dm-raid.c dm-raid: fix variable in journal device check 2025-07-10 15:57:39 +02:00
dm-raid1.c dm-mirror: fix a tiny race condition 2025-06-27 11:05:26 +01:00
dm-region-hash.c
dm-rq.c Revert "dm: requeue IO if mapping table not yet available" 2024-10-17 15:11:06 +02:00
dm-rq.h
dm-snap-persistent.c
dm-snap-transient.c
dm-snap.c dm snapshot: fix lockup in dm_exception_table_exit 2024-04-10 16:18:44 +02:00
dm-stats.c dm stats: check for and propagate alloc_percpu failure 2023-03-30 12:48:00 +02:00
dm-stats.h dm stats: check for and propagate alloc_percpu failure 2023-03-30 12:48:00 +02:00
dm-stripe.c
dm-switch.c
dm-sysfs.c
dm-table.c dm: restrict dm device size to 2^63-512 bytes 2025-06-04 14:37:57 +02:00
dm-target.c
dm-thin-metadata.c dm thin metadata: check fail_io before using data_sm 2023-06-21 15:59:14 +02:00
dm-thin-metadata.h
dm-thin.c dm thin: make get_first_thin use rcu-safe list first function 2025-01-23 17:15:50 +01:00
dm-uevent.c
dm-uevent.h
dm-unstripe.c dm-unstriped: cast an operand to sector_t to prevent potential uint32_t overflow 2024-11-14 13:13:39 +01:00
dm-verity-fec.c dm-verity: align struct dm_verity_fec_io properly 2023-12-08 08:48:01 +01:00
dm-verity-fec.h
dm-verity-target.c dm verity: don't perform FEC for failed readahead IO 2023-12-08 08:48:01 +01:00
dm-verity-verify-sig.c
dm-verity-verify-sig.h
dm-verity.h dm-verity, dm-crypt: align "struct bvec_iter" correctly 2024-03-26 18:21:13 -04:00
dm-writecache.c dm writecache: set a default MAX_WRITEBACK_JOBS 2022-08-17 14:24:23 +02:00
dm-zero.c
dm-zone.c
dm-zoned-metadata.c
dm-zoned-reclaim.c
dm-zoned-target.c dm zoned: free dmz->ddev array in dmz_put_zoned_devices 2023-10-10 21:59:08 +02:00
dm-zoned.h
dm.c Revert "dm: requeue IO if mapping table not yet available" 2024-10-17 15:11:06 +02:00
dm.h dm: send just one event on resize, not two 2023-03-10 09:40:05 +01:00
Kconfig md: select BLOCK_LEGACY_AUTOLOAD 2025-03-13 12:51:11 +01:00
Makefile
md-autodetect.c
md-bitmap.c md/md-bitmap: fix dm-raid max_write_behind setting 2025-07-10 15:57:32 +02:00
md-bitmap.h
md-cluster.c
md-cluster.h
md-faulty.c
md-linear.c md: add error_handlers for raid0 and linear 2023-09-19 12:22:39 +02:00
md-linear.h
md-multipath.c
md-multipath.h
md.c md: clean up invalid BUG_ON in md_ioctl 2024-09-04 13:23:25 +02:00
md.h md: add error_handlers for raid0 and linear 2023-09-19 12:22:39 +02:00
raid1-10.c md: drop queue limitation for RAID1 and RAID10 2023-05-11 23:00:29 +09:00
raid1.c md/raid1: Fix stack memory use after return in raid1_reshape 2025-07-17 18:30:52 +02:00
raid1.h
raid5-cache.c
raid5-log.h
raid5-ppl.c
raid5.c md/raid5: fix atomicity violation in raid5_cache_count 2025-01-23 17:15:52 +01:00
raid5.h
raid10.c raid10: cleanup memleak at raid10_make_request 2025-07-17 18:30:52 +02:00
raid10.h
raid0.c md: raid0: account for split bio in iostat accounting 2023-09-19 12:22:40 +02:00
raid0.h md/raid0: add discard support for the 'original' layout 2023-07-23 13:47:51 +02:00