This is a note to let you know that I've just added the patch titled pds_core: limit loop over fw name list to the 6.6-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: pds_core-limit-loop-over-fw-name-list.patch and it can be found in the queue-6.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 62dcb6a0bdec045fc4263507c806639f73dc6b45 Author: Shannon Nelson <shannon.nelson@xxxxxxx> Date: Fri Jan 3 11:51:47 2025 -0800 pds_core: limit loop over fw name list [ Upstream commit 8c817eb26230dc0ae553cee16ff43a4a895f6756 ] Add an array size limit to the for-loop to be sure we don't try to reference a fw_version string off the end of the fw info names array. We know that our firmware only has a limited number of firmware slot names, but we shouldn't leave this unchecked. Fixes: 45d76f492938 ("pds_core: set up device and adminq") Signed-off-by: Shannon Nelson <shannon.nelson@xxxxxxx> Reviewed-by: Simon Horman <horms@xxxxxxxxxx> Reviewed-by: Brett Creeley <brett.creeley@xxxxxxx> Reviewed-by: Jacob Keller <jacob.e.keller@xxxxxxxxx> Link: https://patch.msgid.link/20250103195147.7408-1-shannon.nelson@xxxxxxx Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/net/ethernet/amd/pds_core/devlink.c b/drivers/net/ethernet/amd/pds_core/devlink.c index d8218bb153d9..971d4278280d 100644 --- a/drivers/net/ethernet/amd/pds_core/devlink.c +++ b/drivers/net/ethernet/amd/pds_core/devlink.c @@ -117,7 +117,7 @@ int pdsc_dl_info_get(struct devlink *dl, struct devlink_info_req *req, if (err && err != -EIO) return err; - listlen = fw_list.num_fw_slots; + listlen = min(fw_list.num_fw_slots, ARRAY_SIZE(fw_list.fw_names)); for (i = 0; i < listlen; i++) { if (i < ARRAY_SIZE(fw_slotnames)) strscpy(buf, fw_slotnames[i], sizeof(buf));