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=1796383878; b=21kIub1oHkFIcVWjIqhxyVPTz3AluGKfOjTfsNEESsFUCuc9GqoqpjM2R9TCu3FXXLwP h6ssOWpbiMsUe0VreylJMz+rI9BcR/y/ujV9J6qwuv188FJCmizcorTh7YrhedJEd6i4P rmcpuWOS1wyOPNS3lr9T1sYT0zKsKyuCVQcunT1lOWdY1GwyM/7Sda4T6fiFLXzxZ9mJL JxcpXEIrqCkXgMKlgnmtHaG+W8FadtqJGg1Q/4+4xaEnKtFwtHZ0El2xPqQXfes7X6rFQ cYWUQRrGKPDaJD01ntMHlUntxspkk749w3AV8fjbGedNhmq7PmOS2UyYYD3o0ubZBbA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383878; 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=J9kilaQ1oHyujx/d2IpTTDO2jmvgA9bQ/6yDh9mcRK8=; b=lDah1zAe6fq2qeE/GFVIuDJ58GcnWgqOt6TKZB9xgexc5BE4iqUjKBvDe2oadBsgJcn3 rZ/Uub7DjJFXJm2APFmPPJ9LIRmDMeWcUgF1NA5AyLDwybKUjs8RZqr6Rnjz+zYzz2XDn EliJEeCc3D4SJFzMepr6Z9QLQWb4h7CcEcNBHgo6uXuuknrFrI+ujnRwQQHKoUo2ki1DP i+cGXJHxkiAsRW0wewKkx2/5kfZkql+aasx0NET1Orv3htOhYDom4G59Q1ZQs56kJfCVc hxSXwP5Pe1TozZjOpO5wYWiCfgVtr1RrCHme6W+2Z+rQ3PxG4jctpaB0Ed6YK5If8sA== 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=oSrRCpZi; 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 14B97606A322; Fri, 4 Dec 2026 11:31:18 +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=oSrRCpZi Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F8001F00897; Fri, 4 Dec 2026 11:31:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383877; bh=J9kilaQ1oHyujx/d2IpTTDO2jmvgA9bQ/6yDh9mcRK8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=oSrRCpZiK7AcR0CQnLpPqvKqUqmTW3oo93c3VHvyhRISc9t24bSXcD7G9/lki5U3X IQVIAWStEi8CH4EvTsgtRgDs/Wni5t/0N2R/sw9xmHGbXsKS1RFsDBqQO0ex16q9Co 0VPcPyRVi0RCic/8L/1EybILtka7VY0yj1Dxwfbw= 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 6.12 405/555] mac802154: llsec: reject secured frames with security level 0 Date: Fri, 4 Dec 2026 19:07:28 +0900 Message-ID: <20261204100625.137703391@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@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 6.12-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) {