From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB6E23F0AB8 for ; Tue, 28 Jul 2026 11:13:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785237215; cv=none; b=tGqKxzF8eAukPRsEh4CzMEy4Ux1xIBWB300dfyM8syZgFfNSwrRirppxccxndlWEDk/xBYvW9Qgx70Q1rHoYD9bmu3R1PbRXF1g12j7v09T8fj55lDmN8CzQk2NGf3FM3CDRaHACCg0gr5DDo806K4AvtPXleUJQQfpETvh7nNI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785237215; c=relaxed/simple; bh=e9EJOPMJQQmdhrX9ZLjutTgNigOU2bNeUlGTHv/ADiE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hqDJt2/bgnil7VTgyMqoPUYo+MZMBcy8epl1bQ51U8OxgsaPAomxm3S3kzGKTxUhT9wL6/MZMCKgmerKKaK/5EDMdPO8zW7JHvxnH3EFXLoPEhKgRV1c6MQZUMWCA3+9rOb7LExg3F+YBSmYKT4wZVOkPLf8NrGCDLImVCxTHMI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=r7WrkE6V; arc=none smtp.client-ip=209.85.215.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="r7WrkE6V" Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-c9e607d81fcso2244595a12.2 for ; Tue, 28 Jul 2026 04:13:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785237214; x=1785842014; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=Ef3Yb4VZjfVw3Uexl/SrI2+nfGjSSdskMXoJ4cJ3KC8=; b=r7WrkE6VZQff1oXL400jSucWTgahF7HFO9FvU0E8AXJt/XTL0YhJNBmuB6tzqLNjTa TqQLjYupJdFovP8eqXCkl0Y9sgyesXRmHivrW22dBeMgkeFXniQRWIQMvGoQq6LmHS60 fJlKgt0qbxsdqLuc3pW1uEo33Mbg+4JCqR65qSAgkbUUZ1PJE1+RDopRO3PaTKwX5mm6 jVyf4jY7wWWTU2RxTPlLKUM7D1rxE5QaD8btdZWViaf/SAnjhD4XvDU5K7HSgy6EEeO6 79eRsxw435tWf98pkor8SH+7WeqJMlYQsVe2g3LpUTufNYSqmYSh2BSRY9XGq0tbEqrS 1ZGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785237214; x=1785842014; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Ef3Yb4VZjfVw3Uexl/SrI2+nfGjSSdskMXoJ4cJ3KC8=; b=I6rNKqFFfWZ0av1FDUqzQFptiqOFZ6lirl6N5RPBNY+n90sFdeSknnFxRq4Oyu9mVP 9IM1Dxf+SsVgpKjVJtEQ93WvKJkFpXlrVK8cyMho3G5EybGt8ii00h17FKU94UyNQCS0 8Ww7Vk0H+nLEB/ZRyAIoOMZhvh4OKIRfB0ORYqzS6FWbk/ymzqfy7TqQX444LHzJMxnU X+zzYtJV+4ZdNitB3Dlg6lt3VsJSlDgWQEhoCur6bi6ChGO2QhbJ6LGWalZrMk/0wBIA RJmujhvyUvjxCCfzQt9zoBe1mXHjZFYH1lYFfgq+ZShclvC2aFAmSka3wBJIQ53DpaDc Jzkg== X-Forwarded-Encrypted: i=1; AHgh+RoU9xmWVViAb1BXBu6rF4DvrgRW76qjp6p1i0uyBGDqE35ydHghpgCN3KEYmikvy6lOPC5JJzD/zZXLH1E=@vger.kernel.org X-Gm-Message-State: AOJu0YyziRnXahV8WcBA1wH3WGCQzQ4BTl97cPbAcXbJk0ZX7yYt6Y6Y OwsSsPSmj2TwAiLekmfkGz5JMcdfmJPkbHOjiXZaZhPTtF5yV9vx26i/FkhrcJdf X-Gm-Gg: AR+sD11/sOf/b3+8jpDqPtOVfb/1WBpxhzs+5en7A0Srs44t0SZsubpu6vdnHwCh5hy y+5DWMd8aUcG8x+wZbgctq4Fb/pNtNZBl52pqhefLbISxsBtsWbo2r6fNqOxHtwZzwjQRs6oytr S7u7zaM/Yh+A/YoEMYnkhjwSZIRfSoHJbNho5yezCovHKWmuc3tWz7uGoH2mdluZB121saDP19j CZSaAV+5H4sWr0QHRFd/CJiAGBDoqmQgA4utD/ZeFUbCXzfQGQpCpxb0s3DNWyqfmdasJglqW9E cwvE1g34HsNEg1tsKIPYlSneySsyReHqAkWethx9V2DQLpC6h7WhCd0ud9V2k3LYcoyemLRVGn5 CjJ+5HGLoaGiDXZwbOXEJ3SKVdLKuC4lklJ0VfBucmL+JqLCMYnSDBbY5EJ8yhY7N58XD9Q/0uU rEWwPOp6ipbY+2DzUV8WknGnefSdlb75EHIx2cRXU= X-Received: by 2002:a05:6a21:e598:b0:3c1:657:4c95 with SMTP id adf61e73a8af0-3c8aafbb6f3mr2587944637.15.1785237213865; Tue, 28 Jul 2026 04:13:33 -0700 (PDT) Received: from KRHW1CJW23.bytedance.net ([203.208.189.8]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-314bc548efesm43920950eec.14.2026.07.28.04.13.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Jul 2026 04:13:33 -0700 (PDT) From: Zhao Li To: Johannes Berg Cc: Miri Korenblit , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH wireless-next] wifi: mac80211: fix per-STA profile length in cross-link CSA parsing Date: Tue, 28 Jul 2026 19:13:26 +0800 Message-ID: <20260728111326.63087-1-enderaoelyther@gmail.com> X-Mailer: git-send-email 2.50.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ieee80211_mgd_check_cross_link_csa() starts parsing elements after the fixed per-STA profile header and the STA Info field, but subtracts only the STA Info length from the profile length. As a result, ieee802_11_parse_elems() is given sizeof(*prof) == 3 bytes beyond the current profile's element area, and data following the profile may be interpreted as belonging to it. Subtract the fixed profile header as well. The preceding ieee80211_mle_basic_sta_prof_size_ok() check guarantees that the corrected calculation cannot underflow, and ieee80211_rx_uhr_link_reconfig_req() uses the same calculation. The call site currently states that cross-link CSA parsing has no effect because the broader parsing is still incorrect. This patch does not address that broader problem; it only makes the per-STA profile parser stop at the end of that profile. No production allocation over-read or user-visible failure has been demonstrated. Fixes: 7ef8f6821d16 ("wifi: mac80211: mlme: handle cross-link CSA") Assisted-by: Codex:gpt-5.6-sol Assisted-by: Kimi:K3 Signed-off-by: Zhao Li --- net/mac80211/mlme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index fa773f3b0541..1b9d272e7f8e 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -7977,7 +7977,7 @@ ieee80211_mgd_check_cross_link_csa(struct ieee80211_sub_if_data *sdata, prof = (void *)sta_profiles[link_id]; prof_elems = ieee802_11_parse_elems(prof->variable + (prof->sta_info_len - 1), - len - + len - sizeof(*prof) - (prof->sta_info_len - 1), IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON, -- 2.50.1 (Apple Git-155)