Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp254351rdb; Thu, 19 Oct 2023 03:43:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6t2IpsUBm5osOI4IErTbd0uBehLV1SDf4IDs1FqKSXjKmtl5Y1KAdykjFzvA0IujSObxY X-Received: by 2002:a17:90a:e554:b0:27c:f4c7:57f with SMTP id ei20-20020a17090ae55400b0027cf4c7057fmr1408484pjb.35.1697712200167; Thu, 19 Oct 2023 03:43:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697712200; cv=none; d=google.com; s=arc-20160816; b=I1Pyzj8xwB1PPxbUSl6QW7BE+9evbs7zWTAGF8cu2t4jjbo41/CVXymosVDa5ZQvDz iwS697JAgLG29bNXh7e3cd00DWit+TywOqMHwbqcZW4aQ+hw8zi07nzOPJ6NYYjUFrYq Ao129TUKzrvodaADC70n+LThsU5tPB5tcafI5PXxqplZinlazMrdrDp7N5BzY5sZf+mr yKiT/W/nYq3axr0y5CGPLWv7kLvzl5a5sSzt8dfUrX/ucc7IldeCiqXBRL/K41vhU1Nl g+o8EBPbDG9/lYlI43OT3YBSrhqPVr2iaad4XbDxYrsAtqevMtT0112fLnUWGbxG4Ehn 5YyQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=C+ouhaKdaZ6PJn9J2UlfcJ64xOVqUNl2+jIniuA4iZA=; fh=g2eagvQVT0rBo5T85aspub4Qs99bFvN0wPRxwEE5OxY=; b=Kru1QxBJsfTNYbezpzrl9YuYoZRt+2zQt/BGBxdvWBKHX6hqgVAqWoNhAvif0QbrXp BUlPIE+YL7JLXkWz/JsBkJkD8QoPpd39n68je7lPZrsBD9m+M2knDE95RdkF5qgGFQqt eNDPOVPMacAf9cDX7wUZOOAdmcUX56vbkuZ5jvksiFhR6iDBoTQwPehg1MaN+UuognhL BOkRQb3TRzFoRWn2sFct6bCYjHHUI7BLEs3Lmrenq2RanynrLujz3adk2O02i9gKTgYk u6HaPIeLyipvhxLyGALLtZmbjIpPEpTENWKneju/i1Q5Aka55b7uFTRT5LLMXklg2hl+ 0X4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kz3CVkty; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id hk1-20020a17090b224100b0027ce5a78453si185505pjb.29.2023.10.19.03.43.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 03:43:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kz3CVkty; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 99A9281A32A3; Thu, 19 Oct 2023 03:43:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232888AbjJSKnN (ORCPT + 52 others); Thu, 19 Oct 2023 06:43:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230297AbjJSKnL (ORCPT ); Thu, 19 Oct 2023 06:43:11 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03EE5119; Thu, 19 Oct 2023 03:43:10 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A9BEC433CA; Thu, 19 Oct 2023 10:43:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697712189; bh=+65hIKor49TrWPpX1MZLxHjHl0a9EdHwn7yekofvZVA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kz3CVktyrqbK/5jucRIqPe4Bg8/2aUDx5aCC5oLs93UOJ5tvN73wKlRdWq5NTtP+W Mc/TknTyh1iGgz1UoQOadGAH77q/0zr3L/5nkjnJtDc+TUTjMLONonwsLMMLi6/Pew 3Hwej3Jtows5gPsRuMU8pPa6+PjI7jxF7eVJ7dgWctg0OqH626yg0pGxs/mE26M9db YX16xbHr8mJY4dsZzDyBYrnUHJXh3pWb/3FbYzuzp/f1/2DMdPtAgJhkyHsBhuSfZb MLmLetIvMB22OLHJZdUvpmCg7XGbuTQ0WektV7RzW8qKEaH8S6nGaT9Zw+wF5tuqb1 /yYqoFvMDy3gw== Received: from johan by xi.lan with local (Exim 4.96) (envelope-from ) id 1qtQUi-0003ao-2U; Thu, 19 Oct 2023 12:43:12 +0200 From: Johan Hovold To: Kalle Valo Cc: Jeff Johnson , Pradeep Kumar Chitrapu , ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH 2/2] wifi: ath11k: fix dfs radar event locking Date: Thu, 19 Oct 2023 12:42:11 +0200 Message-ID: <20231019104211.13769-3-johan+linaro@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019104211.13769-1-johan+linaro@kernel.org> References: <20231019104211.13769-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 19 Oct 2023 03:43:15 -0700 (PDT) The ath11k active pdevs are protected by RCU but the DFS radar event handling code calling ath11k_mac_get_ar_by_pdev_id() was not marked as a read-side critical section. Mark the code in question as an RCU read-side critical section to avoid any potential use-after-free issues. Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Cc: stable@vger.kernel.org # 5.6 Signed-off-by: Johan Hovold --- drivers/net/wireless/ath/ath11k/wmi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index 980ff588325d..fe6b70a503d0 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -8337,6 +8337,8 @@ ath11k_wmi_pdev_dfs_radar_detected_event(struct ath11k_base *ab, struct sk_buff ev->detector_id, ev->segment_id, ev->timestamp, ev->is_chirp, ev->freq_offset, ev->sidx); + rcu_read_lock(); + ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); if (!ar) { @@ -8354,6 +8356,8 @@ ath11k_wmi_pdev_dfs_radar_detected_event(struct ath11k_base *ab, struct sk_buff ieee80211_radar_detected(ar->hw); exit: + rcu_read_unlock(); + kfree(tb); } -- 2.41.0