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=1796389341; b=L8ovhbfT+SiOFS2xormjQhJeEZ8y14GUhLWYvodPdBpxw+Jn3uQojvBqaUQkL20wNdsE Peiw2+s+vxAVBxHSstiWUgZbJSVImbBvhoxWC2QK/7zg5uuL0hC1cg9f7r7ujZkwcygxQ VBnzml4/AIK2BByDE5cA7T+QhzvEjUB7+Nd1/CofVd4tviT20XpkoZQ80mxCcuxN8Q30n cP4Aojg1NRjM7kijqnCpITiNHWwndH33Kfzvx0SVlQ8CVidr1SNrwAb9QL7JCeGum9r58 d5kL3YZskWaBI9dQwE0B417iMXcKAHzWwi8lQWf9zSZ9fiUd3EvSpZ/xOerdl4plqTQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389341; 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=JCus8v1IsR5kHZTBJ9ahQ+U1745ptE4y9feN8wayJDs=; b=J35VdoboePyeEsUHh68YSiwhLJ+xYqwreeUSsh624zE7NVwaYcGBFGG4uMmcIU+rZg47 6fdo/oQwPjzsStPiY0DSKa0QuzwudNwpjue6zLbRjR/jWM4xfAOVVONpGH7+xwUgi7NEa IKDy8TKe6anhyDaLjvImKx/4ozpGz1tuDCA7iVnAMQcvXXJzfjuAiwL4KGGu2FY0BOx8D XfOn+qYb0NbYYdOEEAGLt45sRhHArLFqRYlg2RNdsdOAp+sJ1Te7Ha5UxUWwzfcwVT1z5 k57k55yGaz00k+mSwQeDfGO0dFlpGsT0P4D6LgQlHbBIx5C4ry0QLMiXp8xt6yZhnfw== 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=njz5Bz3M; 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 7CA7C606A322; Fri, 4 Dec 2026 13:02:21 +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=njz5Bz3M Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCC291F000C2; Fri, 4 Dec 2026 13:02:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796389341; bh=JCus8v1IsR5kHZTBJ9ahQ+U1745ptE4y9feN8wayJDs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=njz5Bz3MwBKWU8aVzQyPyfCtNO+1QJS6rmnSWwo3cG3Y7GZ6UHFEiQcYBmv5h3yGt MfQqt2G0OLAEB69gMDHdU5ra0B7R4CwOCmFSa0TaxS8xGC2o50LnkZNncFl39Ysh1K /0tewUM6XaH2hbM4jShtW7ffRol9rQSOY+PX9zbc= 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.1 0956/1059] mac802154: llsec: reject secured frames with security level 0 Date: Fri, 4 Dec 2026 19:08:07 +0900 Message-ID: <20261204100708.783928431@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@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.1-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 @@ -1016,6 +1016,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) {