Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2881714pxj; Mon, 31 May 2021 13:32:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrqX+E8ilhZPNJVEoteUJKCOvEnNtxjOyN54LvHaoZVeo/5jRLub87YX15z2gWE0euuT5a X-Received: by 2002:a17:906:1311:: with SMTP id w17mr21389652ejb.6.1622493148463; Mon, 31 May 2021 13:32:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622493148; cv=none; d=google.com; s=arc-20160816; b=exK2juw4PNZm6Vz80kO8X6kVWVe4Gsq8x+duptkyETltMKa71hQ9OomJ/Jd0aZ9ONu AwMvOzh/NRXO5wByLMVddwqBypQqXt0U0rXh3xxBeCJM6DOo54pv0JsRxXSiI6trbBhi R8T8+/WzPuL+mjExUB3RFRGmQulLwJ8CApDR06+Y0LSTOUiGC89MOMYHQwVrUNIzUfaV s+zn4wR3vP/T6wsoU1uBnt/1vVp6s2emCJFs3fFNByU3tW9P0ycJ0NGRjLBw0hPLfxZQ 2CfHeStLgQYzVcq35BG+80wgjtMY1rBJpMBu77VD68JwCV9mTZASFGs8ETYydEbfg5IZ ZLhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=JoNxJACZlHp/HwW2OMRdLmmuPp+6P4OpQTVA3+03u5M=; b=yyXHoQBuHglTG1reJazOeetBD690s+6TMCNz3DNxyo5KyukAVb8TWzPFLJZ99o83bB anUvE8IXRCBHkDf1BZJzioyMvpuA4jpxnMG3yZ1a5YJM0xUcLL9LDLfsfTNiIlRUZtlk tBvh6JclyEAuFiUqCtMYBi6C9SF6+U2qbdbA2MuXEClLw3JEa0fVajpGtRMtjJa7UJ5B QBFkxhoA4sl70EONPZ+QcMW6J7ALEtTEBpo3YMEwTkwuDFbKV28IhUPJLf0TWhuJPCcG ADuajy/VCgrY+diRlZs21X/73Lb0gaQbfHeMXpQqoye1kEj0KqrTSpcCXs+/vKV6msvh TtoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ju18si1746305ejc.455.2021.05.31.13.32.05; Mon, 31 May 2021 13:32:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232244AbhEaUam (ORCPT + 99 others); Mon, 31 May 2021 16:30:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232131AbhEaUaV (ORCPT ); Mon, 31 May 2021 16:30:21 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEA54C061763; Mon, 31 May 2021 13:28:41 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from ) id 1lnoWd-000F0y-Nt; Mon, 31 May 2021 22:28:39 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: stable@vger.kernel.org, Johannes Berg Subject: [PATCH v4.4 05/10] mac80211: drop A-MSDUs on old ciphers Date: Mon, 31 May 2021 22:28:29 +0200 Message-Id: <20210531202834.179810-6-johannes@sipsolutions.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531202834.179810-1-johannes@sipsolutions.net> References: <20210531202834.179810-1-johannes@sipsolutions.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg commit 270032a2a9c4535799736142e1e7c413ca7b836e upstream. With old ciphers (WEP and TKIP) we shouldn't be using A-MSDUs since A-MSDUs are only supported if we know that they are, and the only practical way for that is HT support which doesn't support old ciphers. However, we would normally accept them anyway. Since we check the MMIC before deaggregating A-MSDUs, and the A-MSDU bit in the QoS header is not protected in TKIP (or WEP), this enables attacks similar to CVE-2020-24588. To prevent that, drop A-MSDUs completely with old ciphers. Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20210511200110.076543300172.I548e6e71f1ee9cad4b9a37bf212ae7db723587aa@changeid Signed-off-by: Johannes Berg --- net/mac80211/rx.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 85d7ac83d847..23c1e6529900 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -2264,6 +2264,23 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx) if (skb_linearize(skb)) return RX_DROP_UNUSABLE; + if (rx->key) { + /* + * We should not receive A-MSDUs on pre-HT connections, + * and HT connections cannot use old ciphers. Thus drop + * them, as in those cases we couldn't even have SPP + * A-MSDUs or such. + */ + switch (rx->key->conf.cipher) { + case WLAN_CIPHER_SUITE_WEP40: + case WLAN_CIPHER_SUITE_WEP104: + case WLAN_CIPHER_SUITE_TKIP: + return RX_DROP_UNUSABLE; + default: + break; + } + } + ieee80211_amsdu_to_8023s(skb, &frame_list, dev->dev_addr, rx->sdata->vif.type, rx->local->hw.extra_tx_headroom, true); -- 2.31.1