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 661A0221F20 for ; Mon, 23 Feb 2026 13:41:08 +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=1771854070; cv=none; b=TPpYfcP/5CVYK9mBN3n4KLyLAihoLWmG+ClD1f1srzGv/Hiwi7mHmP0Vs7BITDIwNrMeXlrM9CqsSabYK6cXnFRWmxXg2bvFFCxMU8CViZ+hHMGhbIgBd26q9yG7AzkGVo1Q9aEtkPFtcs0ZrzKB0GUkR3+zzoxi8p2oEpL1c6E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771854070; c=relaxed/simple; bh=N2PPDXWV64cV7n/9GqF8Sn3XaE/jgg+iDcvyH0lxmc8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZdkOGZBhArh2uqtUCt9AlB+r+FQlW0PzwWmCHE5sZBCatLzaoumIvRbVMcFUFpEODUwZX+jH7GF6v/eEjVG2qAEKpfGGjC3bh9i5qgU4bulb545tOZSPK6lacxk0NgHIhIu5Yo/39D8f6UyJ0j4S4gCkaAX1ltPl2JVP1H1ufFQ= 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 CF12568AFE; Mon, 23 Feb 2026 14:41:04 +0100 (CET) Date: Mon, 23 Feb 2026 14:41:04 +0100 From: Christoph Hellwig To: Sungwoo Kim Cc: Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Chao Shi , Weidong Zhu , Dave Tian , Mike Christie Subject: Re: [PATCH] nvme: fix memory allocator in nvme_pr_read_keys() Message-ID: <20260223134104.GA15458@lst.de> References: <20260216003541.161806-2-iam@sung-woo.kim> 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: <20260216003541.161806-2-iam@sung-woo.kim> User-Agent: Mutt/1.5.17 (2007-11-01) s/allocator/allocation/ in the subject. > - rse = kzalloc(rse_len, GFP_KERNEL); > + rse = kvzalloc(rse_len, GFP_KERNEL); You'll also need it to free it using kvfree if you you use kvzalloc. We might also want to add some upper bound to the number of keys to not allow the user to allocate 4GB of pinned kernel memory.