Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp264813pxx; Wed, 28 Oct 2020 04:29:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxImscN5NAG5kGOWGgy1U4gC878v9s9UisL7y01CSA6FUR+mhRVeoohX6v1CR7zqDxo1l8B X-Received: by 2002:a05:6402:293:: with SMTP id l19mr7255129edv.227.1603884561050; Wed, 28 Oct 2020 04:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603884561; cv=none; d=google.com; s=arc-20160816; b=GcaJUCAhE02E9VungzOdLRZqGngBCu7CrSvgr10APAvXwS+7xnIgfMw8m6MNm49aiF 5Fx4vsBQSiidbZPZ/PYLwDwUpdwq+wixhmfaMSfEVSU9DjpvlZvYnkJDetUa0G763tDj ralGSVtKqKVK5NBQnPaMv4adrVjS0tm1LzdrVNzCprlNuIJ1VDhg1qri28pSkcUi0vmR mDqVS7Bhf41daIaojZpbSIfQDVhnnJALalIFnJala35r5tHnZf9phAOn9Hd7TBPAMhjs PBt7A1gucdZY0BPu+e7BHzZK9C3IE/vf4WPLgRpj79X6SDzLnw9BlpuPWp/gkDJblOmO Kw0w== 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=8vIQ4EXv9jKXpFkqmE/7+xysxQr/aaVpu8qAUclTbQ4=; b=j1OhflaNGvjrMXc2IVvJlMC3Mr+oiS53gHVYbOA8oh6mx6S53xvWRhG9Ps0fRzJR3k eHNZZLaAza7yeT9/Lq3PgJaLQpHBRm6p105+c2DVEl+jyYcVi5N514UMvKVmqefcWo0H r3EHXzV5zS94eo7doVIFqR3/QWJ4scxhvlev8nlAcTvVtnq2WpH4Oh19ciaywgJd9wdO B2foW1PgazSfBkHoK2xC58z7XcsRunOayUmF0RxmGng/3gNf2vvLq9kcmXnBVkCSQp23 6ab9Xvlp6y6AkHexQF8sFi95lWNfFDp7te2ya8ssE+0YgxzOjjoyYRcrIfozgETL8l5o dnXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iczDljgB; 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=fail (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 p19si2741759edu.169.2020.10.28.04.28.58; Wed, 28 Oct 2020 04:29:21 -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=@kernel.org header.s=default header.b=iczDljgB; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1790440AbgJ0PEd (ORCPT + 99 others); Tue, 27 Oct 2020 11:04:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:35620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1789198AbgJ0PBm (ORCPT ); Tue, 27 Oct 2020 11:01:42 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 853B020715; Tue, 27 Oct 2020 15:01:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810900; bh=6qYIEown5iXZtI6ThJkmi6PORhf8GcZAiktFz9c5daw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iczDljgBiDkdQStBvp0gaAsz82yWW3F+CpqHn9ksrfBSWeHcYlFEwIy63jmKo0qa0 KkM5arE3pjxdl+whg41tgpght87sCcK4VsClEloA5SE5UnTuWE/A5XpWEw+PkTxxSP JWDWhKx342g7JxzjeihRMC4pE9xVPIaYWFdpeM08= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Berg , Sasha Levin Subject: [PATCH 5.8 302/633] nl80211: fix non-split wiphy information Date: Tue, 27 Oct 2020 14:50:45 +0100 Message-Id: <20201027135536.836609551@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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 [ Upstream commit ab10c22bc3b2024f0c9eafa463899a071eac8d97 ] When dumping wiphy information, we try to split the data into many submessages, but for old userspace we still support the old mode where this doesn't happen. However, in this case we were not resetting our state correctly and dumping multiple messages for each wiphy, which would have broken such older userspace. This was broken pretty much immediately afterwards because it only worked in the original commit where non-split dumps didn't have any more data than split dumps... Fixes: fe1abafd942f ("nl80211: re-add channel width and extended capa advertising") Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20200928130717.3e6d9c6bada2.Ie0f151a8d0d00a8e1e18f6a8c9244dd02496af67@changeid Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- 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 7cbb94b4d4917..47ab86ee192ac 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -2355,7 +2355,10 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev, * case we'll continue with more data in the next round, * but break unconditionally so unsplit data stops here. */ - state->split_start++; + if (state->split) + state->split_start++; + else + state->split_start = 0; break; case 9: if (rdev->wiphy.extended_capabilities && -- 2.25.1