From: Hannes Reinecke <hare@suse.de>
To: Martin George <martinus.gpy@gmail.com>, linux-nvme@lists.infradead.org
Cc: hch@lst.de, kbusch@kernel.org, sagi@grimberg.me, hare@kernel.org
Subject: Re: [PATCH 2/2] nvme-fabrics: use kfree_sensitive() for the old DH-HMAC-CHAP secret
Date: Mon, 16 Nov 2026 14:45:12 +0100 [thread overview]
Message-ID: <0288068a-3086-4483-995e-ca4e9abca8fc@suse.de> (raw)
In-Reply-To: <20261116100244.7824-3-marting@netapp.com>
On 11/16/26 11:02 AM, Martin George wrote:
> When a connect string overrides dhchap_secret or dhchap_ctrl_secret,
> nvmf_parse_options() frees the previous raw secret with plain kfree().
> The invalid-input path already uses kfree_sensitive(), so do the same
> for the replaced secret.
>
> Signed-off-by: Martin George <marting@netapp.com>
> ---
> drivers/nvme/host/fabrics.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
> index c262538523fb..5ed91557f070 100644
> --- a/drivers/nvme/host/fabrics.c
> +++ b/drivers/nvme/host/fabrics.c
> @@ -1026,7 +1026,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
> ret = -EINVAL;
> goto out;
> }
> - kfree(opts->dhchap_secret);
> + kfree_sensitive(opts->dhchap_secret);
> opts->dhchap_secret = p;
> break;
> case NVMF_OPT_DHCHAP_CTRL_SECRET:
> @@ -1041,7 +1041,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
> ret = -EINVAL;
> goto out;
> }
> - kfree(opts->dhchap_ctrl_secret);
> + kfree_sensitive(opts->dhchap_ctrl_secret);
> opts->dhchap_ctrl_secret = p;
> break;
> case NVMF_OPT_TLS:
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
next prev parent reply other threads:[~2026-11-16 13:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 10:02 [PATCH 0/2] nvme: use kfree_sensitive() for DH-HMAC-CHAP secrets Martin George
2026-11-16 10:02 ` [PATCH 1/2] nvme-sysfs: " Martin George
2026-11-16 10:14 ` sashiko-bot
2026-11-16 13:44 ` Hannes Reinecke
2026-11-16 10:02 ` [PATCH 2/2] nvme-fabrics: use kfree_sensitive() for the old DH-HMAC-CHAP secret Martin George
2026-11-16 13:45 ` Hannes Reinecke [this message]
2026-11-16 16:18 ` [PATCH 0/2] nvme: use kfree_sensitive() for DH-HMAC-CHAP secrets Keith Busch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0288068a-3086-4483-995e-ca4e9abca8fc@suse.de \
--to=hare@suse.de \
--cc=hare@kernel.org \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=martinus.gpy@gmail.com \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.