Skip to content

Commit

Permalink
dm-flakey: Fix memory corruption in optional corrupt_bio_byte feature
Browse files Browse the repository at this point in the history
Fix memory corruption due to incorrect parameter being passed to bio_init

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org	# v6.5+
Fixes: 1d9a943 ("dm flakey: clone pages on write bio before corrupting them")
  • Loading branch information
Kent Overstreet authored and Mikulas Patocka committed Mar 13, 2025
1 parent 36e1b81 commit 57e9417
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/dm-flakey.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ static struct bio *clone_bio(struct dm_target *ti, struct flakey_c *fc, struct b
if (!clone)
return NULL;

bio_init(clone, fc->dev->bdev, bio->bi_inline_vecs, nr_iovecs, bio->bi_opf);
bio_init(clone, fc->dev->bdev, clone->bi_inline_vecs, nr_iovecs, bio->bi_opf);

clone->bi_iter.bi_sector = flakey_map_sector(ti, bio->bi_iter.bi_sector);
clone->bi_private = bio;
Expand Down

0 comments on commit 57e9417

Please sign in to comment.