Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 2664C322B8F for ; Thu, 28 May 2026 10:03:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779962617; cv=none; b=e01BfkS9Ks590ELp2xD1oHRmwEJ0N97FviCAPmrgHKkEOVp8CIUTNz2RB7rOIQV4FotPDK4hD8iGJgWzpmjCCnw5RPAPl1gkmX9jxlvETBuXaGcfK4NlP9+en0k62jOnyQVIDV+qzBa/WaEhokxv5Kb253+A4rGtYG2c3MhNj/I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779962617; c=relaxed/simple; bh=MLdRbpInQmxdUu50zzwZg63y3OlVkMsseOzQQcM/pMI=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=GwxdEQIJHZ9AzUwYVmcwg494FbKL1KKC2+HJPsrNZPyR1nnMrp1HadLfkacIycGWTrILxE0/wRSaGEwRqy9zLNGXQOYRJGf5abcdg1fH+qmAc3dwcFtrI/FPRQYJbgMa4JGuUiEyY4dyxUAKykCVmIbcDx37Dvs3lU1vLnLs4yE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=v9jTOdrb; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="v9jTOdrb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 300BD1F000E9; Thu, 28 May 2026 10:03:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779962615; bh=NJw0NQiM+iivKUFsWRzwOxcNpV+xnUWxz4ekXYglues=; h=Subject:To:Cc:From:Date; b=v9jTOdrblpEBdli/GdYQO6EGUsFWYfieUPWoV3CsNo2v/b9/In8JI0neRAjZJZQzt TiAYRwrXXnoz7eZQ/oHx3TWobyGf4fPGZ7HNZ/qe1BZ3324JqKh/Utg3d7JAwpnwAg CFZ6nxGyA8C327fUZ7hVFqd7RbeCOg93Cw2uZGT0= Subject: FAILED: patch "[PATCH] octeontx2-af: CGX: add bounds check to cgx_speed_mbps index" failed to apply to 5.15-stable tree To: sam@samdaly.ie,andrew+netdev@lunn.ch,gakula@marvell.com,gregkh@linuxfoundation.org,hkelam@marvell.com,kuba@kernel.org,lcherian@marvell.com,sbhatta@marvell.com,sgoutham@marvell.com,stable@kernel.org Cc: From: Date: Thu, 28 May 2026 12:02:32 +0200 Message-ID: <2026052832-gigahertz-crumb-cbe0@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x c0bf0a4f3f1f5f57aa83e1400ba4f56f0abfd542 # git commit -s git send-email --to '' --in-reply-to '2026052832-gigahertz-crumb-cbe0@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ From c0bf0a4f3f1f5f57aa83e1400ba4f56f0abfd542 Mon Sep 17 00:00:00 2001 From: Sam Daly Date: Wed, 13 May 2026 18:42:53 +0200 Subject: [PATCH] octeontx2-af: CGX: add bounds check to cgx_speed_mbps index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cgx_speed_mbpsĀ has 13 elements but RESP_LINKSTAT_SPEED can yield values 0-15. If it returns a value >= 13, this causes an out-of-bounds array access. Add a bounds check and default to speed 0 if the index is out of range. Fixes: 61071a871ea6 ("octeontx2-af: Forward CGX link notifications to PFs") Cc: Sunil Goutham Cc: Linu Cherian Cc: Geetha sowjanya Cc: hariprasad Cc: Subbaraya Sundeep Cc: Andrew Lunn Cc: stable Signed-off-by: Sam Daly Signed-off-by: Greg Kroah-Hartman Link: https://patch.msgid.link/2026051352-refined-demise-e88d@gregkh Signed-off-by: Jakub Kicinski diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c index 4f33a816bc7a..2e94d5105016 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c @@ -1294,13 +1294,18 @@ static inline void link_status_user_format(u64 lstat, struct cgx_link_user_info *linfo, struct cgx *cgx, u8 lmac_id) { + unsigned int speed; + linfo->link_up = FIELD_GET(RESP_LINKSTAT_UP, lstat); linfo->full_duplex = FIELD_GET(RESP_LINKSTAT_FDUPLEX, lstat); - linfo->speed = cgx_speed_mbps[FIELD_GET(RESP_LINKSTAT_SPEED, lstat)]; linfo->an = FIELD_GET(RESP_LINKSTAT_AN, lstat); linfo->fec = FIELD_GET(RESP_LINKSTAT_FEC, lstat); linfo->lmac_type_id = FIELD_GET(RESP_LINKSTAT_LMAC_TYPE, lstat); + speed = FIELD_GET(RESP_LINKSTAT_SPEED, lstat); + linfo->speed = speed < ARRAY_SIZE(cgx_speed_mbps) ? + cgx_speed_mbps[speed] : 0; + if (linfo->lmac_type_id >= LMAC_MODE_MAX) { dev_err(&cgx->pdev->dev, "Unknown lmac_type_id %d reported by firmware on cgx port%d:%d", linfo->lmac_type_id, cgx->cgx_id, lmac_id);