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=1796386363; b=Eg9T3lHO0nEgBY4tl3hQs+b02JfrZ+GswoeGR9btquP+GYL/dOLYXlUD4L7IpTdy3SLZ rVJiwgI5rTLIGnIsW/1mceXixgu5Hj49ctt6e/NU8zxh91+hcF5Jt3/cGQjC8y2yyDdju ZJdPf11m2wa60oRb6bzZ7NMDFwne5zN60TR5mHnnNNkasBfQWKOFgg3ZzwmBQKVkSscNf 6+ZwCzwmXwMFddMv/suoqmgSmiKDe4Cd29ya7owqPQ62V/cgaeDiD/p8zv5qgntnDiQbw RqxM90YuY+Duyeq2SN7CZ4ImgEzI4q30nOzZDsZZ8X8Jjk3cF3k+uibj0tt3oTRiaTw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386363; 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=xKRh/tJ8JOgrpMCO45EWdLfVA897grAA+ZcuwBRuuxw=; b=gVYeraNMeCBo0hBpwrGmBRfcz+nKIdwLJ/Egxxq7AUsQ3VJ6rm3iqQE8KTplmcxI6mGT DezE+aI/+eSpRvpi+yWIa/qs6jLWebimCItGrdZsaG7cyFLHYId7juNx3M3LhCXw2yfx3 E7Olgja7YJeHIL9DyMOJX3s6dsVWBDJDO8RcNegYe+zt/vTVw0tMt+qumJCIhUNB3A9H7 PTE6DwEVn/AbGHvyBRNpgzaBTTexfWRoj0BqFSOJaaUIxpfQ6f/SJL31FjFSWYq3+Ahf4 mQn0syjIAlLyJd4LAuDlimfP14Ps8TqKnvuXydJEEAQgWCC88zVJljPT3YtAEY4/yaA== 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="l08+Rt/h"; 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 656B9606A32C; Fri, 4 Dec 2026 12:12:43 +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=l08+Rt/h Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8C601F000CE; Fri, 4 Dec 2026 12:12:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386363; bh=xKRh/tJ8JOgrpMCO45EWdLfVA897grAA+ZcuwBRuuxw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=l08+Rt/hWC1opFVtmsgaRgmak9sDxLzHezZ5vMuJjmM463VdVncZ2js0MYH9Daq3j erfDabFCXMIyFMS3f0LGF+Q+UvGp3nQ9DaOunQJfvefwOExOr7JjEcdpiVcjp3Oh2g i4PA9gZ6o/gtbNaNFeEPCJI2SXQJY3QhH2PJSIBk= 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.6 0930/1167] ice: allow reading the last byte of the NVM and Shadow RAM regions Date: Fri, 4 Dec 2026 19:05:57 +0900 Message-ID: <20261204100726.416754291@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-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/ice_devlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/ice_devlink.c b/drivers/net/ethernet/intel/ice/ice_devlink.c index 030ca0ef71d87..b068d489fcfef 100644 --- a/drivers/net/ethernet/intel/ice/ice_devlink.c +++ b/drivers/net/ethernet/intel/ice/ice_devlink.c @@ -1769,7 +1769,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