Skip to content

Commit 013ee5a

Browse files
committed
Merge tag 'md-6.9-20240408' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into block-6.9
Pull MD fix from Song: "This change, by Yu Kuai, fixes a UAF in a corner case." * tag 'md-6.9-20240408' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: raid1: fix use-after-free for original bio in raid1_write_request()
2 parents b561ea5 + fcf3f7e commit 013ee5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/md/raid1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
15581558
for (j = 0; j < i; j++)
15591559
if (r1_bio->bios[j])
15601560
rdev_dec_pending(conf->mirrors[j].rdev, mddev);
1561-
free_r1bio(r1_bio);
1561+
mempool_free(r1_bio, &conf->r1bio_pool);
15621562
allow_barrier(conf, bio->bi_iter.bi_sector);
15631563

15641564
if (bio->bi_opf & REQ_NOWAIT) {

0 commit comments

Comments
 (0)