From patchwork Mon Jul 12 19:53:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 12372137 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FC87C07E99 for ; Mon, 12 Jul 2021 19:53:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E5A961279 for ; Mon, 12 Jul 2021 19:53:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233686AbhGLT4d (ORCPT ); Mon, 12 Jul 2021 15:56:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233182AbhGLT4d (ORCPT ); Mon, 12 Jul 2021 15:56:33 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00705C0613DD for ; Mon, 12 Jul 2021 12:53:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=L9yzJbOkUoG3OPTnghxBDJO1uipunb8Z7Cf8ziV+o0I=; t=1626119625; x=1627329225; b=uT0Me1yf1gcKpem/4PlO3C6KKLT906Udlc8Hw1cgQqxeRC79uEXdR0UYWcG/jZfdHJWCIsFY91z AlffiBzngDdGOuBBjWU8EnnRcHPEybfK6SP7PSUnhxb9PzhITpn0uD5DkYavXBUiUJ9/upW/kmm24 BJAUpGYc9Ky5LMm9zL8rYJiIw09mn5/EeUkalIkQScAgey9ioOXg5B5WMeIwMn1beZBCN1+dHRFH5 W4JNYJhU0GkQa8pwDIZyIjwNOrUsZ72sFoMo06u92+S2gJBeZaq6Dpxikkeb/1uAL9wEzGIJd5iCD tuGgHQp3XKxOIYW/iqweWdrvL8ibcQZJw10g==; 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 1m31zk-001U88-JD; Mon, 12 Jul 2021 21:53:36 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH] nl80211: limit band information in non-split data Date: Mon, 12 Jul 2021 21:53:30 +0200 Message-Id: <20210712215329.31444162a2c2.I5555312e4a074c84f8b4e7ad79dc4d1fbfc5126c@changeid> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg In non-split data, we shouldn't be adding S1G and 6 GHz data (or future bands) since we're really close to the 4k message size limit. Remove those bands, any modern userspace that can use S1G or 6 GHz should already be using split dumps, and if not then it needs to update. Signed-off-by: Johannes Berg Reported-by: kernel test robot --- net/wireless/nl80211.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 50eb405b0690..395a233eb612 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -2351,7 +2351,10 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, goto nla_put_failure; for (band = state->band_start; - band < NUM_NL80211_BANDS; band++) { + band < state->split ? + NUM_NL80211_BANDS : + NL80211_BAND_60GHZ + 1; + band++) { struct ieee80211_supported_band *sband; /* omit higher bands for ancient software */