Message ID | 20240809181034.1539857-1-jintaolin@chromium.org |
---|---|
State | Accepted |
Headers | show
Return-Path: <hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=d5xJLGk+; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=LA6RbsJx; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WgX6j2dG9z1ybS for <incoming@patchwork.ozlabs.org>; Sat, 10 Aug 2024 04:11:41 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=a5UvX8aWjcCs4udf3JRu2zjjuZ9JJfVGu9vNa9ZbrUE=; b=d5xJLGk+tRysTs uKPjraJQD/aZZPbJfDfhf7iJr4hozvCm4xbNkJ8jYy79mo9ILFPfUaBo6GXqNm0iuBPB3gCdaB76R zDYBuLilq6F47Yv1sxDDVy2A9IzgGYas9LwX0oONYgBcFL5xFtj207EMchzW9m/TqK2ZA/Q1dTugo ahtYHASRZL2w9tQLIYy0WE/E5sbu23pYBCkGCeIbYKPD5EMhFRe+y0kCaduaX83iLgc6SuLWG7YDS xquAxDskBHZJhiZ9DoQlwMuQXz+vl6RzQepLSvhErMFz+sNMwdX32U1jw++3A702jIv8g6p9a6q5h KLyybc+7A20L2N2mkVmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scU4y-0000000CARY-1TQm; Fri, 09 Aug 2024 18:11:08 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scU4r-0000000CAP9-49Em for hostap@lists.infradead.org; Fri, 09 Aug 2024 18:11:05 +0000 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-70d2b921cdfso2108658b3a.0 for <hostap@lists.infradead.org>; Fri, 09 Aug 2024 11:11:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723227059; x=1723831859; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=8LfBW7j7e8ZeESEDnU5yrrgxp8RTH8wlh8ZVpVpjrMU=; b=LA6RbsJx5AZSA7Iz4ggYRnHucrTX3RYZ1dnOrAXqrPvx+AMqkouEsv+IOQthtYZmbV BSe29QV5XMj8Sgacp5/SvsfcZQatBwiK1BxeMkUpDKumMPaiJ0eDF8AldXF630+FR2za jrT+foYgymDTrRp3WrTvMhaVTp0WCx6ZraNSE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723227059; x=1723831859; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8LfBW7j7e8ZeESEDnU5yrrgxp8RTH8wlh8ZVpVpjrMU=; b=aGURhCX8e7iLGj3uzR8aVfT7RLcMWQ4VFjVFDp8i31C/ZxHd/Mz55Z3gCqoZBqjUrA 6T82FGD4lJ2lIxjkZ6nE5PmxmWGYlPjUU65QSXJCV8JRD38VKH+tQpH8zsNgaPwIVMWW csIhPF+dPUVUoL0muB1H04A20Q02KQyy+hdUB3Rf2MkywZTkc1wydW3KPXKbyw2CIwhi UGKmd58pybLYcGEnZZsNHeVMjYmWZkDmkP9TCG1WHLN5WziF4YbsuiooKowTnWSCnaDs agdgzenajOMZYc7Yf/F2LAo11oBQGaXYpsaEFPfp01alnsWSiZhyfMvoCViRtO4UbH5o vR9A== X-Gm-Message-State: AOJu0YyLV6wdz/eH/RqHLc1XkWEml7ObyLq0Xv/81R+p9Fmm6g/sa4k+ GkXdjBp3nqKMWnnHBLGwXJd+yFZycEQhEkaDuUcuI5h8S58EqvMMkJVyO5nkr+3ZUDV23LdPsB4 = X-Google-Smtp-Source: AGHT+IEnK6ynjLtGGHJNa8NzkscFRj42nQl5loh/o9xgcsFK/ofXeo3hkZAE116Do3NOclHExtXngQ== X-Received: by 2002:a05:6a00:114a:b0:70d:2a88:a486 with SMTP id d2e1a72fcca58-710dcabfb0amr2712907b3a.29.1723227059070; Fri, 09 Aug 2024 11:10:59 -0700 (PDT) Received: from jintaolin.c.googlers.com.com (200.42.168.34.bc.googleusercontent.com. [34.168.42.200]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710e5ac46edsm42714b3a.220.2024.08.09.11.10.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Aug 2024 11:10:58 -0700 (PDT) From: Jintao Lin <jintaolin@chromium.org> To: hostap@lists.infradead.org Cc: j@w1.fi, jintaolin@chromium.org, benjamin.berg@intel.com Subject: [PATCH] nl80211: nullptr check for link before use Date: Fri, 9 Aug 2024 18:10:34 +0000 Message-ID: <20240809181034.1539857-1-jintaolin@chromium.org> X-Mailer: git-send-email 2.46.0.76.ge559c4bf1a-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240809_111102_078644_86E87F79 X-CRM114-Status: GOOD ( 12.07 ) X-Spam-Score: -2.2 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: bss->flink could be nullptr when wpa_driver_nl80211_del_beacon is called if wpa_driver_nl80211_drv_init fails early and jump to wpa_driver_nl80211_deinit with bss->flink unset. Signed-off-by: Jintao Lin <jintaolin@chromium.org> --- src/drivers/driver_nl80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Content analysis details: (-2.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:433 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <hostap.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/hostap>, <mailto:hostap-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/hostap/> List-Post: <mailto:hostap@lists.infradead.org> List-Help: <mailto:hostap-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/hostap>, <mailto:hostap-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Hostap" <hostap-bounces@lists.infradead.org> Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
Series |
nl80211: nullptr check for link before use
|
expand
|
On Fri, Aug 09, 2024 at 06:10:34PM +0000, Jintao Lin wrote: > bss->flink could be nullptr when wpa_driver_nl80211_del_beacon is called > if wpa_driver_nl80211_drv_init fails early and jump to > wpa_driver_nl80211_deinit with bss->flink unset. Thanks, applied.
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 12fe4d12d..5deca7bc2 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -3071,7 +3071,7 @@ static int wpa_driver_nl80211_del_beacon(struct i802_bss *bss, struct wpa_driver_nl80211_data *drv = bss->drv; struct i802_link *link = nl80211_get_link(bss, link_id); - if (!link->beacon_set) + if (!link || !link->beacon_set) return 0; wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)",
bss->flink could be nullptr when wpa_driver_nl80211_del_beacon is called if wpa_driver_nl80211_drv_init fails early and jump to wpa_driver_nl80211_deinit with bss->flink unset. Signed-off-by: Jintao Lin <jintaolin@chromium.org> --- src/drivers/driver_nl80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)