lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aSd05K1Mkx8ZEARF@localhost.localdomain>
Date: Thu, 27 Nov 2025 00:45:08 +0300
From: Eugene Korenevsky <ekorenevsky@...yun.com>
To: Keith Busch <kbusch@...nel.org>
Cc: Jens Axboe <axboe@...nel.dk>, Christoph Hellwig <hch@....de>,
	Sagi Grimberg <sagi@...mberg.me>, linux-nvme@...ts.infradead.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] nvme: nvme_identify_ns_descs: prevent oob

On Wed, Nov 26, 2025 at 01:52:08PM -0700, Keith Busch wrote:

> Is this simpler check not sufficient?

> @@ -1566,7 +1566,7 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl,
>         for (pos = 0; pos < NVME_IDENTIFY_DATA_SIZE; pos += len) {

Alas size of ns id header+data may be 4+1=5 if .nidt == NVME_NIDT_CSI.
`pos` may be not aligned to 4 (size of `struct nvme_ns_id_desc` header).
It can be NVME_IDENTIFY_DATA_SIZE-1 here.

And when cur->nidl (i.e. pos+1) is referenced later, we'll get a problem.

>                 struct nvme_ns_id_desc *cur = data + pos;
> 
> -               if (cur->nidl == 0)
> +               if (cur->nidl == 0 || cur->nidl + pos > NVME_IDENTIFY_DATA_SIZE)
>                         break;
> 
>                 len = nvme_process_ns_desc(ctrl, &info->ids, cur, &csi_seen);
> --

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ