Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1405938ybl; Wed, 28 Aug 2019 14:17:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqyH4J6n1YPUbmAhN6Kp1u8RT4lhcXqnxIWBAMJRfMYxiuYAqYnQPEmHenNz8v7uYgKMIE9C X-Received: by 2002:a63:4562:: with SMTP id u34mr5110543pgk.288.1567027027394; Wed, 28 Aug 2019 14:17:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567027027; cv=none; d=google.com; s=arc-20160816; b=RcES+NL1Rk6LCRaxrvbvqh9lGKGV+mLIm+gP6MxnzcB9wnyHdzp1f2MNC+QjhmLw/H 9SIPwiiwkYN9fp8vcsrsXDNobli8O5sk4ler4b6tXw0nSYf2GMlvswO1XZOuAfDz+1hS /voGT20LKLNqGjO8kb5QsbzTTK1DH96l81SZbaaXvx+gKkUAHQruJrB9W9P6UdzotSID qSTFWXaZMov+XZ3fQsT1OqHPHvOTgw2wsG+ca+pVuMcvhoIi7vyqIhyePjsPrrquxjmZ TxOVRdxxcaBLVjFVslceNPTdvI+UDLIU7oifFCbfnVoam9Z18wklnfmtkilFOSYwsLj2 RTxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=UZ8/awWTq6cNNlpOfMcpLe0hFlviAxwzUTQVPhW35AY=; b=PoXjioX1s4Ld8X3cAZLh9Rv+RYrBk6AdT4a7sFaMl0eTog3vXneTJ1UjS7NPRHuNJx AKOSacrkr6lmp6Hbet8t4Ro3307fKV+iILlGfog3GtFXnIYH40Oem63Y71oJzMx35zmW tCUdmLdh+yrgnu/h8BA6fhVflMyJuXTwV8EOkd+y42ixVAkLN5x5lysFcYzeh+K9uidu uFqmbGOvG7p5XBZsOcDlNv+lqZyfkmFu9mu8R16SsBxF75OJkAnjoYKDjz0gblq/iOwQ Y4gzW+7UJ6BaSDrH7pZatEYLQ+bvXrBR3s1DKcoEYmm4j7gwcllRpQz6F9LrtwdakRne ZDDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FLDmMYK8; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a24si388240pfl.15.2019.08.28.14.16.41; Wed, 28 Aug 2019 14:17:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FLDmMYK8; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726725AbfH1VQe (ORCPT + 99 others); Wed, 28 Aug 2019 17:16:34 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:45109 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726400AbfH1VQe (ORCPT ); Wed, 28 Aug 2019 17:16:34 -0400 Received: by mail-oi1-f195.google.com with SMTP id v12so839626oic.12; Wed, 28 Aug 2019 14:16:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UZ8/awWTq6cNNlpOfMcpLe0hFlviAxwzUTQVPhW35AY=; b=FLDmMYK8Nomgd5BV8aX5uue5BsU/74nkB8cA+cc+SkvzJJS1K9MBCFcaW4LuVk+jAi zqwkgV6oDoNCnXhdtfKlOym14TsZK5ZyRMcJCdbXNrXjbxRzgTC+JyUNmB6gXk66EBTB p46Hu+U/aAefSS23vwIZJEUlgYUL2I9nqP/gU+vZ3bOJ4umkTQ4fjAc2aPtucT+IcqCu wgN+pKA3ntLHP7x//HrCawf0IerRBuwxnWn2qdeRG5i0ySh/kGVfpZcOk5W8MYzbSvoO Gw4qrCHYKOz9Rq0+3a+ZbkiFuAVgAE4v+HfXPL/7OAoGpbD3MF5Wgy8+FLuPZjjIJ1sg ZjXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UZ8/awWTq6cNNlpOfMcpLe0hFlviAxwzUTQVPhW35AY=; b=OicbXZh9NvebxEiUz9kmHUXeHsh4ZfIwCFEu+DmtjX/oY+ZJfeo6KY3mSodb5bMmSX HlPlGYnXqXyaOmlAxbLGEN52eYgkUA7TWft+puXNpJiiX3C/dZPw6KNaDsvJYJYkfLud mc124szUJ2VZnJRhcU5gQnXE6EpQyZ63JHSiI7jKoyQVua32UyLeb0Vz/hd5wg2tzAyc kKcPoNTgfFWQPcWDZt6BWIGIEY2Nxs8ZzO7wcULSSl4fQHjjVKcyUnEqsFGpliIYIedC qir5p5yF5tqiegUQrKmyTkXSwaI2ESru07s9GvPXWVobvCKl6UVGHWhcI+hp15V4TLxm mXYg== X-Gm-Message-State: APjAAAWA5SJ9UONiC8i4B16LnaGmCrYAAKZ8bfzDGvzl6nG0MAUvpRZy HeYJ1YINmrwX5x2CHRgZJ/yEvXvR X-Received: by 2002:a54:4814:: with SMTP id j20mr4139687oij.33.1567026993118; Wed, 28 Aug 2019 14:16:33 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id z26sm85608oih.16.2019.08.28.14.16.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Aug 2019 14:16:32 -0700 (PDT) From: Denis Kenzior To: linux-wireless@vger.kernel.org Cc: Denis Kenzior , stable@vger.kernel.org Subject: [PATCH] cfg80211: Purge frame registrations on iftype change Date: Wed, 28 Aug 2019 16:11:10 -0500 Message-Id: <20190828211110.15005-1-denkenz@gmail.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Currently frame registrations are not purged, even when changing the interface type. This can lead to potentially weird / dangerous situations where frames possibly not relevant to a given interface type remain registered and mgmt_frame_register is not called for the no-longer-relevant frame types. The kernel currently relies on userspace apps to actually purge the registrations themselves, e.g. by closing the nl80211 socket associated with those frames. However, this requires multiple nl80211 sockets to be open by the userspace app, and for userspace to be aware of all state changes. This is not something that the kernel should rely on. This commit adds a call to cfg80211_mlme_purge_registrations() to forcefully remove any registrations left over prior to switching the iftype. Cc: stable@vger.kernel.org Signed-off-by: Denis Kenzior --- net/wireless/util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/wireless/util.c b/net/wireless/util.c index c99939067bb0..3fa092b78e62 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -964,6 +964,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev, } cfg80211_process_rdev_events(rdev); + cfg80211_mlme_purge_registrations(dev->ieee80211_ptr); } err = rdev_change_virtual_intf(rdev, dev, ntype, params); -- 2.19.2