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=1796382463; b=ObP10fpvaLnqRjS56XHMBwUYwiIUWNDeVeKi9ZRzeG7npPeghFdte0Jy2G48kjbXIqfV nAMNK6izbCUvJv2wIxnMWtQFzk7UqQJi+UaUctvX/aXMQdS1vdZhyTrwZEoc1g5GV6+zF UxhFNpka7P1CnQyuLzZLrnoEdASKZgNuGzaGlJnjIrBqil46pqssWdFqkaMIXHyqhRF6y MBFamHf/gyzoT+ctB0UmPFPJcygli7Ny60EJII6gQTW/4BVbmrxKKspxtjGadR9TwNwI9 XrCQNjY/iHHaobFOFERXwNRfOwaZMenrNlHr3zhkqPJJnV7u5p/Elu696FhZoGQbINw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382463; 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=t6Lzrg7b0Hg6khUsihSWdbjg/hwMg5DHMdcjkiZl2eA=; b=3mwOM94TXrwHFVbsjoeYk4gkGjiwgai+DPUT2p+e384da469QAUn85ugIX/7+IY1wUGV +iQ4mFp7xX41a3niys9FsLKERPx1iBwUnBiOMQSOcmSm99VrZnHDde+t3CFX0BIKA6YI3 pMhZPORw4d4AHKcyzCxaN8zvgd3PkL9iHI20YEPUfTTkBmJKcTJrQ5h73PkBqNNbvGNSU ZzoNjKTEV366HWyCpF+1GiEla816W1ToTjn2qiD2HEADEHS3yR6cM6br9uNSut19EcwLG b4LEJsXmEbL2a2zP0YeuvyL24APGy1prIxipcPuJSBPH4OmDv4xgH68wjdFKb5Oqzsg== 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=AIIDLqim; 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 91F41606A32F; Fri, 4 Dec 2026 11:07:43 +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=AIIDLqim Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F4051F000CE; Fri, 4 Dec 2026 11:07:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382463; bh=t6Lzrg7b0Hg6khUsihSWdbjg/hwMg5DHMdcjkiZl2eA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AIIDLqimIBgCZYPz5Vl3FKA6j1xRc8OyWV87aHuEPMsR8hHs/cmHHebTrKfS39c3s Rdb9EQ8gy21HccpJguDJZA+l1CXXtXA09vxD3rFhyVPGDN7K07I8p/JbHh6QXAVewo 2W61e3OpALmfO/2gdwc+F5TKmwNMZF4rEe7tcrKQ= 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.18 466/703] mac802154: llsec: reject secured frames with security level 0 Date: Fri, 4 Dec 2026 19:06:05 +0900 Message-ID: <20261204100640.176342356@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@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.18-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) {