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 251005349B7; Wed, 23 Sep 2026 14:37:04 +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=1790174226; cv=none; b=ZP6yACC1hearTXjPIx4Rg9ZcqBFnV+auxkfg+5i7BaxiFnc9ovxm97Zk8ONC12Aw4d2VA2FQ9/u08bb0l9Xs79cm/OC00L9lOkum9C0snhwtlMe5G5mgAM1yNGNzvspFUEI1Qk4GyWc9EjbQDiHtMliyjjni7zL7e+b6H6/cVkw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790174226; c=relaxed/simple; bh=8w+/NF17EBP0voXfEmIsC/YMXthRr24y+8Q3pONFwq8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hPxRViuqHleJjno4u3426RPLHma/12EJTsB4ICMNWK+Xzx+qDelSPWOfaDN4/HPtZ1aFW4WqXyV5O0BRNxbjKc0lZ3e50DZZvrxmtRP3L6K8udFJfWpRTzZoWWsVBoUbX0Fv0VnNhCwjo3QMW2p4rsksfjvh9/8Jwd57eOEy0CA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Pawk8QtQ; 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="Pawk8QtQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1003A1F00898; Wed, 23 Sep 2026 14:37:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790174224; bh=T/6zGL0HDgNrcMEv0kQGHF5b5cJXFe8acNTpuVUrHLc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Pawk8QtQjcI6Bir13/v9z2T+LZAJ8Q4QSnM2ikCoBKy+fourvEDjfhhLAFpthmJx/ yzBU6acXu6a5neqlcrLSWeUUODV8H7XgO0Qyh47/Ctn4R0KPQb2sPzqudBSysHrlai +2vuInsX5r8mtaYc7Ul3/XOs8G0XKnPfSgq5UxMk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shmulik Cohen , Johannes Berg , Sasha Levin Subject: [PATCH 6.18 048/398] wifi: libipw: reject too-short beacon and probe responses Date: Wed, 23 Sep 2026 16:02:02 +0200 Message-ID: <20260923140644.668603946@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260923140643.441954610@linuxfoundation.org> References: <20260923140643.441954610@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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shmulik Cohen [ Upstream commit 5ce5721e8cbe3e80db8f43851cc2a2a92485ef4b ] libipw_process_probe_response() and the libipw_network_init() call it makes assume the frame contains the full 36-byte beacon and probe response prefix, but the ipw2100 and ipw2200 receive paths only establish that a management frame carries the generic 24-byte three-address header. libipw_network_init() then computes the information element length as stats->len - sizeof(*beacon) stats->len is a u16 and sizeof() has type size_t, so the subtraction is evaluated as size_t and wraps instead of going negative. Truncating that to the u16 length parameter of libipw_parse_info_param() yields 65524 for a 24-byte beacon, and the parser then walks the receive buffer as if it held almost 64 KiB of information elements, reading past the allocation. Reject the frame before any fixed field is touched. Found by an AI-assisted review of length arithmetic in management frame parsers. Verified with a KUnit case under Generic KASAN on arm64 under QEMU; I do not have the hardware, so it is not tested on a real device. Fixes: b453872c35cf ("[NET] ieee80211 subsystem") Assisted-by: Claude:claude-opus-5 Signed-off-by: Shmulik Cohen Link: https://patch.msgid.link/20260812190412.18333-2-anuk909@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/ipw2x00/libipw_rx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/intel/ipw2x00/libipw_rx.c b/drivers/net/wireless/intel/ipw2x00/libipw_rx.c index c8841f9b9ad91..2661dac6985e4 100644 --- a/drivers/net/wireless/intel/ipw2x00/libipw_rx.c +++ b/drivers/net/wireless/intel/ipw2x00/libipw_rx.c @@ -1421,6 +1421,9 @@ static void libipw_process_probe_response(struct libipw_device #endif unsigned long flags; + if (stats->len < sizeof(*beacon)) + return; + LIBIPW_DEBUG_SCAN("'%*pE' (%pM): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n", info_element->len, info_element->data, beacon->header.addr3, -- 2.53.0