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=1796383467; b=bL6ZArEg9dkYUowPmblRnH7nY/+KYJYLXT4Fj54EICTKPRvEl0rVJ+zVgmAEgpH2vtsQ 43w68cBt60xNgDbWBtKJKdh4yCM7to24YTXltpmvyMEhbVV8PIC4UVVkXAJ+EwoiZZCxu lx5rFJ45FwnLxu/FGUdRAj7heS3LGAhmErOkzLpTTXZkYe+xUn+a4PA218nCO1aImL5SY A9prMG9kLWC8Nuf70u3/Q7mCpURNwwHVJOeVVcFH2Y1kX+S0NAN19F3+6LLlbXrwiZyhA QZV+e+Xp+4JR7KYiH/BC9+/SFfsI5XFG6KOQQc/39A4ww9Ff+XVyFzsQ0Qn+23zQpJQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383467; 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=CW9W66apYrQNm3zU6/I5qfcnjfIu0Rd1N70P3zJojA0=; b=Ahi4YQR7Bc4Yu6MV68ALncROLHIlGHK9PyIs5tJB1+86D+1iPZ/i35MGwi5cL1SyhE/6 pcWzKp8m0xxiS3tYKoowFgN+J0Rm8gDNp5SLn1V0vM9adXq8WdI9a/HN3dCLtqdyHpeW2 kOmZlN4Y2Fr+iMixDk/PlG4AZmMJlcibz6g/TG9KTKHGSFjD0qWxoAECRdqrE2dpDrlPv 1f5xKhW3O9idIweaFgX523wzPLbiubgs4VBeQlwUIb+MgrkOyeubdU1xqZOLPuxqQbZHu 6AzhI5AjtRt0ypIGQTZwJSwi6MUcAlAZJJ+kEmVsxT3gnKHwUDJ8phSbqs5SCP8PF3g== 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=BTn5nR9u; 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 5AB72606A32C; Fri, 4 Dec 2026 11:24:27 +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=BTn5nR9u Received: by smtp.kernel.org (Postfix) with ESMTPSA id 903CD1F000C2; Fri, 4 Dec 2026 11:24:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383467; bh=CW9W66apYrQNm3zU6/I5qfcnjfIu0Rd1N70P3zJojA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BTn5nR9ufFc/i2/ePpu79ABjE74lO9WXo2Ty/4F7j8kPfYvMr1kKqZfmWvJT3sSdI 8q7E4USs/u5MrkKJhLb+HpbFn+ovANbCCxb0Wb1uFAsn5MhRUqjKH7zEU+VuHXo7xt 8f9E3WEkRmVo7bPBKy5pyxmL0J9GBgV3GmEz9/r0= 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.12 237/555] ice: allow reading the last byte of the NVM and Shadow RAM regions Date: Fri, 4 Dec 2026 19:04:40 +0900 Message-ID: <20261204100618.236022681@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@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.12-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 b1efd287b3309..eed4b46c30977 100644 --- a/drivers/net/ethernet/intel/ice/devlink/devlink.c +++ b/drivers/net/ethernet/intel/ice/devlink/devlink.c @@ -1800,7 +1800,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