From mboxrd@z Thu Jan 1 00:00:00 1970 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 238093B6BEB; Wed, 30 Sep 2026 19:00:36 +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=1790794837; cv=none; b=m3cy7NofqqcGi2usrRaMycwF+0iitorP19T+Mp/9Pzzz6Y10IETVQl4jPkHt0QWjJYbEqt4VxEhLkpDXeCD7AvKSOr81LfsJkei3yjM86O97dhR8ThKgOmKdgzr6AG/sUW4y4WV+FbON9xXAyE8rwETi+xfqk9EXRnSz72fUzlw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790794837; c=relaxed/simple; bh=vdK3NXCgqCy/kc145+vOEfRUKVJQMADDBrG/Sac/4k4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t/q+s1JjPlGeiaTzt4Q0fqAilZ8dqAVkKP5yozmQa3LTMPwnP4+pDQ07x//vG1QrySgwpJJMZDTFty5QI0cObKnledhUzDwDqoAhFq15O4GAlinC4nbqauMbESZcGJlEv+vye7rFx9fg7XA8mQcxTZxcB+2dMCmLh4OQEtWAPZg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vc2T/tBV; 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="vc2T/tBV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BA001F00898; Wed, 30 Sep 2026 19:00:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790794836; bh=tqnaD9JMRXd9X0JtIwt6KuARAkaF1OZoTQvq+zj4IZs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=vc2T/tBV5ZT5Q4fmzyDlWxWN4+Jzle+X9d6+9SGy01HxIk5JPIgJdK55EfoKaMFlf b12VpuVFXMitx/C3g/7lmK/6RoCwE3Qa9B+3N2NFkJTYWlSGXqc2xaPXR2AHR4KaqV mzvEbYFhnGyUzCeKCVKRVGh4g9plzJvXTIDiBA/M= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mikhail Gavrilov , Laxman Acharya Padhya , Junjie Cao , Linus Torvalds , Sasha Levin Subject: [PATCH 6.6 0350/1193] wifi: mt76: mt7921: skip unknown CLC firmware records Date: Wed, 30 Sep 2026 17:17:14 +0200 Message-ID: <20260930152441.942502551@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152434.301151190@linuxfoundation.org> References: <20260930152434.301151190@linuxfoundation.org> User-Agent: quilt/0.69 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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Laxman Acharya Padhya [ Upstream commit 1a296bfd3e775e515233f746218824fc7dd5ff16 ] Treat an out-of-range CLC index as newer firmware rather than a malformed image. linux-firmware 20260810 ships MT7922 records with idx 3, and rejecting them made mt7921e fail to probe. Keep the record-length checks, and report those as errors so a truncated table is visible instead of a silent retry loop. Fixes: 9417c5818a01 ("wifi: mt76: mt7921: validate CLC firmware records") Reported-by: Mikhail Gavrilov Signed-off-by: Laxman Acharya Padhya Reviewed-by: Junjie Cao Tested-by: Mikhail Gavrilov Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c index 8308de5017d74..141c06a706bf2 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c @@ -431,18 +431,23 @@ static int mt7921_load_clc(struct mt792x_dev *dev, const char *fw_name) for (offset = 0; offset < len; offset += clc_len) { if (len - offset < sizeof(*clc)) { + dev_err(mdev->dev, "Invalid CLC record\n"); ret = -EINVAL; goto out; } clc = (const struct mt7921_clc *)(clc_base + offset); clc_len = le32_to_cpu(clc->len); - if (clc_len < sizeof(*clc) || clc_len > len - offset || - clc->idx >= ARRAY_SIZE(phy->clc)) { + if (clc_len < sizeof(*clc) || clc_len > len - offset) { + dev_err(mdev->dev, "Invalid CLC record\n"); ret = -EINVAL; goto out; } + /* Newer firmware may add records this driver does not use yet */ + if (clc->idx >= ARRAY_SIZE(phy->clc)) + continue; + /* do not init buf again if chip reset triggered */ if (phy->clc[clc->idx]) continue; -- 2.53.0