From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F1EF526ED59 for ; Mon, 13 Jul 2026 06:42:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783924950; cv=none; b=N9nBaoef3kxULkHxMFi73ELYon/JTTmoIKiCexzG+2AHB1UkPbXhyjpjn/GGYUGLlzTT2UxzN3nQyLIm3vt+jCtk1mjOOi0dAQwIk9zxRzExR4X7z1vWVkkxJX48hg752dbA6ucEe8WkX4gJHqsItwGzpyAFl8e7oq1gFbSrqNY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783924950; c=relaxed/simple; bh=MWhta2ksBcvqAG1Q1Ep3ehjCkuJE2BnqGmep2RlFeM4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hHZw1CToCGMYUNQEM9LMZMfRwv8VpmMlcwFYoxiEuGLvuBSOH77/lQ90xVSfok3XWwFwl0+QuY3S2x5O5ibXLE0XQiQxjt3JZEMduEZndeUEVzcA1rRINA4Ecx0D2rlHzLT3KVJlKu9ABDnvFYM6NpI7VrL16zTdrs1wUNx7k6Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 3409468BFE; Mon, 13 Jul 2026 08:42:24 +0200 (CEST) Date: Mon, 13 Jul 2026 08:42:23 +0200 From: Christoph Hellwig To: Greg Kroah-Hartman Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Hari Mishal , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg Subject: Re: [PATCH 1/2] nvme: bound ns descriptor header and body to identify buffer Message-ID: <20260713064223.GC29416@lst.de> References: <2026070931-stopping-cost-239a@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2026070931-stopping-cost-239a@gregkh> User-Agent: Mutt/1.5.17 (2007-11-01) On Thu, Jul 09, 2026 at 02:30:32PM +0200, Greg Kroah-Hartman wrote: > From: Hari Mishal > > nvme_identify_ns_descs() allocates a buffer and gives it to the > controller, which populates it and then iterates the buffer with > variable byte increments that vary by type and body size. But, there is > no bounds check inside the iteration itself except the loop bound > itself. Fix this by checking and stopping iteration if the next header > or its declared body would go past the buffer itself. Looks good: Reviewed-by: Christoph Hellwig