Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3751566pxj; Tue, 11 May 2021 11:04:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywi+NZlFs3x2neqxfweSY6ehd9oqZjEkvmXSE57/96bgeub8HM0umTYYLDk97EFg+3SewE X-Received: by 2002:a19:6901:: with SMTP id e1mr20955292lfc.642.1620756248041; Tue, 11 May 2021 11:04:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620756248; cv=none; d=google.com; s=arc-20160816; b=Dqo4Cu1Eck7c4MnG1tYSr3LBJvgyT4aqfMdPqlcB1wbgFTbUXbwAv0nSSB4HJTo1ij YfaeWbjSJoz8s2lrKeLqYsHT4BJq9l8v9rcMKg5MceU/6Ybrk902KpjebQECaIZBw/E4 0fAgIofUlrNZyc/wDdq+t22R6WEBEg9Dj7bjQNu4AWbVtE52vukVL/voZ7YYLOl0bziz lYVVXGKGm22sicV3n4gXzUS00FEgsVEo0lgTIY9DJODS6Gi3BRwnKEbrG59yvgUGLGxn 0urlRwctKXOB/238OSOMzjsPP3j9fcKo2w/ZG+gVfL5KF80rl3SrZCyM+VbrCVUwGVZ8 j4dQ== 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=5WaLsLOUgnF3xLkbwPw0cVbeBHu8PGomtuB8UVaOmIM=; b=wI+7lBkg16vx0oAgjYM03Fumb6KdnpmaV3/dVmf70RSA9aO+z9j0b2Gf8IjDrolmeC ZdC/8G0sCizoWDSCN5REReqldkHDF1TP0GG9sh1iB+qBTSEgt5xrOuflJe1effQe6blr 0+n4N5yYisok37EBWnJCF9WynMB0Zcbo4zjTOCJCv9yZYrIAlu7mxwosTxFll8V1DbCv amFKAUhRB85sYoQnrFG3hZG6nr/JfiNQ+4uUgg7UPtaVuOwhr2mXV1/iroUro86hcQta kWXDjuisMH7tZlikcGHmJJapc5kKPK0D+6MJNK7MjPQIcWDt0Dmsdb7H6iGTecdBidEb pyzw== 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 w17si20872571lfr.31.2021.05.11.11.03.37; Tue, 11 May 2021 11:04:08 -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 S231949AbhEKSE0 (ORCPT + 99 others); Tue, 11 May 2021 14:04:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231777AbhEKSEW (ORCPT ); Tue, 11 May 2021 14:04:22 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 188E5C061763; Tue, 11 May 2021 11:03:12 -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 1lgWir-007aAS-S1; Tue, 11 May 2021 20:03:09 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg , stable@vger.kernel.org Subject: [PATCH 05/18] mac80211: drop A-MSDUs on old ciphers Date: Tue, 11 May 2021 20:02:46 +0200 Message-Id: <20210511200110.076543300172.I548e6e71f1ee9cad4b9a37bf212ae7db723587aa@changeid> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210511180259.159598-1-johannes@sipsolutions.net> References: <20210511180259.159598-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 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 Signed-off-by: Johannes Berg --- net/mac80211/rx.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index f14d32a5001d..8a72d48ad6e0 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -6,7 +6,7 @@ * Copyright 2007-2010 Johannes Berg * Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright(c) 2015 - 2017 Intel Deutschland GmbH - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2021 Intel Corporation */ #include @@ -2739,6 +2739,23 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx) if (is_multicast_ether_addr(hdr->addr1)) 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; + } + } + return __ieee80211_rx_h_amsdu(rx, 0); } -- 2.30.2