public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Zhang Qilong <zhangqilong3@huawei.com>,
	"sagi@grimberg.me" <sagi@grimberg.me>,
	"hare@suse.de" <hare@suse.de>,
	"kbusch@kernel.org" <kbusch@kernel.org>,
	"hch@lst.de" <hch@lst.de>, "axboe@fb.com" <axboe@fb.com>
Cc: "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: [PATCH v2] nvme: fix memleak in nvme_ctrl_dhchap_secret_store()
Date: Tue, 29 Nov 2022 04:29:52 +0000	[thread overview]
Message-ID: <35dc4edd-704c-45af-7198-ac57947242d2@nvidia.com> (raw)
In-Reply-To: <20221122044929.27600-1-zhangqilong3@huawei.com>

On 11/21/22 20:49, Zhang Qilong wrote:
> If dhchap_secret is not consistent with options or
> nvme_auth_generate_key() fails, we should free the
> memory of dhchap_secret to avoid memleak.
> 
> We fix it by changing the check strcmp to strncmp
> directly against buf and moving allocating inside
> to the clause.
> 
> Fixes: f50fff73d620 ("nvme: implement In-Band authentication")
> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
> ---
> v2:
> - changing checking function and allocating location.
> ---
>
Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck


  parent reply	other threads:[~2022-11-29  4:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22  4:49 [PATCH v2] nvme: fix memleak in nvme_ctrl_dhchap_secret_store() Zhang Qilong
2022-11-22  9:44 ` Sagi Grimberg
2022-11-29  4:29 ` Chaitanya Kulkarni [this message]
2022-11-29  8:47 ` Christoph Hellwig
2022-11-29 13:40   ` Christoph Hellwig
2022-11-30  3:49     ` 答复: " zhangqilong
2022-11-30  8:37     ` Sagi Grimberg
2022-11-30 13:37       ` Christoph Hellwig
2022-12-01  1:57         ` 答复: " zhangqilong

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=35dc4edd-704c-45af-7198-ac57947242d2@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=axboe@fb.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=zhangqilong3@huawei.com \
    /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