From: Keith Busch <kbusch@kernel.org>
To: Sungwoo Kim <iam@sung-woo.kim>
Cc: Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>,
Sagi Grimberg <sagi@grimberg.me>,
Chaitanya Kulkarni <kch@nvidia.com>,
Mike Christie <michael.christie@oracle.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Hannes Reinecke <hare@suse.de>, Chao Shi <cshi008@fiu.edu>,
Weidong Zhu <weizhu@fiu.edu>, Dave Tian <daveti@purdue.edu>,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] nvme: fix memory allocation in nvme_pr_read_keys()
Date: Mon, 2 Mar 2026 08:53:22 -0700 [thread overview]
Message-ID: <aaWycq3ZLraaG2Ny@kbusch-mbp> (raw)
In-Reply-To: <20260228001927.382810-3-iam@sung-woo.kim>
On Fri, Feb 27, 2026 at 07:19:28PM -0500, Sungwoo Kim wrote:
> nvme_pr_read_keys() takes num_keys from userspace and uses it to
> calculate the allocation size for rse via struct_size(). The upper
> limit is PR_KEYS_MAX (64K).
>
> A malicious or buggy userspace can pass a large num_keys value that
> results in a 4MB allocation attempt at most, causing a warning in
> the page allocator when the order exceeds MAX_PAGE_ORDER.
Thanks, applied to nvme-7.0.
next prev parent reply other threads:[~2026-03-02 15:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-28 0:19 [PATCH v2] nvme: fix memory allocation in nvme_pr_read_keys() Sungwoo Kim
2026-03-02 6:56 ` Hannes Reinecke
2026-03-02 13:53 ` Christoph Hellwig
2026-03-02 15:53 ` Keith Busch [this message]
2026-03-20 11:23 ` Dan Carpenter
2026-03-20 15:40 ` Sungwoo Kim
2026-03-21 7:19 ` Dan Carpenter
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=aaWycq3ZLraaG2Ny@kbusch-mbp \
--to=kbusch@kernel.org \
--cc=axboe@kernel.dk \
--cc=cshi008@fiu.edu \
--cc=daveti@purdue.edu \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=iam@sung-woo.kim \
--cc=kch@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=martin.petersen@oracle.com \
--cc=michael.christie@oracle.com \
--cc=sagi@grimberg.me \
--cc=weizhu@fiu.edu \
/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