Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1540399pxb; Thu, 16 Sep 2021 09:31:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1dIDyippMhdAZ2xUS7UaxwEJEwk4lVW3arHp1AYiOW3pn36K7zHKyJQUKsB0d3IgRDbNj X-Received: by 2002:a02:2712:: with SMTP id g18mr5011660jaa.115.1631809808565; Thu, 16 Sep 2021 09:30:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631809808; cv=none; d=google.com; s=arc-20160816; b=J6J3FnYdj/erkK67FUTBy457ET35cOJoHV9v57W7CvIy1VCul2ltiAkIjkjCr/fU04 hmpevr6I71Its644jybCDXjg7IBS0QMYMMG09L0TUCI1nXu+Fe4kfb7bNbOd7f/jVc0q kOnPGTuW32qJTjob6c3QdOIKutWQie6xeR3YCzx8VAryhefl2r0Ag+ASUQMVrZ9bwqCg tCgrcoZPQRYf8NVMvBhl1tZKq2Ibx6OeNbozoN2QkNeejv5rZk1U6XDn0gOlx0mecyTl 9EosUf7439YKTY0maZpxvDjqUekEk3mqC47+/ayyTQ5wk5j2mDBC2mGK3MxbYYLtEqhw qUEg== 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=15VSgtA3DssMWaGn9zod2YyltE+VJu6ie2E3REq7D0g=; b=wCUkhh8UuDsMpgEzmqA/Od2Gf0UChg9mLgauTYZJ7UN1ZTM6vdLs97oVbfRGFGsNXZ VIr+4rPpHNgjEKGHg3MOig4zyJm0oSTFeo9dXAgj6wlsBOAgGCwdTlZ2JfPK4Fl3YitO IvMnnvf3h/y0LziLDZDBlVpZ81hJjMLeNqkX+iT6aD9qCV7HAWuTBN8aPVU7y1vDtmFP YThTThiap7XvnixOtsP2zksZYSKsBTFH1Rw0YW5dq/r7phS54HQXesdyoBe5UCeVFv8k ZXg8oYi3HPXL4zsnpJsKCTehrZAT5Z469q7+w4UEW+J7jGPy3kgMkXa79GRK25HSdc6G ERPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=m89ZXVvF; 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 n10si2846163jaf.0.2021.09.16.09.29.56; Thu, 16 Sep 2021 09:30:08 -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=m89ZXVvF; 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 S242648AbhIPQ3Y (ORCPT + 99 others); Thu, 16 Sep 2021 12:29:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:59300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241713AbhIPQUC (ORCPT ); Thu, 16 Sep 2021 12:20:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B754361246; Thu, 16 Sep 2021 16:14:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808850; bh=5Tmo5EoUoUNPILBlPgR5l9L/1NDvicyyvoVo8uwBhKQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m89ZXVvF+pXpuXesv2Fcz7Ydf2Xyiks1+PhOdSBOdjqRsraHdc6RT+2S/NoUPkJkv dt00/ppFVQOHS9TC3N0BEV4nB+KTZC0idTl6K+XNxhnoGbkr8qoix4Tq8ktHiG0qBh 9boZmtA1GlodRG0czFoWqdI7F3Pg74FeHGUPrrn4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Almbladh , Johannes Berg , Sasha Levin Subject: [PATCH 5.10 213/306] mac80211: Fix monitor MTU limit so that A-MSDUs get through Date: Thu, 16 Sep 2021 17:59:18 +0200 Message-Id: <20210916155801.301283700@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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: Johan Almbladh [ Upstream commit 79f5962baea74ce1cd4e5949598944bff854b166 ] The maximum MTU was set to 2304, which is the maximum MSDU size. While this is valid for normal WLAN interfaces, it is too low for monitor interfaces. A monitor interface may receive and inject MPDU frames, and the maximum MPDU frame size is larger than 2304. The MPDU may also contain an A-MSDU frame, in which case the size may be much larger than the MTU limit. Since the maximum size of an A-MSDU depends on the PHY mode of the transmitting STA, it is not possible to set an exact MTU limit for a monitor interface. Now the maximum MTU for a monitor interface is unrestricted. Signed-off-by: Johan Almbladh Link: https://lore.kernel.org/r/20210628123246.2070558-1-johan.almbladh@anyfinetworks.com Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/iface.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 30589b4c09da..3a15ef8dd322 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -2000,9 +2000,16 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, netdev_set_default_ethtool_ops(ndev, &ieee80211_ethtool_ops); - /* MTU range: 256 - 2304 */ + /* MTU range is normally 256 - 2304, where the upper limit is + * the maximum MSDU size. Monitor interfaces send and receive + * MPDU and A-MSDU frames which may be much larger so we do + * not impose an upper limit in that case. + */ ndev->min_mtu = 256; - ndev->max_mtu = local->hw.max_mtu; + if (type == NL80211_IFTYPE_MONITOR) + ndev->max_mtu = 0; + else + ndev->max_mtu = local->hw.max_mtu; ret = register_netdevice(ndev); if (ret) { -- 2.30.2