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 BCF824CC63A; Wed, 30 Sep 2026 18:12:50 +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=1790791971; cv=none; b=mAB6thVyemMqKFN/MjpC36jkXq/wPz0fWEtYaJcmsHkhEJiLokRKY/GksYPQCi9KPBPloiOvLJ+bEJVYx05BuaG9SCyVGxEKZ8wK/aj9sK2l9IWv88Dj5uAVcOqrarFUf10ntOD6bGoHMKejVEpNxDSje0Rvh6GeYiBQmDiG240= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790791971; c=relaxed/simple; bh=VzTyz4FlSyKnI47z0PDQYNB+/WxafjwT/goCrQo9t88=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p08G5w0lSnEeRJBZfDsP5XnL9kxbCuNXf8ICS4ZQa9NKilrFw4/rS6JgKsHRG8c+OP5LXmbhRx7Et5z+0FPuBFDOLLayklzgmJgf0qkNur+G4yZsrL6RKyN7JtSRrBq0OlJA4RZD2hrf0PDG4J3iVQousY42MotFcu6a4Na1Wzo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2kuZytUR; 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="2kuZytUR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23AFB1F000FF; Wed, 30 Sep 2026 18:12:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790791970; bh=Ow4nADw0AAYHvvQJrAnQQtoVSjhGREzjyKF5G7EwWT4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=2kuZytURaHb+rUSFF0HWrna13CohCEolZzKxpTS/p5X35rwkjR2L+nHhLiGqxYe8E RvTrLekuqt63A16QEhK2HZ3O/Z2gi4uUMlEjveZ/oLui2e2LJpM1odBo/x9nklz6NY 3nK/YyyhO//JLP3nbbb7VBqhxrHHzi0VdbRslpSY= 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 5.15 463/752] wifi: libipw: reject too-short association responses Date: Wed, 30 Sep 2026 17:25:33 +0200 Message-ID: <20260930152408.295320271@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152358.131179731@linuxfoundation.org> References: <20260930152358.131179731@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 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shmulik Cohen [ Upstream commit adb7118b7d2cfd7e8213c17d7d2829f353017754 ] libipw_handle_assoc_resp() reads the capability, status and aid fields of the 30-byte association response prefix and then computes the information element length as stats->len - sizeof(*frame) 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() turns a frame shorter than the fixed fields into a length near 64 KiB, and the parser then reads past the receive buffer. Both the ipw2100 and ipw2200 management receive paths reach this function having established only that the frame carries the generic 24-byte three-address header. 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: 9e8571affd1c ("[PATCH] ieee80211: Add QoS (WME) support to the ieee80211 subsystem") Assisted-by: Claude:claude-opus-5 Signed-off-by: Shmulik Cohen Link: https://patch.msgid.link/20260812190412.18333-3-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 2c67c6e88ec70..f74f8d8cf04d7 100644 --- a/drivers/net/wireless/intel/ipw2x00/libipw_rx.c +++ b/drivers/net/wireless/intel/ipw2x00/libipw_rx.c @@ -1302,6 +1302,9 @@ static int libipw_handle_assoc_resp(struct libipw_device *ieee, struct libipw_as struct libipw_network *network = &network_resp; struct net_device *dev = ieee->dev; + if (stats->len < sizeof(*frame)) + return 1; + network->flags = 0; network->qos_data.active = 0; network->qos_data.supported = 0; -- 2.53.0