From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (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 02C393112A5 for ; Wed, 12 Aug 2026 19:06:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786561565; cv=none; b=lBfYSaQAL3AgIgwPRU4gFMLRQwiU7eqitb1PJRWBShvgUWdmDg/5ZdreuRu5uu75O0oVnzUqUfZ3VtF62WatIRSPXMyUPt2z1h64UoMPhjv71iRgiK5fY/uouv8rAXzmOUeQJfFy2E49NWzuFMiyEyOm0I+MusHy1lWMqHTBHOU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786561565; c=relaxed/simple; bh=XgKH/QMgnQwl7EBN8sR3LbzgpflW0fob5QcEkkgOi6c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pVTyG4M5O05CSiNNzpxO2nv2Mi/f6+tUEj+VCgQ2Zs8XbRttVZuL4RyytILZmf5Kfhd74O/nqAKQe2/Mj7QkivJhap1xf9ti7foYrCtUx2hxqj6jwbVFRnc7Vt7ysdvkFUjlKsutIBOfWH2Zd2fIbewTDa58qbWYfX+tWgLJhbI= 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=JAHV+02N; arc=none smtp.client-ip=209.85.221.49 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="JAHV+02N" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-47fe2d179e2so788484f8f.1 for ; Wed, 12 Aug 2026 12:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786561562; x=1787166362; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/1tMxUnulpGOwRXNg8wdc8brX/d0czOuEVfcemqNqzM=; b=JAHV+02NPqcAu4lrYJDl3p7Pdi8ohEOQCtgshlnKQ1CduvJ+s1KmkNY91liKpASGzk oQJ8TBZ3t0s0BcUD7mCDF5LvuRXH2zTGxNo55U+pJubBYeESrAGxOg1NfC7JtL07+Z9A rUC6fWGhCC+iGoo2IOQ2HHBC+ay9Uk48zfBiUCY7KLGHTciid/urCDJd2blkmCZctXml HtX7UPwwCRl589p23rgSKgsqoo2CtewVbL1QSEafkM0FOxpD3NYDVP/7chj6G2cnp7q9 obxW8gngUIRWwUjqUIuKhEgHZBVp09muzMjiexeZt86RsSGN+muhx59sr2U0X9chQLOb 6eGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786561562; x=1787166362; h=content-transfer-encoding:mime-version:references:in-reply-to :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=/1tMxUnulpGOwRXNg8wdc8brX/d0czOuEVfcemqNqzM=; b=N/7bCZ4nV/pSP+3FKUBkgiOF0zwfAPcPp0Yo3XRv0aMERSGB3Y7ewK5VeuQd0p3QEB SiOdAfH8+dS+Rmh1PK/PUifWIiXExY2+AuUhaFb6ExlMk+QXXWo/ojG8y7n1k80qndpP ZsWYP/iIeVp2L9n7ZTNlW/tJgOn+7AqimA44Q3pO6Fuzv3mn67ZmzYN/N1POmEjZQkFd KbKZrDKHb28wKp7un0tSLZL2bWbD+MkWk+Xud/AhIDbRO4fAWiYX7mj0NV+vFFTq9rKL BK8xtod1TJAx8g/IVqBEXDtLqT4ZKGP7VWLLx102K/SXKLh6jwTPUPO3xO2w4eDnAARF EuRw== X-Forwarded-Encrypted: i=1; AHgh+Rps4XvTjzI37g0gCH7SMt6gKcfpC/gzrOyuV0LC7LVpnTWG32iEbs6DlIcxT79leLCcP07H/1a4y47mPHo=@vger.kernel.org X-Gm-Message-State: AOJu0Yw/v20+HbIJjT/gA7//YauIEqx0Et47BE3Gy56J1rEuDUPRbq9w cT9azruv0RD9iNgYkiNZtBR7lDDuJGV89ewgPqQAVnBYEkO8kAMRx9fY X-Gm-Gg: AR+sD10QEK0jVtM+Oy7Spmsfx26JJxNnS3/wKB/wlpLl1y4mn9FbtnNQ61l4kj1ru53 gig+8CBJn9dCpGZGNSvwnpu9ps1tT0EkSat7s/2+xoGkuf9ITpDdVSRM3tJLdVhEWRtG3PVVf8I P0WOPRKBNRg+4ZGABwzUNLyUiAeAIcgjS8Z4ThHf5ytBYXOuFtdr5wLtYE9J7NDqtByfUZbGLXT gxtoDvSSytPz1KsDxQlYmNBo8qwlWG4gkzjJ6O1CqWV5BHztBIHwY9AqNaEKwLvl77LWd595DOz 3DfBPTGGYz0aTVH8PKJA4TpShTMUxpX7Mr6EW1aaIxAqRflrQxHlLzujNS3ZTASzO022LaWhdlW 4PmstZ+JAsSj5P1AmZG+qOnMR/WMejyQTzmbRnYZIC2jWX0m6uJJGlLzygjiMQJPWzkM6ircrg5 B60iV2j6/X8qHFfdBOIojFxVt1fJGlA9eynshViioRNMff/qLF5hrwo7bohCwLHqX4Fivg31g6e VM00xD0SAyaOIibaduCSMaCZw60NqOUxVyECapn3WicPTF721uK/Hc+ALbn+JeJIdW1KYAub9a+ 8dBxHg== X-Received: by 2002:a5d:50cc:0:b0:481:51ce:542f with SMTP id ffacd0b85a97d-4815a028804mr313422f8f.21.1786561561990; Wed, 12 Aug 2026 12:06:01 -0700 (PDT) Received: from Mac.home ([95.35.242.1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48150d5eb2csm9179875f8f.30.2026.08.12.12.06.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Aug 2026 12:06:01 -0700 (PDT) From: Shmulik Cohen To: stas.yakovlev@gmail.com Cc: johannes@sipsolutions.net, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Shmulik Cohen Subject: [PATCH 2/3] wifi: libipw: reject too-short association responses Date: Wed, 12 Aug 2026 22:04:11 +0300 Message-ID: <20260812190412.18333-3-anuk909@gmail.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20260812190412.18333-1-anuk909@gmail.com> References: <20260812190412.18333-1-anuk909@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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 2661dac6985e..424349a6935e 100644 --- a/drivers/net/wireless/intel/ipw2x00/libipw_rx.c +++ b/drivers/net/wireless/intel/ipw2x00/libipw_rx.c @@ -1209,6 +1209,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.50.1 (Apple Git-155)