From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C0AC54315A; Sun, 7 Sep 2025 20:41:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757277671; cv=none; b=fmCLpSvY5UW1X+Q/JjbjRvCs9PjbLgZuRSfZYkuIyHeMSP08b8xx+8ol+jGQTrR23AdvT8NcPdaUjjXBrfxvOtQh6jtu0oguYhJtNbR+jb6595E+5fzkyLFM6OpDUYb3HtalvyFf+htcIVXsewzYOVvQBgtocTtotCnYTfRayCo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757277671; c=relaxed/simple; bh=f3em8CjfNE5UzV0/tFqMFvJ8tteHz85voXW4k+pEkeU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c9eY4wrkLs8+s+FujpLTCS5H9Lg4j6aO85cz+6CxP3EpvknmAsOaEGWqD+A8GTYXPPCX4j8Yg+SI9FtK0yd2KZXaEQh7S2hbgAztFnrUdIIRd/ONF7Dl631g0IW8Cth77C6jxk1wJsYIfmCWGgKiA0Xr0xgATXiflp2E7jIjxi0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TOwgvpK9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="TOwgvpK9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42ED1C4CEF0; Sun, 7 Sep 2025 20:41:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757277671; bh=f3em8CjfNE5UzV0/tFqMFvJ8tteHz85voXW4k+pEkeU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TOwgvpK9u3/E9LC1B5YN56Vt5y7tBFhTP7te4Q+Qv5Mi4YZzU4+jv2OK3eHlJTFM/ OoF2PjCb+2CFNEs31PZCul2HFUXCucDLi3VcLnOOmD0Zm+g69OpK1QztMWYdywd0bG FV1W+zPvPetoKGTwXY0FIBJPAnUwpMHiHHETarJI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alok Tiwari , Aleksandr Loktionov , Paul Menzel , Tony Nguyen , Sasha Levin , Rinitha S Subject: [PATCH 6.16 070/183] ixgbe: fix incorrect map used in eee linkmode Date: Sun, 7 Sep 2025 21:58:17 +0200 Message-ID: <20250907195617.458531967@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250907195615.802693401@linuxfoundation.org> References: <20250907195615.802693401@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alok Tiwari [ Upstream commit b7e5c3e3bfa9dc8af75ff6d8633ad7070e1985e4 ] incorrectly used ixgbe_lp_map in loops intended to populate the supported and advertised EEE linkmode bitmaps based on ixgbe_ls_map. This results in incorrect bit setting and potential out-of-bounds access, since ixgbe_lp_map and ixgbe_ls_map have different sizes and purposes. ixgbe_lp_map[i] -> ixgbe_ls_map[i] Use ixgbe_ls_map for supported and advertised linkmodes, and keep ixgbe_lp_map usage only for link partner (lp_advertised) mapping. Fixes: 9356b6db9d05 ("net: ethernet: ixgbe: Convert EEE to use linkmodes") Signed-off-by: Alok Tiwari Reviewed-by: Aleksandr Loktionov Reviewed-by: Paul Menzel Tested-by: Rinitha S (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index d8a919ab7027a..05a1f9f5914fd 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c @@ -3565,13 +3565,13 @@ ixgbe_get_eee_fw(struct ixgbe_adapter *adapter, struct ethtool_keee *edata) for (i = 0; i < ARRAY_SIZE(ixgbe_ls_map); ++i) { if (hw->phy.eee_speeds_supported & ixgbe_ls_map[i].mac_speed) - linkmode_set_bit(ixgbe_lp_map[i].link_mode, + linkmode_set_bit(ixgbe_ls_map[i].link_mode, edata->supported); } for (i = 0; i < ARRAY_SIZE(ixgbe_ls_map); ++i) { if (hw->phy.eee_speeds_advertised & ixgbe_ls_map[i].mac_speed) - linkmode_set_bit(ixgbe_lp_map[i].link_mode, + linkmode_set_bit(ixgbe_ls_map[i].link_mode, edata->advertised); } -- 2.50.1