From: Keith Busch <kbusch@kernel.org>
To: Avi Weiss <thnkslprpt@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
Chaitanya Kulkarni <kch@nvidia.com>,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvmet: prevent double-free after metadata SGL allocation failure
Date: Thu, 22 Oct 2026 09:46:04 -0600 [thread overview]
Message-ID: <atovvKM7kjv296F6@kbusch-mbp> (raw)
In-Reply-To: <20261022062923.3761399-1-thnkslprpt@gmail.com>
On Thu, Oct 22, 2026 at 09:29:23AM +0300, Avi Weiss wrote:
> If metadata SGL allocation fails, nvmet_req_alloc_sgls() frees
> req->sg without clearing it. The RDMA error completion path later
> frees the same scatterlist again.
>
> Use nvmet_req_free_sgls() instead so that the scatterlist pointers
> and counts are cleared before response cleanup.
Looks good, applied to nvme-7.4.
prev parent reply other threads:[~2026-10-22 15:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 6:29 Avi Weiss
2026-10-22 15:46 ` Keith Busch [this message]
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=atovvKM7kjv296F6@kbusch-mbp \
--to=kbusch@kernel.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=thnkslprpt@gmail.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
all inboxes | Powered by JetHome®