* [PATCH] nvmet: fix a memory leak
@ 2020-07-30 20:55 Sagi Grimberg
2020-08-02 22:44 ` Chaitanya Kulkarni
0 siblings, 1 reply; 4+ messages in thread
From: Sagi Grimberg @ 2020-07-30 20:55 UTC (permalink / raw)
To: linux-nvme, Christoph Hellwig, Keith Busch
We forgot to free new_model_number
Fixes: 013b7ebe5a0d ("nvmet: make ctrl model configurable")
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
---
drivers/nvme/target/configfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
index 74b2b61c773b..37e1d7784e17 100644
--- a/drivers/nvme/target/configfs.c
+++ b/drivers/nvme/target/configfs.c
@@ -1136,6 +1136,7 @@ static ssize_t nvmet_subsys_attr_model_store(struct config_item *item,
up_write(&nvmet_config_sem);
kfree_rcu(new_model, rcuhead);
+ kfree(new_model_number);
return count;
}
--
2.25.1
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] nvmet: fix a memory leak
2020-07-30 20:55 [PATCH] nvmet: fix a memory leak Sagi Grimberg
@ 2020-08-02 22:44 ` Chaitanya Kulkarni
0 siblings, 0 replies; 4+ messages in thread
From: Chaitanya Kulkarni @ 2020-08-02 22:44 UTC (permalink / raw)
To: Sagi Grimberg, linux-nvme, Christoph Hellwig, Keith Busch
On 7/30/20 14:02, Sagi Grimberg wrote:
> We forgot to free new_model_number
>
> Fixes: 013b7ebe5a0d ("nvmet: make ctrl model configurable")
> Signed-off-by: Sagi Grimberg<sagi@grimberg.me>
Thanks for the fix, looks good.
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvmet: Fix a memory leak
2022-11-09 3:29 [PATCH] nvmet: Fix " Sagi Grimberg
@ 2022-11-09 3:36 ` Chaitanya Kulkarni
0 siblings, 0 replies; 4+ messages in thread
From: Chaitanya Kulkarni @ 2022-11-09 3:36 UTC (permalink / raw)
To: Sagi Grimberg, linux-nvme
Cc: Christoph Hellwig, Hannes Reinecke, Keith Busch, Chaitanya Kulkarni
On 11/8/22 19:29, Sagi Grimberg wrote:
> We need to also free the dhchap_ctrl_secret when releasing nvmet_host.
> kmemleak complaint:
> --
> unreferenced object 0xffff99b1cbca5140 (size 64):
> comm "check", pid 4864, jiffies 4305092436 (age 2913.583s)
> hex dump (first 32 bytes):
> 44 48 48 43 2d 31 3a 30 30 3a 65 36 2b 41 63 44 DHHC-1:00:e6+AcD
> 39 76 47 4d 52 57 59 78 67 54 47 44 51 59 47 78 9vGMRWYxgTGDQYGx
> backtrace:
> [<00000000c07d369d>] kstrdup+0x2e/0x60
> [<000000001372171c>] 0xffffffffc0cceec6
> [<0000000010dbf50b>] 0xffffffffc0cc6783
> [<000000007465e93c>] configfs_write_iter+0xb1/0x120
> [<0000000039c23f62>] vfs_write+0x2be/0x3c0
> [<000000002da4351c>] ksys_write+0x5f/0xe0
> [<00000000d5011e32>] do_syscall_64+0x38/0x90
> [<00000000503870cf>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
>
> Fixes: db1312dd9548 ("nvmet: implement basic In-Band Authentication")
> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
> ---
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
-ck
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] nvmet: Fix a memory leak
@ 2022-11-09 3:29 Sagi Grimberg
2022-11-09 3:36 ` Chaitanya Kulkarni
0 siblings, 1 reply; 4+ messages in thread
From: Sagi Grimberg @ 2022-11-09 3:29 UTC (permalink / raw)
To: linux-nvme
Cc: Christoph Hellwig, Hannes Reinecke, Keith Busch, Chaitanya Kulkarni
We need to also free the dhchap_ctrl_secret when releasing nvmet_host.
kmemleak complaint:
--
unreferenced object 0xffff99b1cbca5140 (size 64):
comm "check", pid 4864, jiffies 4305092436 (age 2913.583s)
hex dump (first 32 bytes):
44 48 48 43 2d 31 3a 30 30 3a 65 36 2b 41 63 44 DHHC-1:00:e6+AcD
39 76 47 4d 52 57 59 78 67 54 47 44 51 59 47 78 9vGMRWYxgTGDQYGx
backtrace:
[<00000000c07d369d>] kstrdup+0x2e/0x60
[<000000001372171c>] 0xffffffffc0cceec6
[<0000000010dbf50b>] 0xffffffffc0cc6783
[<000000007465e93c>] configfs_write_iter+0xb1/0x120
[<0000000039c23f62>] vfs_write+0x2be/0x3c0
[<000000002da4351c>] ksys_write+0x5f/0xe0
[<00000000d5011e32>] do_syscall_64+0x38/0x90
[<00000000503870cf>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
Fixes: db1312dd9548 ("nvmet: implement basic In-Band Authentication")
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
---
drivers/nvme/target/configfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
index 9443ee1d4ae3..069b8e81f94c 100644
--- a/drivers/nvme/target/configfs.c
+++ b/drivers/nvme/target/configfs.c
@@ -1836,6 +1836,7 @@ static void nvmet_host_release(struct config_item *item)
#ifdef CONFIG_NVME_TARGET_AUTH
kfree(host->dhchap_secret);
+ kfree(host->dhchap_ctrl_secret);
#endif
kfree(host);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-09 3:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-30 20:55 [PATCH] nvmet: fix a memory leak Sagi Grimberg
2020-08-02 22:44 ` Chaitanya Kulkarni
2022-11-09 3:29 [PATCH] nvmet: Fix " Sagi Grimberg
2022-11-09 3:36 ` Chaitanya Kulkarni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).