Patch "dm integrity: call kmem_cache_destroy() in dm_integrity_init() error path" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.4-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.4 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
@@ -4288,11 +4288,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.4/dm-flakey-fix-a-crash-with-invalid-table-line.patch
queue-5.4/dm-clone-call-kmem_cache_destroy-in-dm_clone_init-error-path.patch
queue-5.4/dm-ioctl-fix-nested-locking-in-table_clear-to-remove-deadlock-concern.patch
queue-5.4/dm-verity-fix-error-handling-for-check_at_most_once-on-fec.patch
queue-5.4/dm-integrity-call-kmem_cache_destroy-in-dm_integrity_init-error-path.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux