Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp575793rdb; Mon, 29 Jan 2024 10:57:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IGmdKFH+I2SCxKUKY4uXiFbhW3Djc3jZ1JHgwGzszvKF9tbR01LaM8UYyM/HyFFXttk3HkZ X-Received: by 2002:a17:906:150c:b0:a35:3152:c46b with SMTP id b12-20020a170906150c00b00a353152c46bmr4604309ejd.60.1706554671676; Mon, 29 Jan 2024 10:57:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706554671; cv=pass; d=google.com; s=arc-20160816; b=xZT3huckjaPUWfL4VJz0NKCdJF0rvzThOMbJRLJlZHvF6rJDBlA6izuuzBBlNyaHbw /IMAmqKONuwwhSquDfODc2AN6Co4QxXXA2FEHjvIxIdCn2TP6euxDueQ4/CkZ1VZgqsO lCedbrCxU10Wcjz6uKHBc20inWzW5L3BP9cJnEuv8bY7pEPWxhCNM5SSBZvYXD/t7/rd Od5bHhdfnmV9mLIlS3n6zV/Jhc+ZwIRMy4+AfNcJCF7p7OfktDYwT3mPinfyXrIBPrO6 sOjj66qs8tL37+ZKX0GxHew4Ka/xoHXyKqi9MrwHw+EFWmCxEEsQijk1ibBs1yb0Kx4q VeZg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=gHmm+L/NtYoI6llvdohEa2VSDLteuz/GJ6OK5SJXHro=; fh=lcjesn6inaGHAaAtuYSHbV6P5uMxadz0W1tpi1F9TgU=; b=wDSPRweH5u7Wwui+1Qq3byKN6UCS2J8/FAVu/HgjfwX8kWm/5lcPvjZG+RcnqJgmcQ mCgGB6MwmL6CdkI3RzDQrjWzazGMSEn5JOlVbpfDfQh9oYwtZA8UzEIofplmyFENts20 C6ZPesFvSVOr0G1wzXzubhaHSiNA2P9yXl6JyeIR0vnbkbgRgWCsSXcarV6cBfdc4uPu wuqPykXKu40DUhu80DbBAMDPcQKqHfOeipCqIlCNo+HWYr172qwXeuO83/9tc3NrlVgf svbcPJ5jwrXggn2NLNEbqfy8o/xwNWYMTRGvhhBN8G253xGpqJlw0YpPCjC1WR+XZd0n JNeg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=KYAOVvMP; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2699-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2699-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net X-Forwarded-Encrypted: i=1; AJvYcCWJsl7Jq0Iodv4cBGJj/V0aondBHPrSvGZM0A2GA0ST2IhnsbW72lDo+bK86xfkCBbrQ39byNLauMbZ3aOMxxHkXQuvk3sqBe5dxChD3A== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id p18-20020a17090635d200b00a35a618ef4dsi1369729ejb.754.2024.01.29.10.57.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 10:57:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2699-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=KYAOVvMP; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2699-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2699-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6ECFD1F2332B for ; Mon, 29 Jan 2024 18:57:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F6DD4205B; Mon, 29 Jan 2024 18:57:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="KYAOVvMP" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 781742E858 for ; Mon, 29 Jan 2024 18:57:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706554657; cv=none; b=W2DSaB0opBzIZsXIWZcS9jheIda7VAzkFf1o2gn15GTO46k2EbKRxxlB/7VZB5JOKcqMHzuxfoCDCyuCbaNnoZcIJkX9RLCqoHMnORDi7aLsDOjxf4AxmLU8Mo1VcCEey8c/ER1SlIkGyjqyoP7u3CesHkNlQKN7Z6mWD4xB4Lo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706554657; c=relaxed/simple; bh=mAyj1AnNstZWlAxNnE5am/IrIUiVpnWniUBuAWVylsg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qBrfUxe0VTs12+TiHPJJ0HiBddAsNoz0SloUim+2GcpytP8uYalr6hBWR8W7fqLhZmvF/a2aMfxFrHvLgzFZMV04Soz/1+wgzwSr5qgXujRSARQ58v36jOHjvAuJ57u5iDahirMW7NuE2FVf0J68EU5MkSNJnG6kbqTHH/Y0M3I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=KYAOVvMP; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net 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=gHmm+L/NtYoI6llvdohEa2VSDLteuz/GJ6OK5SJXHro=; t=1706554655; x=1707764255; b=KYAOVvMP9mWQd8Va5Zg4Z0OBFnErlkXG3SyM8AjFkbiGs6rsfleNvn5ZOVFs1/XLTlfN29fJ6yP 84BTBWN5CVjHxDTY3z7/nGqTB1Y4PlIqc82X4KnEkF3/At87tM1CF7WW/diuUeGdEHS20f7hWvEen cP16HXyIUC1t+KOcxFSfLruX80n1/hs2RDOHcNPDG7Q+YY/euc4kpdMq/UamEVzfVS7pTnuxmYiR/ 1+wN8w2BA1Nv8EHvG0kywqnLS+aXU+jpxRS77XZVsOzdWv1juRnZFhRd6kq5AW8/ckp1V+eGcQcsM 9+bKbaxy8TRgKFjhYpVdJc1Knh4x3r2GVhig==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rUWp2-00000004zqv-0QWR; Mon, 29 Jan 2024 19:57:32 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH] wifi: mac80211: fix unsolicited broadcast probe config Date: Mon, 29 Jan 2024 19:57:30 +0100 Message-ID: <20240129195729.965b0740bf80.I6bc6f5236863f686c17d689be541b1dd2633c417@changeid> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Johannes Berg There's a bug in ieee80211_set_unsol_bcast_probe_resp(), it tries to return BSS_CHANGED_UNSOL_BCAST_PROBE_RESP (which has the value 1<<31) in an int, which makes it negative and considered an error. Fix this by passing the changed flags to set separately. Fixes: 3b1c256eb4ae ("wifi: mac80211: fixes in FILS discovery updates") Signed-off-by: Johannes Berg --- net/mac80211/cfg.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 321698012e12..327682995c92 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -5,7 +5,7 @@ * Copyright 2006-2010 Johannes Berg * Copyright 2013-2015 Intel Mobile Communications GmbH * Copyright (C) 2015-2017 Intel Deutschland GmbH - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation */ #include @@ -987,7 +987,8 @@ static int ieee80211_set_unsol_bcast_probe_resp(struct ieee80211_sub_if_data *sdata, struct cfg80211_unsol_bcast_probe_resp *params, struct ieee80211_link_data *link, - struct ieee80211_bss_conf *link_conf) + struct ieee80211_bss_conf *link_conf, + u64 *changed) { struct unsol_bcast_probe_resp_data *new, *old = NULL; @@ -1011,7 +1012,8 @@ ieee80211_set_unsol_bcast_probe_resp(struct ieee80211_sub_if_data *sdata, RCU_INIT_POINTER(link->u.ap.unsol_bcast_probe_resp, NULL); } - return BSS_CHANGED_UNSOL_BCAST_PROBE_RESP; + *changed |= BSS_CHANGED_UNSOL_BCAST_PROBE_RESP; + return 0; } static int ieee80211_set_ftm_responder_params( @@ -1450,10 +1452,9 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, err = ieee80211_set_unsol_bcast_probe_resp(sdata, ¶ms->unsol_bcast_probe_resp, - link, link_conf); + link, link_conf, &changed); if (err < 0) goto error; - changed |= err; err = drv_start_ap(sdata->local, sdata, link_conf); if (err) { @@ -1525,10 +1526,9 @@ static int ieee80211_change_beacon(struct wiphy *wiphy, struct net_device *dev, err = ieee80211_set_unsol_bcast_probe_resp(sdata, ¶ms->unsol_bcast_probe_resp, - link, link_conf); + link, link_conf, &changed); if (err < 0) return err; - changed |= err; if (beacon->he_bss_color_valid && beacon->he_bss_color.enabled != link_conf->he_bss_color.enabled) { -- 2.43.0