Article View: linux.kernel.netdev
Article #21813Re: [PATCH wireless 1/2] wifi: mac80211: do not copy the mesh RSN IE twice into the beacon
From: Johannes Berg
Date: Tue, 24 Nov 2026 14:02
Date: Tue, 24 Nov 2026 14:02
64 lines
11110 bytes
11110 bytes
On Tue, 2026-11-24 at 06:05 +0530, Piyus Kedia wrote:
> ieee80211_mesh_build_beacon() budgets the user's extra IE blob once:
>
> tail_len = ... +
> ifmsh->ie_len;
>
> bcn = kzalloc(sizeof(*bcn) + head_len + tail_len, GFP_KERNEL);
>
> but two of the builders that fill the tail draw from that blob.
> mesh_add_vendor_ies() emits everything from the first vendor IE to the
> end of it:
>
> offset = ieee80211_ie_split_vendor(ifmsh->ie, ifmsh->ie_len, 0);
>
> if (offset < ifmsh->ie_len) {
> len = ifmsh->ie_len - offset;
> data = ifmsh->ie + offset;
> ...
> skb_put_data(skb, data, len);
>
> while mesh_add_rsn_ie() searches the whole blob:
>
> data = cfg80211_find_ie(WLAN_EID_RSN, ifmsh->ie, ifmsh->ie_len);
>
> A blob that begins with a vendor IE therefore has its RSN IE emitted
> twice - once inside the verbatim vendor range, once on its own - and the
> tail copy runs past the allocation:
>
> BUG: KASAN: slab-out-of-bounds in ieee80211_mesh_build_beacon+0xe3f
> Write of size 479 at addr ffff88805ca1887b by task syz-executor
> __asan_memcpy
> ieee80211_mesh_build_beacon net/mac80211/mesh.c:1110
> ieee80211_start_mesh net/mac80211/mesh.c:1187
> ieee80211_join_mesh net/mac80211/cfg.c:3330
> rdev_join_mesh
> __cfg80211_join_mesh net/wireless/mesh.c:214
> nl80211_join_mesh net/wireless/nl80211.c:15399
>
> One NL80211_CMD_JOIN_MESH carrying such an NL80211_ATTR_IE is enough.
>
> Confine the RSN search to the non-vendor part of the blob, so the two
> builders cover disjoint ranges and their total cannot exceed the single
> ifmsh->ie_len the beacon was sized with. The blob reaches us having passed
> validate_ie_attr(), which walks the element chain and requires it to end
> exactly at the end of the attribute, so the split returns an element
> boundary that is not past ifmsh->ie_len.
>
> An RSN IE placed behind a vendor IE is still emitted, as part of that
> verbatim vendor range; nothing that a well-formed configuration sends is
> dropped.
>
> How this was found: by AI-driven fuzzing built on top of syzkaller. Its
> analysis was checked by hand against the code, the fault was reproduced on
> net.git main under KASAN, and the patched kernel is clean on the same
> reproducer with ordinary secure-mesh beacons unaffected.
>
Please write a better commit message. This is *mostly* just stating the
obvious, as LLMs always do.
johannes
Technical Details
Message-ID:
<ac39fb1720fc03069317f8a74aa0f34d86db2e30.camel@sipsolutions.net>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-370404-linux-kernel-netdev=dewy.ruReferences:
<20261124003526.78471-1-piyus@iiitd.ac.in> <20261124003526.78471-2-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-370404-linux-kernel-netdev=dewy.ru From: johannes@sipsolutions.net (Johannes Berg) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH wireless 1/2] wifi: mac80211: do not copy the mesh RSN IE twice into the beacon Date: Tue, 24 Nov 2026 15:02:16 +0100 Organization: Usenet Network Message-ID: <ac39fb1720fc03069317f8a74aa0f34d86db2e30.camel@sipsolutions.net> References: <20261124003526.78471-1-piyus@iiitd.ac.in> <20261124003526.78471-2-piyus@iiitd.ac.in> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: usenet.network; logging-data="4150446"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Vh11jxyoafnB2bdly69Y4fcRuKM= sha256:sa5Xm8f2KVTAitmSY+BCLY2z/VfdHkXz16pWEbjIZZg= sha1:CQ+VVFPCz6ZQcJ0C7yfjh7Na378= sha256:s0V+83UfZP/AvAeAJ+no7N0hkRskFrYKTaiO2fAgLPo= 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 2DB83125E15; Tue, 24 Nov 2026 17:03:03 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-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=pass (2048-bit key) header.d=sipsolutions.net 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 SMdEoWrQfojf; Tue, 24 Nov 2026 17:03:00 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-370404-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=permerror header.from=sipsolutions.net X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 76077125E18; Tue, 24 Nov 2026 17:02:45 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id A0C362A5B2; Tue, 24 Nov 2026 14:02: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=1795528949; b=YNxXTq3nBnmPxPx5U/tgka/lD5V75bk84lvfeX2yE5+IFjHgPNwiP5NQBYHM361wb9jX xPvJ6R13L6IPJyoaJqMzvbh0caIi94ugFio0hBSSLOrP1XZcM0szcovEXpVlDPQfPcrwv dq28wYzLc4Psa1M0QFwRehxhe49U5eZOpGRFtGmpmcHsBTTfwI3djIGUiw1MtXJx7Koxz IKfMELVULwpkhEtUj1bgV6aC/+DI3Of57yHDYeAi3+4mnrLIPlWXMBFfXQMaKLkNCAKRV JTOEs3HOv7a3unK2Fj5K1zxdHtApzfEL8zeWMmyGs/lwczSUC512GkCJWZWRpSPmtxw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795528949; h=X-Original-To:Received:DKIM-Signature:Received:Message-ID:Subject: From:To:Cc:Date:In-Reply-To:References:Content-Type: Content-Transfer-Encoding:User-Agent:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:X-malware-bazaar; bh=GENSQeNWNIKZx0VytaVvE7AxDqBFnF08lo9NVw6ZAsw=; b=YE3gK/6TWrwCZx549CPpX69/H8o5SyXRWjisHwLh0213pv2fCSlCJZq3qOBFVcOYZnY4 wl6+jh2gg1/ccUYtzA4dvVNY9/Dbtaq2FnsHaVjFlyHUfQ4hEn4qo+/mBClOl7zxVZcAd 2+OfPWGkJcOxp0fF+bHa+4VSaZb+3PPefpMqO64+4ywDVCWujwXHtE8C0/DI3AyIRosUr o1AX8FZq9Hz2/89scfd3P/QDRNp81XgD1ybnQOgsYVuYdOGXWDHh4M55MbUkL/A1WemBk e1jrXvT3VeezRXOcAuyGbG0WrHSNsc6iqSzYnx9wg7/fxWvMwE3Rtc6je5eauQk3DwA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=sipsolutions.net header.i=@sipsolutions.net header.a=rsa-sha256 header.s=mail header.b=HNmIbd2U; dmarc=permerror header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; 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 C067160A261B; Tue, 24 Nov 2026 14:02:29 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.a=rsa-sha256 header.s=mail header.b=HNmIbd2U X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=168.119.38.16 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795528944; b=1TfXbuRIUs42rz/Q5RkuehDZg7JWs8XCDQT2pew4iak+bxhCNgSaFe5BJ057FL/gtfbA VJPwRRfdtPcWK7jICgyuLPVOX9RYCLqmoh0uBCqDkMjzb6JyJBc/yxlOMfzJFI9qTDVw4 wr/Ce88PJYemsJC1L1X1ciD492tSuXZUQp3+4mTKwtZLyLuMhGvE48yFUT9sycAa2f1Ra xwT0l9eF7mzMEjud5vI2ew52lCIBbGi5Tvvdrr6g02i5CQeT6SNC8po6YrTOD+TF/NyyM Ld0h4bS6t+PFx4f/EMUAHqKEypCclTtdHl/awrIuYbk4cjjuay02CfAdRQK7+Ag39PQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795528944; h=DKIM-Signature:Received:Message-ID:Subject:From:To:Cc:Date: In-Reply-To:References:Content-Type:Content-Transfer-Encoding: User-Agent:MIME-Version:X-malware-bazaar; bh=GENSQeNWNIKZx0VytaVvE7AxDqBFnF08lo9NVw6ZAsw=; b=i9wnXs6GWDB1azvpmPuyY8v1NQVkTTq7YK4gL4P1xVnpMX4qxQ6kZ9Pjig9lFSn/yKbk 0DWzik17deuVG8xjft9875pywtVtjhruXbDXnF43ar/56hnW/TrEBT2M4xu4D+jf+2SmF Zxvqw2w0ZuedXcWfyyngzBMntjR3zrG55vs7KRVCNZNCBVbPkiF7NjNhjdt3wIbQhahqx QKKFNJ++2OgcFf+hxuR55Jv5slIUuSSllArjplS/rOPsT9EPrsTmPiu5n8b39XaAs7bm5 7nJAYVBVU/9/Z8qGPwCTxFViiFKSJ0hYO8Byn6aiqaLTBb4XAv6wCJhU5w8z3IDKYpw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=permerror header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass header.d=sipsolutions.net header.i=@sipsolutions.net header.a=rsa-sha256 header.s=mail header.b=HNmIbd2U; arc=none smtp.remote-ip=168.119.38.16 X-Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54118606A680; Tue, 24 Nov 2026 14:02:23 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dmarc=permerror header.from=sipsolutions.net X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=GENSQeNWNIKZx0VytaVvE7AxDqBFnF08lo9NVw6ZAsw=; t=1795528943; x=1796738543; b=HNmIbd2UHXm6gSloO/o7vbnK636nqBFZqLc5JnYx1dEZJdp HWwad41Hy4MK9MRptOFuf2vQRCWUme0IKO4xH8jkPoq4NCPWgW7qZ0N4JiYMTnLH9SCl6mvJhT++a NuUKYwYtbGHwXH9MLnOG41R0LuClNucGv5sK00P+P3Nr9Mw5mt1t+icecSRZ6cj5tW41Gj9VzfUnU bdE2csLmYsmbioLHBtVjEaKIMiJJf85KI9r7ETNWBSvOOUnKeqOvmlavIn4TfusjbaEYGEZ52xuEN OqFQzdvli2gVfRwDHCpf8XSqQ62Yu/ywPEDYWE/uZ8QJVjHDuSmIw83xPtPwbKiQ==; X-Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__ECDSA_SECP256R1_SHA256__AES_256_GCM:256) (Exim 4.98.2) (envelope-from <johannes@sipsolutions.net>) id 1xVr6A-0000000CLPg-1jlO; Tue, 24 Nov 2026 15:02:18 +0100 X-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Kapil Vaswani <kapil@presceralabs.ai>, stable@vger.kernel.org X-In-Reply-To: <20261124003526.78471-2-piyus@iiitd.ac.in> X-User-Agent: Evolution 3.60.2 (3.60.2-3.fc44) 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 X-malware-bazaar: not-scanned