This is a note to let you know that I've just added the patch titled dm integrity: call kmem_cache_destroy() in dm_integrity_init() error path to the 5.15-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: dm-integrity-call-kmem_cache_destroy-in-dm_integrity_init-error-path.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 6b79a428c02769f2a11f8ae76bf866226d134887 Mon Sep 17 00:00:00 2001 From: Mike Snitzer <snitzer@xxxxxxxxxx> Date: Tue, 4 Apr 2023 13:34:28 -0400 Subject: dm integrity: call kmem_cache_destroy() in dm_integrity_init() error path From: Mike Snitzer <snitzer@xxxxxxxxxx> commit 6b79a428c02769f2a11f8ae76bf866226d134887 upstream. Otherwise the journal_io_cache will leak if dm_register_target() fails. Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Mike Snitzer <snitzer@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/md/dm-integrity.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -4632,11 +4632,13 @@ static int __init dm_integrity_init(void } r = dm_register_target(&integrity_target); - - if (r < 0) + if (r < 0) { DMERR("register failed %d", r); + kmem_cache_destroy(journal_io_cache); + return r; + } - return r; + return 0; } static void __exit dm_integrity_exit(void) Patches currently in stable-queue which might be from snitzer@xxxxxxxxxx are queue-5.15/dm-flakey-fix-a-crash-with-invalid-table-line.patch queue-5.15/dm-clone-call-kmem_cache_destroy-in-dm_clone_init-error-path.patch queue-5.15/dm-ioctl-fix-nested-locking-in-table_clear-to-remove-deadlock-concern.patch queue-5.15/dm-verity-fix-error-handling-for-check_at_most_once-on-fec.patch queue-5.15/dm-integrity-call-kmem_cache_destroy-in-dm_integrity_init-error-path.patch queue-5.15/dm-don-t-lock-fs-when-the-map-is-null-in-process-of-resume.patch