From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796381959; b=DCmIRJJSToYPFQI7fqDcfE//06XiIfdy8Pud0i7pnUiEvpKI7+6aOWwRJJn0iddmr4K6 EummKig4vjeVFnrLt6GWieCtH77Te5txrZXjqcmdzRIBKknzxgDGiL+boto9Eyo6ss44K 6Bbylri1mDrps+UP20vE62klmjFIAhJzRP6pSoKOS7Fu+/9GIClGZggykaFJFdTnNuDMs ujWRGaAgK0lNYgvn7yPQGDYPcIuDvv7uasPUDChasuRF0HeV/gy02sxI9BzNZWCT4FtYY YDtCpNYvWW1kPJW5O01X098nSWfxVo+vkPXe8E+/YFapEKYDR/fOHAO5A8zhJumJ/LA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381959; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=r73z+W9K0nJ9VNpfs3vG7h5Q0094YYo9aHRD1gLBtgo=; b=WlImHLyuuQsbKOQ0N6G1o+DFN/7qVup03Y8glg8cWX7OGRnUOW4mjQcBHO3g4nIBSHfZ h07Wt7R48UOmBGeBAr4uWYMaBTItMZ/p3Qil12KCHQUzPoejIBSZncfOZ2TssSh02/2D+ NcGxrA2DCAJvd6zNNvQlEbnkEaGTSHePE0m9NQkDi0VrRb7XplJtQvalF4IbZGZpFPW7U zBsUTJZbDqo0j2l4QoK/eYjdDIa78NeiQZaperBpahibEI18IC9RXPKgrjA8l6F8NkIF6 tqmKCd1z8SPckRkVdxPeiuSNghkyh5ad0pzLnd6uIJMCb60Wh/jOg0cBMrFJFY0kaWg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=HHxgKp9t; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81A8B606A32C; Fri, 4 Dec 2026 10:59:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=HHxgKp9t Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05ADA1F000C2; Fri, 4 Dec 2026 10:59:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381959; bh=r73z+W9K0nJ9VNpfs3vG7h5Q0094YYo9aHRD1gLBtgo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HHxgKp9tz0Wq/BK8eGEKXvQQY65Y5lumQnbeAvJStugG/04dJDrzKLrKuVZEmi6eM A2Iv8O7O/QmaAw/OKHlc3vaUJ3VJvVJ2NEXO2zeFhcWkuvu+3Aqjyj1e4WALWFAVTR NblUI5d7nM/7Sfu/j+DdSIqK//WJ0F/8OS7/C3/Y= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Petr Oros , Przemek Kitszel , Jacob Keller , Alexander Nowlin , Tony Nguyen , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.18 230/703] ice: allow reading the last byte of the NVM and Shadow RAM regions Date: Fri, 4 Dec 2026 19:02:09 +0900 Message-ID: <20261204100633.942414441@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Petr Oros [ Upstream commit dc84cae413bdcebfe130803022b8e02abc2ffa83 ] ice_devlink_nvm_read() rejects a read whose end lands exactly on the region size, so feeding back the size devlink itself reports fails: devlink region show pci/0000:04:00.0/nvm-flash pci/0000:04:00.0/nvm-flash: size 10485760 snapshot [] max 1 devlink region read pci/0000:04:00.0/nvm-flash address 0 length 10485760 Error: ice: Cannot read beyond the region size. shadow-ram behaves the same. The regions are created with those sizes, so a read ending on the size is the whole region and has to be allowed. ice_read_flat_nvm() uses > for its own Shadow RAM check, and so does ixgbe, which grew its region support from this code. Fixes: 3af4b40b0f2f ("ice: implement direct read for NVM and Shadow RAM regions") Signed-off-by: Petr Oros Reviewed-by: Przemek Kitszel Acked-by: Jacob Keller Tested-by: Alexander Nowlin Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20261113231225.1864810-7-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/devlink/devlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink.c b/drivers/net/ethernet/intel/ice/devlink/devlink.c index 4bd377a668421..2566fabf78559 100644 --- a/drivers/net/ethernet/intel/ice/devlink/devlink.c +++ b/drivers/net/ethernet/intel/ice/devlink/devlink.c @@ -1947,7 +1947,7 @@ static int ice_devlink_nvm_read(struct devlink *devlink, return -EOPNOTSUPP; } - if (offset + size >= nvm_size) { + if (offset + size > nvm_size) { NL_SET_ERR_MSG_MOD(extack, "Cannot read beyond the region size"); return -ERANGE; } -- 2.53.0