Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2688184pxj; Mon, 31 May 2021 08:17:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRx8jECRhmCgzj+lPEe62t2PgfHeck85Uo83WRRaQjgICFCUwU2BSb0da5p/xUOjrJ1f6Q X-Received: by 2002:a17:906:d7a8:: with SMTP id pk8mr23949914ejb.74.1622474227845; Mon, 31 May 2021 08:17:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622474227; cv=none; d=google.com; s=arc-20160816; b=IvQYYU6yrWv4SBPCadsG+zXfVHowQAvNj1i8UN4/Jjv+ZBnfpm/rPQyeX/p8zOgkz/ a2TUBqHB7D4mdnViz6j2LCqSDCV0okOF1UG9H8bhBwV8IIAMmNmRV8Veqpfb1vpGFKde PYqq1cWS48B6jEQIzLdBT0S8xbsfbkz5/ls1A9AvfMQawyk5o/z10u/9GXXnK9svPNat F7n2EtTdpHV6EhIr4S67kNcCmEQABl7lkmOR8a29pL5PB2SFm1qzjAXomJbBq+kO9NNK I3gFckJGlCFwdx1iRNdl4sRfmufYil3v3vK1iIAWIXfl7S5rv3/ChmxncqGclnk6+S9u FsXA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=o1ogKTwrX0303AmEbalKRXyBI6WH4vFCqfkeNYNystE=; b=hYFYRJrz3PfLWnSossUhd/auC+PCQUWm3CGwYcK2y8s3plHdlwRt3erGSnhvIxaLi9 blZmenWsBy3Ugoo0zTvKt5AhputsaHpsyGWdZk1JU18D7gouldLYuBapxm7LBNvZDfLF ln4qmLQUJ795lezEnWle3biRE09wKeVTW9qouKbE33oTs1GTgDNWguWXXbTEsp7/zD8I uoT3RS0SHbOYUrH299ZpOuwY4dMVI/J68tmofqIft30QZBVFR+6lLyiQ+xqXdGDeoG7V lDPPEcr6STYa3jbZplUKFrRPgCkGJX880kyoapyZ9t/Yd6EZten06eXzpu0avEJ/0Mni PCSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RbRP3Bnm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb35si12286025ejc.209.2021.05.31.08.16.44; Mon, 31 May 2021 08:17:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RbRP3Bnm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233429AbhEaPRK (ORCPT + 99 others); Mon, 31 May 2021 11:17:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:41002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233476AbhEaONF (ORCPT ); Mon, 31 May 2021 10:13:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 43E276198F; Mon, 31 May 2021 13:41:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468512; bh=+VOiRXbyYv3Fjv/OVMeA7XGf5WEvEaeuR3EVG5vmmNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RbRP3BnmGnL8+nytNN8DI7ywfU/QQ5fgBOGLKtQ6nP93Hyr6ZVJ4SIiBgl0LqFVLm SEzYXWwgIo5Ghi7QTF4kFrjFVLlMH78HBAR6YA2SAcICmT9Ke3KmNSG6raWD6Ys4by vLsaHOz+i7ZJtJehlEzjCWAorpiD8ZdD5rBUf2xU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Berg Subject: [PATCH 5.4 018/177] mac80211: drop A-MSDUs on old ciphers Date: Mon, 31 May 2021 15:12:55 +0200 Message-Id: <20210531130648.547327071@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 Signed-off-by: Greg Kroah-Hartman --- net/mac80211/rx.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) --- 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-2019 Intel Corporation + * Copyright (C) 2018-2021 Intel Corporation */ #include @@ -2691,6 +2691,23 @@ ieee80211_rx_h_amsdu(struct ieee80211_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); }