Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Vitaliy Shevtsov <v.shevtsov@maxima.ru>,
	stable@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Chaitanya Kulkarni <kch@nvidia.com>, Jens Axboe <axboe@kernel.dk>,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvmet-auth: assign dh_key to NULL after kfree_sensitive
Date: Mon, 16 Sep 2024 22:44:23 +0200	[thread overview]
Message-ID: <721f6543-1bf7-4b6f-8656-b5d84248e56f@suse.de> (raw)
In-Reply-To: <20240916174139.1182-1-v.shevtsov@maxima.ru>

On 9/16/24 19:41, Vitaliy Shevtsov wrote:
> ctrl->dh_key might be used across multiple calls to nvmet_setup_dhgroup()
> for the same controller. So it's better to nullify it after release on
> error path in order to avoid double free later in nvmet_destroy_auth().
> 
> Found by Linux Verification Center (linuxtesting.org) with Svace.
> 
> Fixes: 7a277c37d352 ("nvmet-auth: Diffie-Hellman key exchange support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Vitaliy Shevtsov <v.shevtsov@maxima.ru>
> ---
>   drivers/nvme/target/auth.c | 1 +
>   1 file changed, 1 insertion(+)
> 
Now that is obviously correct.

Reviewed-by: Hannes Reinecke <hare@suse.de>

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



  reply	other threads:[~2024-09-16 20:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-16 17:41 [PATCH] nvmet-auth: assign dh_key to NULL after kfree_sensitive Vitaliy Shevtsov
2024-09-16 20:44 ` Hannes Reinecke [this message]
2024-09-17  6:12 ` Christoph Hellwig
2024-10-25 13:01   ` Fedor Pchelkin
2024-10-25 14:51     ` 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=721f6543-1bf7-4b6f-8656-b5d84248e56f@suse.de \
    --to=hare@suse.de \
    --cc=axboe@kernel.dk \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=kch@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=stable@vger.kernel.org \
    --cc=v.shevtsov@maxima.ru \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox