This is a note to let you know that I've just added the patch titled md: fix double free of io_acct_set bioset to the 5.18-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: md-fix-double-free-of-io_acct_set-bioset.patch and it can be found in the queue-5.18 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 42b805af102471f53e3c7867b8c2b502ea4eef7e Mon Sep 17 00:00:00 2001 From: Xiao Ni <xni@xxxxxxxxxx> Date: Thu, 12 May 2022 17:21:09 +0800 Subject: md: fix double free of io_acct_set bioset From: Xiao Ni <xni@xxxxxxxxxx> commit 42b805af102471f53e3c7867b8c2b502ea4eef7e upstream. Now io_acct_set is alloc and free in personality. Remove the codes that free io_acct_set in md_free and md_stop. Fixes: 0c031fd37f69 (md: Move alloc/free acct bioset in to personality) Signed-off-by: Xiao Ni <xni@xxxxxxxxxx> Signed-off-by: Song Liu <song@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/md/md.c | 4 ---- 1 file changed, 4 deletions(-) --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -5598,8 +5598,6 @@ static void md_free(struct kobject *ko) bioset_exit(&mddev->bio_set); bioset_exit(&mddev->sync_set); - if (mddev->level != 1 && mddev->level != 10) - bioset_exit(&mddev->io_acct_set); kfree(mddev); } @@ -6286,8 +6284,6 @@ void md_stop(struct mddev *mddev) __md_stop(mddev); bioset_exit(&mddev->bio_set); bioset_exit(&mddev->sync_set); - if (mddev->level != 1 && mddev->level != 10) - bioset_exit(&mddev->io_acct_set); } EXPORT_SYMBOL_GPL(md_stop); Patches currently in stable-queue which might be from xni@xxxxxxxxxx are queue-5.18/md-don-t-set-mddev-private-to-null-in-raid0-pers-free.patch queue-5.18/md-fix-double-free-of-io_acct_set-bioset.patch