From: Dan Carpenter <dan.carpenter@linaro.org>
To: Sungwoo Kim <iam@sung-woo.kim>
Cc: Keith Busch <kbusch@kernel.org>, 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,
Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Subject: Re: [PATCH v2] nvme: fix memory allocation in nvme_pr_read_keys()
Date: Sat, 21 Mar 2026 10:19:14 +0300 [thread overview]
Message-ID: <ab5GcjyKnKnqQ7ob@stanley.mountain> (raw)
In-Reply-To: <CAJNyHpJm8rwivxM2bSvRoqi_yCeFTyXVY+z0oub4Uc8stUN55A@mail.gmail.com>
Ah, yes. You're right. It's the nonsense:
if (rse_len > U32_MAX)
return -EINVAL;
check which confused me. Commit a58383fa45c7 ("block: add allocation
size check in blkdev_pr_read_keys()") caps num_keys at 65536 so the
rse_len can't be more than 4MB which is less than INT_MAX (2GB). We
could remove that check.
I will send a patch to do that.
regards,
dan carpenter
prev parent reply other threads:[~2026-03-21 7:19 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
2026-03-20 11:23 ` Dan Carpenter
2026-03-20 15:40 ` Sungwoo Kim
2026-03-21 7:19 ` Dan Carpenter [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=ab5GcjyKnKnqQ7ob@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=axboe@kernel.dk \
--cc=cshi008@fiu.edu \
--cc=daveti@purdue.edu \
--cc=hare@suse.de \
--cc=harshit.m.mogalapalli@oracle.com \
--cc=hch@lst.de \
--cc=iam@sung-woo.kim \
--cc=kbusch@kernel.org \
--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