Article View: linux.kernel.netdev
Article #21401[PATCH wireless 2/2] wifi: mac80211: widen the mesh IE offsets a u8 cannot hold
From: Piyus Kedia
Date: Tue, 24 Nov 2026 00:35
Date: Tue, 24 Nov 2026 00:35
70 lines
12792 bytes
12792 bytes
The extra IE blob a mesh join carries is bounded by IEEE80211_MAX_DATA_LEN,
2304 bytes, and ifmsh->ie_len is a size_t. Two places that walk it use u8
for values derived from that length.
mesh_add_vendor_ies():
u8 offset, len;
...
offset = ieee80211_ie_split_vendor(ifmsh->ie, ifmsh->ie_len, 0);
if (offset < ifmsh->ie_len) {
len = ifmsh->ie_len - offset;
ieee80211_ie_split_vendor() returns a size_t. A blob whose vendor IEs
begin past byte 255 truncates the offset to a smaller value, so the copy
starts in the middle of an earlier element and emits bytes that are not
vendor IEs at all; len truncates with it.
mesh_add_rsn_ie():
u8 len = 0;
...
len = data[1] + 2;
An element's length byte reaches 255, so this is 257 for the largest RSN IE
and truncates to 1 - the IE is then emitted as a two-byte stub, and a
secure mesh advertises a malformed RSN element.
Neither is a memory-safety problem: the preceding patch makes the two
builders cover disjoint ranges, so the beacon's single ifmsh->ie_len budget
holds whatever these values are. Use types that can hold them.
How this was found: alongside the out-of-bounds write fixed in the
preceding patch, by AI-driven fuzzing built on top of syzkaller, then
checked by hand against the code.
Fixes: 2b5e19677592 ("mac80211: cache mesh beacon")
Signed-off-by: Kapil Vaswani <kapil@presceralabs.ai>
Signed-off-by: Piyus Kedia <piyus@iiitd.ac.in>
---
net/mac80211/mesh.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index eb54bd98f282..4ab776e174d9 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -354,7 +354,7 @@ int mesh_add_vendor_ies(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb)
{
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
- u8 offset, len;
+ size_t offset, len;
const u8 *data;
if (!ifmsh->ie || !ifmsh->ie_len)
@@ -377,9 +377,9 @@ int mesh_add_vendor_ies(struct ieee80211_sub_if_data *sdata,
int mesh_add_rsn_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
{
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
- u8 len = 0;
const u8 *data;
size_t prefix;
+ unsigned int len;
if (!ifmsh->ie || !ifmsh->ie_len)
return 0;
--
2.34.1
Technical Details
Message-ID:
<20261124003526.78471-3-piyus@iiitd.ac.in>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369874-linux-kernel-netdev=dewy.ruReferences:
<20261124003526.78471-1-piyus@iiitd.ac.in>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369874-linux-kernel-netdev=dewy.ru
From: piyus@iiitd.ac.in (Piyus Kedia)
Newsgroups: linux.kernel.netdev
Subject: [PATCH wireless 2/2] wifi: mac80211: widen the mesh IE offsets a u8 cannot hold
Date: Tue, 24 Nov 2026 06:05:26 +0530
Organization: Usenet Network
Message-ID: <20261124003526.78471-3-piyus@iiitd.ac.in>
References: <20261124003526.78471-1-piyus@iiitd.ac.in>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="4016688"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:6ZRrKvfcwhkTCQGXEoyv2Mc9koc= sha256:mv0Vr4fYtGKhWP1WQiW1FB5sE45GX9DSvqxFgfHnrjs=
sha1:rLJiWHnPuVB/vEifWBTLNAokNsM= sha256:yic1RlHbVP2Ok2wXOO/k4bVjwkxXJxwoLseSx0/SVME=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id DF057125DCA; Tue, 24 Nov 2026 03:36:30 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.75
X-Spam-Status: No, score=-2.75 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_INVALID=0.1, DKIM_SIGNED=0.1,
HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=neutral
reason="invalid (public key: DNS error: SERVFAIL)"
header.d=iiitd.ac.in
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id 7tJeejAXXhAP;
Tue, 24 Nov 2026 03:36:28 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-369874-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=iiitd.ac.in
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id B5DC1125DC6; Tue, 24 Nov 2026 03:36:19 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id B8E4234225; Tue, 24 Nov 2026 00:35:43 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1795480543;
b=Jz9HcluudllurPkbC7yAVsNrq64mPeLjsSQ/FpohP8YN50mJ8wJInKbjMmTlYPjHQYsF
m0vaVFdbdCpor3lYQDoFDWSr8DYnif1CNQD6O5txXjZXTCQT7w7+mALWIadcUgcMhE3ag
DgyqeRBBG3MW4oazFYz80KO6O3TTbcC6481T+XGlwq97ZRqv1Rh5jVSJ2EuwN4we2Yoz5
PTX+SNamuNXxS+jRO/u0loN601sRo9uvMBVskd7rkOt4q1ORzxIka2AUCF6C3vAuk4aCq
AfwUSHXU6KtV1tiHPGc2uNJM9lm8iTD0kBzXCfwRPNv0781JbJqSJ+NuoDImxns0YVw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795480543;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:
References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:
Content-Transfer-Encoding;
bh=r+sRDZEHrgCdILFBOlwZpD0Uy4pTk4kro1/MkEYhJDI=;
b=saY4NkwwGV0cxQ2AGNMjq7qhet+CkktSiCcU9tOwAucqilpPmpq3oTN3fgUrBLOTsVBm
g5LXfGa8dPCSfcj4PE4iYLQIMxFRoJG4wplKqQtrhu2ZXifg5EoI2dzksnXBL4aV1RpBc
dktVWKXaaxjqB4lR9PNB0baApUOHTAt244QFwq/3+zVTOyL8swHTA31Vce+qySaViSHjk
UEYaIkl9rOPIRgB5EkES8gBQwQy3jN8xiXZfeWmEsvuLL8TngqLUhh3o5kzGgMB3rS2dP
c0PY7pBrgXeGR8xs9MiF3N1+ChTdJZhIYAKDW2qiQarvYQISzF6GW0nsVZJ17BYNYzQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=iiitd.ac.in header.i=@iiitd.ac.in header.a=rsa-sha256 header.s=google header.b=U89QZLLb;
dmarc=none header.from=iiitd.ac.in;
spf=pass smtp.mailfrom=iiitd.ac.in;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B59E606A684;
Tue, 24 Nov 2026 00:35:43 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=iiitd.ac.in header.i=@iiitd.ac.in header.a=rsa-sha256 header.s=google header.b=U89QZLLb
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.179
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795480542;
b=xNyZA1+FHVBeFDByQY4V5TA+gPKmkLz1NGBAUAJa5nNf3W/9p9aNcB+NLAiA/R0tnL4d
7eWzMhb523eSFlVjD5Mgfc0sBEoLPi98j4iC2U52XAqPEZn3vCE7lH7MZ0tL7NP7ODbLb
k3W6YIbI4AcOHi+A7cZhFdcDLFTwUU9AhRvzgGjf1ZDwlb1YuVCR9y+Xil01lqywjJAAT
X5KWOKl2l7uWwHZxbVVnKDEk60ssJught0ydVn4wp57H9LcQFp/g//bw+Olr3TPlHwJlZ
dC9ANdSNhqDIT97EOeIxUm5EZmJ4Gw3/pI8UxNR9ASkd0WLPOT/Jq2eTD2Tmd8IODBQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795480542;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
Date:Message-Id:X-Mailer:In-Reply-To:References:MIME-Version:
Content-Transfer-Encoding;
bh=r+sRDZEHrgCdILFBOlwZpD0Uy4pTk4kro1/MkEYhJDI=;
b=Et5apcLdPutkVA7LfQiV16Q5U2LnJL57uRyAquXqKkRyJ/88nqjS4UYx82vWWqumUf4L
rBFBBctQqP/PgvIq1aM1L2LJNrjgfSxAtlB9tHYNmk0HQ67pxMvJMLHqhkutc7JGPKZaT
/ZEe6RpXLm1tlIiLtoS273xVF6/jefO6GnhXVZUMCswQ2zUmBO5hC1niWHXiC0PVYK/B+
CLdBBFVniMtRpiFX5yM+VHJLkPVPNy2X/Kup0NQs/oqwk3oLDkJ2YZdAHZQtwv1ipi8x/
gsTpoekcn2SP6oh7/klOFgeVCnIdxqwuhWjJnYRqYYXfn3GbNEloNLM5ULkbNd+GbLg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=none header.from=iiitd.ac.in;
spf=pass smtp.mailfrom=iiitd.ac.in;
dkim=pass header.d=iiitd.ac.in header.i=@iiitd.ac.in header.a=rsa-sha256 header.s=google header.b=U89QZLLb;
arc=none smtp.remote-ip=209.85.214.179
X-Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id B496B606A338
for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 00:35:41 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B496B606A338
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iiitd.ac.in
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iiitd.ac.in
X-Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2f04244c3d0so32520795ad.3
for <netdev@vger.kernel.org>; Mon, 23 Nov 2026 16:35:41 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=iiitd.ac.in; s=google; t=1795480541; x=1796085341; 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=r+sRDZEHrgCdILFBOlwZpD0Uy4pTk4kro1/MkEYhJDI=;
b=U89QZLLbOz59aD8Y5kR/XtX6j38G64zNPVUntrHhIUGN0iHKJN2mNev+3NSQqxsp/Y
+zUNVxrmOYZhlvM+nck4tWMaOuqSxIHMFEOBgGfkiUGqVoaw36zfbAIS0G9/zL7tBQwK
gg0A7xIINvpe6nGUVtF/FxRZNhm6iAL4DF0sc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795480541; x=1796085341;
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=r+sRDZEHrgCdILFBOlwZpD0Uy4pTk4kro1/MkEYhJDI=;
b=beElj2fboQlqmft+PO1ivkO3kjpNeBF5DVoL48X/CEaljcCoRg6DY2mLp01zzmXo7C
Z6S9JEHPhvMoCzciM2kejpFr9jPKoiPvUH83mgQzU6pRFvnDCx1ufn6FzVxn6rsA+Ey5
dLOKUyZN8eD/OzVVNG+4pSM4mxS9EF7CzxHcI8s3BqK0a85NRx4fQlUjKCN5lQIwyINs
g7Vb6ehbXvdBSclV5HqzhHqaanzLD4W3L2SUIONnICZmmbtCkLFq63EpAL10D4PTu181
mYJ1USeD3TTeHQkISWYqgXuhKPIdTVyxoHzqNVUIdiiAczgjeEZuTDkzhP5FTdW2nGDy
pobw==
X-Gm-Message-State: APuU4Z8izmjr695DGZmaJZr6Hj5WAvrwM9N4Xl160apcIKt7XV1BXV4T
qRHdgnvrV8OHQzkPlPH5kVAq/PKiV8ht7fCIntEJ7U52Zc+/OpSxcZqTaw2DzjETLoo=
X-Gm-Gg: AZFdTZcQlithODtFbQKiz+KViWsaKo+3+MNYwY3s36w4cgK13Qwd5GB3C1reCnh0OxH
aSupQzGOnUA11VmaUhujRH8m7TwaDhUxQ9l9vZifT98LbL7DKT8FJ97UuhXeS8ce0VYL+gGDXsc
RdO5nlhes8rxQd0YILsKnivtgoL7H4KEM3Qks9ix/JEw3JcFzFTZAD0pbag/q2TNBk3EmwOT+6l
84woNcJxRnn13K2ot060qGvJ+uisiGBZvw5dCOwPqZgkxVXQmuiImn9WaRUmm6S+nLFZMR/MUke
k+hybDsuVrDVny4SjkbqUCvxXyl3dUXvKFPR4JvUKAAqBtiZkyyIzHR721JbpzapN5vRUaJX/i9
QIasn7bcQ2opbF2vvgWQ4PnMExFMTRjlEDKawaNKNDYksdBIPATzhJKbUWBNZlyFgEy99IyzlIF
xBYaPug4gfT3EhMSRqnLOQvU2kuDdMCCF3m2xdCgNDonGJI6NoelM4W59HMXrEQmvWXVhjYt11r
QEPwzaPZ7nkOEWn5E+RIEE954OfRZ8tRAxP774u0BWeH7RYy/Dxu7vIJ63qkhntT1c4oa7ed2F+
OHtPCmd777I06dgyQI/88mDzQIjG1rLWAEKxFSiT9rNCLbEXliNYVfdB96rP6kXQqTtcGMeWd4y
RZ01X6EJz72mUH3duU6jhUJ95W5F/1001jY0UE6G5YsWt1XsxiggxKUB8tluXsjWM
X-Received: by 2002:a17:90b:4483:b0:3b4:1877:8d30 with SMTP id 98e67ed59e1d1-3b41cb4fd23mr11751289a91.62.1795480541093;
Mon, 23 Nov 2026 16:35:41 -0800 (PST)
X-Received: from iiitd-S2600STB.iiitd.edu.in ([103.25.231.160])
by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cde6cfc8829sm6076667a12.8.2026.11.23.16.35.38
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Mon, 23 Nov 2026 16:35:40 -0800 (PST)
X-Cc: netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Kapil Vaswani <kapil@presceralabs.ai>,
Piyus Kedia <piyus@iiitd.ac.in>
X-Mailer: git-send-email 2.34.1
X-In-Reply-To: <20261124003526.78471-1-piyus@iiitd.ac.in>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list