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=1796380239; b=44MivN5/ILkawjMT5SXgyMteFbGHJUycf4QEomnwAqJgrWjERZ7GrcewlLxZOXFeXsys wO2agucsT4oN75vwxyykfMrni80NV79d65h811FfbuvwpkybCc/3VKwlqgf1h0rHz3K3V CQouJuWyn7SjtKXaCGomS1j1KE75tFfA1YF1g0v0lv6LowihNQeWoB9Sa5fkXYBf1b0JR /QjvYn4CsdOdWAX4bJnTI0Qwn63nao6mtCbWpYzm2jB9HLCfbiil5+msxO5Hq6zjmlO/4 OGfZC4ZaKkhI8JNjaI/BnZ7qH/zjcxgkNND1P/NVST44EFje6YCA8J8RkIMtzqid52Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380239; 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=4xyflCtFcHM2sZuyKkLvTayBV7InoqEiN0m/uwM4adA=; b=JrsgTuRRJkGd5XPE51CqEiWIv2oUa4Foc5LR7ovaM3BHNnYzTNKval/gh3qRTHEbPXbY 6LjYseBVkQOX4wEyFPx/mIEVpvFOChirSAStphHCZuHg8a5SjFXMad7DFwmolorUH/gLH oZh40eAcweWbi8XMDnFrPF6ZBktuatkRjlFTW44qzPgJGtB4lQ5Usq2+ON5Rmsb0i4Kql yoExuiCQi7VcpUXTFYa2Z8Rg4ixhg0A4+QJrfl1JEof4Ys1PTSoq0RPKPnfoNc/9kokmn SVDKLnZeCH4QKWKjpkgbtg6Q40uAxXhqNft3ypWZe2gifK4hkz4gjZZHFA9TZioyQvw== 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="fCfc/nvb"; 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 33401606A322; Fri, 4 Dec 2026 10:30:39 +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=fCfc/nvb Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7CC31F000CE; Fri, 4 Dec 2026 10:30:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380239; bh=4xyflCtFcHM2sZuyKkLvTayBV7InoqEiN0m/uwM4adA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fCfc/nvbmB65s1weNU412fU4hSn34KXwJy2mc6IGeyyE2mCCZQnOsRBck46OLncQB JJ7qav9ZUaUrDbxG5P7GHGrHuJZSv/9QTdaSlc2ojP7RKng0tI0TF72So2DHyUFYoC xNdH+mDmd29papp4boLlZpqYAIbwG0ME08+JX4YI= 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 7.3 188/742] ice: allow reading the last byte of the NVM and Shadow RAM regions Date: Fri, 4 Dec 2026 19:00:52 +0900 Message-ID: <20261204100640.073033158@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@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 7.3-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 8c2b63eef82bd..a52b604428897 100644 --- a/drivers/net/ethernet/intel/ice/devlink/devlink.c +++ b/drivers/net/ethernet/intel/ice/devlink/devlink.c @@ -1953,7 +1953,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