From patchwork Mon Dec 11 07:05:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Korenblit, Miriam Rachel" X-Patchwork-Id: 13486400 X-Patchwork-Delegate: johannes@sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hu6wZOUQ" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8F3AA6 for ; Sun, 10 Dec 2023 05:06:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702213585; x=1733749585; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sUvLvHSGpTg2W+vBKYZ+WCNKupVSygatMl/3Rwexo9I=; b=hu6wZOUQfe/aJF9rVTjKLbYODQlsptGKls9yNhV4Ij5ZzTkCRxW9rF4N 2oHL9ivbM54WAwVCesGEMh7ly5zss740U0EP9z/W6vgrAwkIfVl5QZLpU bxT2nCCE//7ajpxQEwxagJEtot4EzkTF/kq2Y04vss+od5776c9dHh1kD 3MlI/yR1VKOkn8U5xDzFURUyoxVcplwN/pqseNuu5uV3UXhj8kaeRx+CX MySt03fZvaf+uRB3uYR2vBTr7tWFkF0nI4JCjzCp3jrujh7hFYcy2zibV lWgbXIlBGc4/5eqwwmHKhyhK8wl0QILvNWkTAj9mkm0vTOphtb++NvlCr Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10919"; a="480746104" X-IronPort-AV: E=Sophos;i="6.04,265,1695711600"; d="scan'208";a="480746104" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2023 05:06:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10919"; a="748926307" X-IronPort-AV: E=Sophos;i="6.04,265,1695711600"; d="scan'208";a="748926307" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2023 05:06:23 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Benjamin Berg , Berg, Johannes Subject: [PATCH 10/14] wifi: cfg80211: consume both probe response and beacon IEs Date: Mon, 11 Dec 2023 09:05:28 +0200 Message-Id: <20231211085121.07a88656d7df.I0fe9fc599382de0eccf96455617e377d9c231966@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231211070532.2458539-1-miriam.rachel.korenblit@intel.com> References: <20231211070532.2458539-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited From: Benjamin Berg When doing a channel switch, cfg80211_update_known_bss may be called with a BSS where both proberesp_ies and beacon_ies is set. If that happens, both need to be consumed. Signed-off-by: Benjamin Berg Reviewed-by: Berg, Johannes Signed-off-by: Miri Korenblit --- net/wireless/scan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 3e3ba0ddb83e..3d260c99c348 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -1749,7 +1749,9 @@ cfg80211_update_known_bss(struct cfg80211_registered_device *rdev, new->pub.proberesp_ies); if (old) kfree_rcu((struct cfg80211_bss_ies *)old, rcu_head); - } else if (rcu_access_pointer(new->pub.beacon_ies)) { + } + + if (rcu_access_pointer(new->pub.beacon_ies)) { const struct cfg80211_bss_ies *old; if (known->pub.hidden_beacon_bss &&