From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796381006; b=ek4tOGJqa8CLZ8N7eoCxgjh3xNMEpBOamdJLwrcoQakXpMgbnHxQJIo6UQBrx68A1xsn yBc8MrhnL17XsXPB87OfUreQFfscRyFnuqMs5pp15gcd+zoE5TSDulcQiVvfbhRrb81Dz N6jU0bLyjzb120Fy2uWsP++rDN3y6RAthWXvtag/ZWoEcObVVGpgzrn0SZL2tPhHORGNh vRqt8Uphc4UUjdqQOinzwEsAwsSxFxYnxkRhAB6zllEaLg16QI1148kpJvERVRI7c1kkk V4dv+xFEWbYipd56SoENHoi41WezgkNwoFh8RX0F8nC8hm4cGRLpuyBvXidvMxTDtLw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381006; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=zgccoY+6LIkeMGkT0RUn7Bu44uJmdVbeyKAymlH2/bY=; b=GSlrEMuz5tBAzFwr3uDH8SFYj33pRruVR/RKnfftDwV3Pa77/jixUK1cL/G0vNtJpJYA 4QfprafpB0Qz7YgFuhZSVqYVdBbE7Keg9pyCUyKqF0wEjxOr9yzahPnhIrkY0ngiSpKY7 cQGSbUdnQiwxO1R+I/IcW0c2ZEx9gLs2Y7Ynx75+4gIKtu/5RSnBTWQAKvRWqY8R4bLJK clN9HVTcUMn4IH7GzlNGOEtYDhSDKTAm3z5FXkPZiv9E/QrEdEhj0PBdYS0AjzcQ2hnSd 2/9x99ClO68ZpRszIV5DnJo+5DjdxNEDDf62zOg/kdomKvDV8OUl4FLwkWvpGI1QiiA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Br7QDAyI; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5632B606A32F; Fri, 4 Dec 2026 10:43:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Br7QDAyI Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEAB61F0092C; Fri, 4 Dec 2026 10:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381006; bh=zgccoY+6LIkeMGkT0RUn7Bu44uJmdVbeyKAymlH2/bY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Br7QDAyIILT8LNvbFCoGDNbAURI1B9viYX/1obo9z6P+7634vhGzpfyE/xBv1OmI1 2by3NtH5gvViMY9Pl9j7XxrD2rBumyYLf9TMwaw32fiZsfRfcLhokU4sa++gjRuZQr qcwTFx9Bpd2Lq6GadIuJiTCYE+EIQnwVaWJgokYw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Joas Antonio dos Santos , Miquel Raynal , Jakub Kicinski Subject: [PATCH 7.3 516/742] mac802154: llsec: reject secured frames with security level 0 Date: Fri, 4 Dec 2026 19:06:20 +0900 Message-ID: <20261204100648.862747977@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Joas Antonio dos Santos commit 3e8c853c959e9637ed66ae1e55e0d3bb97372cc5 upstream. mac802154_llsec_decrypt() handles every received frame that has the Security Enabled bit set. The security level is taken from the auxiliary security header of the frame and is not required to be non-zero. The only check that looks at level 0 rejects the frame only if level 0 is not allowed by the matching seclevel entry, the entry has device_override set and the device is not seclevel_exempt: if (!(seclevel.sec_levels & BIT(hdr.sec.level)) && (hdr.sec.level == 0 && seclevel.device_override && !dev->dev.seclevel_exempt)) { Otherwise the frame reaches llsec_do_decrypt(), which sends every level other than IEEE802154_SCF_SECLEVEL_ENC to llsec_do_decrypt_auth(). There ieee802154_sechdr_authtag_len() returns 0 for level 0 and req = aead_request_alloc(llsec_tfm_by_len(key, authlen), GFP_ATOMIC); looks for a transform with an authentication tag size of 0. The key only has transforms for tag sizes 4, 8 and 16, so llsec_tfm_by_len() runs into its BUG(). The frame is not authenticated at that point. A station in radio range can crash a node that has llsec enabled if it sends a frame that matches a configured key entry and a device table entry (source address, key id mode and key id are sent in the clear and can be observed), uses a frame type that has a seclevel entry and carries a frame counter that is not lower than the stored one. No key material is needed. The frame counter of that device is also updated before the BUG() is reached. A frame with the Security Enabled bit set and security level 0 carries no protection and cannot be processed by the incoming security procedure. Reject it before any key or device state is looked up. The transmit side already leaves such frames alone in mac802154_llsec_encrypt(). Found by LLM-assisted source review. Fixes: 4c14a2fb5d14 ("mac802154: add llsec decryption method") Cc: stable@vger.kernel.org Signed-off-by: Joas Antonio dos Santos Reviewed-by: Miquel Raynal Link: https://patch.msgid.link/20261110-llsec-seclevel-none-v1-1-06ef143e467f@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/mac802154/llsec.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/mac802154/llsec.c +++ b/net/mac802154/llsec.c @@ -1019,6 +1019,8 @@ int mac802154_llsec_decrypt(struct mac80 return 0; if (hdr.fc.version == 0) return -EINVAL; + if (hdr.sec.level == IEEE802154_SCF_SECLEVEL_NONE) + return -EINVAL; read_lock_bh(&sec->lock); if (!sec->params.enabled) {