From: Jens Axboe <axboe@kernel.dk>
To: Keith Busch <kbusch@meta.com>,
linux-nvme@lists.infradead.org, hch@lst.de
Cc: sagi@grimberg.me, Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH] nvme-pci: Fix mempool alloc size
Date: Mon, 19 Dec 2022 12:07:42 -0700 [thread overview]
Message-ID: <434beef4-05d1-7b93-9a1f-92d29cd849f2@kernel.dk> (raw)
In-Reply-To: <20221219185906.3595984-1-kbusch@meta.com>
On 12/19/22 11:59 AM, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> Convert the max size to bytes to match the units of the divisor that
> calculates the worst-case number of PRP entries.
>
> The result is used to determine how many PRP Lists are required. The
> code was previously rounding this to 1 list, but we can require 2 in the
> worst case. In that scenario, the driver would corrupt memory beyond the
> size provided by the mempool.
>
> While unlikely to occur (you'd need a 4MB in exactly 127 phys segments
> on a queue that doesn't support SGLs), this memory corruption has been
> observed by kfence.
Good catch!
Reviewed-by: Jens Axboe <axboe@kernel.dk>
--
Jens Axboe
next prev parent reply other threads:[~2022-12-19 19:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20221219195515epcas5p200e1e1f3430ac6f494a66740bfb6a3b3@epcas5p2.samsung.com>
2022-12-19 18:59 ` [PATCH] nvme-pci: Fix mempool alloc size Keith Busch
2022-12-19 19:07 ` Jens Axboe [this message]
2022-12-20 6:08 ` Chaitanya Kulkarni
2022-12-21 8:02 ` Kanchan Joshi
2022-12-21 8:04 ` Christoph Hellwig
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=434beef4-05d1-7b93-9a1f-92d29cd849f2@kernel.dk \
--to=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=kbusch@meta.com \
--cc=linux-nvme@lists.infradead.org \
--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.