From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796410285; b=aVU6JU6FXR14Lyetyg0iZ8/sht0rdW/AciyoDXhSfohzS0S0XzSpaJykAHj++djucDdm gzmHmTg3mzp/mRWjDTIQ9mubLQn4oe0z4UzwuxbQcCCZ+bYhRgJFLWN/cw8AhdKH8r/eE qP11B5e2t/zi3BWIkvQK4MDzkHRA05/DhPfTHHZ+siwoe6DDJY7wxxngAc/G9yf9EI2ie vn6X4NedHFFsaYBrN41qn0xQvHwBYynWLcj6BrfiNDpV6SaDKuHMTB8MfzqgguwfquwVF CdmBL2Mh6ftbPSOxoeF9CatwN0cp3i+5GVVJdaQAhaJWDyI3bUwW3ti8gHDNegKpNnQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796410285; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-Id:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=k/k6TO+PW87M89qc4/im/+kbSca9GMVJc6Jova6ZzuM=; b=HsCP0s8KeW3/4AmnRmW5j6FN8QL/kHW7N+NnUggC4VQt1qry9umz8XVExnZ96/o1MOre HvTAGRg7hDZdXlJhJdBQW7d5eoawVk2yffLP0nwq9qfCU6Jg/BvzZsKiaVFckIKQNiR6j OFQBTBLv1ReRv9o86lwh+3MXdsvSPEVKQyo+owQVpNN3aHy38UhgbjuDlDxOBjiPaZ0s7 pedt1GA/ASpTSwHYrPxB2geG8XI+J/nmWyUxFl+Jsbfc/CX5SFzRt7l9USzGgz73y18nU dzNYVOxVnzl92QXE1sG26k60bwhzgtFXSV8Wi8NQBAbWAFQj87/0iEziN6ERekhyV9A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="bW7/slir"; arc=none smtp.remote-ip=74.125.82.172 Received: from mail-dy1-f172.google.com (mail-dy1-f172.google.com [74.125.82.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B565606A322 for ; Fri, 4 Dec 2026 18:51:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4B565606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=bW7/slir Received: by mail-dy1-f172.google.com with SMTP id 5a478bee46e88-38747f42472so2081623eec.0 for ; Fri, 04 Dec 2026 10:51:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796410283; x=1797015083; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=k/k6TO+PW87M89qc4/im/+kbSca9GMVJc6Jova6ZzuM=; b=bW7/slir/Z6PmgM76lnbYAhKlNiyxpWAEkjGdC1oz8k8lbUo7r3Vtj41SUBVsTE3/3 GgcnQDvbzayX9d3h1EUEnYZE5bgT5wv7O+mdgSfzvnZdom0Vtv86D6H65aFuSd22G6yF UqDtNPTLeIzH4JrW0nFJuIw1NkwaGmrlKqtYmCbocbZ+VsPgWyIKROq6Yq+CYsus7+tT 1TMxkfCzFYpVEgxlLTkia1ICcNMA3qS8UvD2eWanMRISRDpLCdpmittf/VytY9UvZjiQ NcJqJCjMdL0xDeuqIAhaqelxoGUKBt+BrFi9uXkE1N3Css3orLgnWcIEhRTOYHq0Blj4 3zhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796410283; x=1797015083; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=k/k6TO+PW87M89qc4/im/+kbSca9GMVJc6Jova6ZzuM=; b=QOjjiTEOSE2BjoKX2RfJPqhU3USaU9kBlCClAKBpzrK0ICNHopyLYgEAKA8lM9/qSL PcFCaDre3j8RhKOvwbYpc0rWuXyaMRS8E8+QyoKW0JxXe78f+tHipgki65gNc9uV/iZO aAtC2VO9SlwTUxrXxqN68WW/CNq0CvIDhqvVo9RxCuGf7hPUKHP2WuACJ/ld/8nF/xsP Vgd3b9G32ojfAek1epiftGBEdW+rpuURPdgW9mr5TvHlA7Zr3/Pk4NRNvTwS6jsclhb0 ct1X0B0JJklsdvibYjAoyLpM/3umCgpC0FQZfE7AziD81LER9GTRy4eNSErWH1XBxPMt YYBw== X-Forwarded-Encrypted: i=1; AL+hErG/bUuwvEhhisMPPo6I2TCWVVvJYc2DAwGKeUxerMTbR7td7OcabNiGgT4VdUr99yTPTAlHYXA=@vger.kernel.org X-Gm-Message-State: AB4q+uEPhTnQb1CZWhnFKCM13wtM7PVkotocRlyng5Yf4EEkez7l7G6B R+J9zZEM+NReZr2Ec+Gcui8TKpVfRnJkhc/1Lcc7d3L4pHSKTbWbB9MH X-Gm-Gg: AZFdTZc0nQenJLlWnj5wXOBQYgpHtF+vUrtZl8y6SEcJUBtHjZfXkXXgJh/NIFihRm9 aGjtybPw6iQbkPI76+XLD+PD7wlUgP7PY/riq4YchsC5HIQE86EciKkfFEWLGhXhL5tZgP3lpu4 8K83uEpF44PsSgqnUY2tR8TW4TSixjG5Tf/+wi9KAGMblo29sIwkzfNf1ekT64ze17IYvGsffCB GnnUWlQmFI5RxnXVc+bHVXD0Vldxrzcu19h1DViKggjAdNKcjDm/T3UlL5zfKHuV7l+drk/wmyR vxnc8VWXgg45O8GQpy1mS4Ufe5fUmfF/SC3Gdvw3l2A0mSHhGt9TtwXJ779K3A0sCNNM9ZQF+hi WwWlwxPf5Xm9WJT4hxkl9rQXJ8a/3wefNgGFUa4+JvbBWAIyS6dnwXGRWfKuEy23U3GeBOTl2mP VSZ1IBScmsI3B1jry/3tRzhpMtL8VCT+uAfEHh7HqOzsBXzJhbV9oJKcp0dQHLnop1q9prKkOLO HnjGRr+7pv4D/rvjpvFlPzTsaJL9RexFaU8ES+frq/r2RXIToBgpah9JyRtBX9Y7hn4cPc+RSPb 65r3MRL+rh89vevBAHuzQM9H7L7xG2L2NTiaMoyi7TIFD0LVh0rJQLT6Agrt8BrrtCA= X-Received: by 2002:a05:7301:5f8a:b0:387:4e3b:1f69 with SMTP id 5a478bee46e88-38752139c13mr3507412eec.14.1796410283222; Fri, 04 Dec 2026 10:51:23 -0800 (PST) Received: from localhost.localdomain (wood.seclab.cs.ucsb.edu. [128.111.49.37]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-387521f1360sm10055587eec.20.2026.12.04.10.51.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 10:51:22 -0800 (PST) From: Praneeth Balasubramanian To: Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, linux-kernel@vger.kernel.org, Praneeth Balasubramanian , stable@vger.kernel.org Subject: [PATCH ath-next] wifi: ath11k: Hold the ring lock when returning a monitor link descriptor Date: Fri, 4 Dec 2026 10:51:20 -0800 Message-Id: <20261204185120.1688129-1-praneethb2002@gmail.com> X-Mailer: git-send-email 2.25.1 X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ath11k_dp_rx_monitor_link_desc_return() writes an entry into a source ring with ath11k_hal_srng_access_begin(), ath11k_hal_srng_src_get_next_entry() and ath11k_hal_srng_access_end(). All three assert with lockdep_assert_held() that srng->lock is held, but this function never takes it. On chips with rxdma1_enable (IPQ8074, IPQ6018, QCN9074, IPQ5018) it is called for every link descriptor in monitor mode, so a kernel with lockdep warns three times per call. The ring it uses there, rxdma_mon_desc_ring, is only written by the monitor path under pmon->mon_lock, so this is not a data race today. The function would also pick wbm_desc_rel_ring on chips without rxdma1, and that ring is shared with ath11k_dp_rx_link_desc_return(), which takes srng->lock. No current caller reaches that branch. Take srng->lock around the ring access, as ath11k_dp_rx_link_desc_return() and ath11k_dp_link_desc_setup() do. Each ring has its own lock class, so nesting it under the destination ring lock held by the callers does not trigger lockdep. The missing lock was found by a static check that turns lockdep assertions into Clang context-analysis requirements on the callers. Compile tested only. Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Cc: stable@vger.kernel.org Signed-off-by: Praneeth Balasubramanian --- Notes: This was found by a compiler-based check, part of research at UCSB SecLab. A lockdep_assert_held() at the start of a function is turned into a Clang context-analysis requirement (__must_hold) on that function, and Clang 23 with CONFIG_WARN_CONTEXT_ANALYSIS then checks every caller. No LLM was involved in finding the bug. The patch and changelog were drafted with Claude Opus 5.5. I reviewed the patch and take responsibility for it. Testing: builds without new warnings with W=1 (x86_64, clang 23, allmodconfig). Not runtime-tested; I do not have this hardware, and I have not seen the warning myself. drivers/net/wireless/ath/ath11k/dp_rx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c index 6d95f7b343a5..e3844bfb0dd5 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -4542,7 +4542,7 @@ int ath11k_dp_rx_monitor_link_desc_return(struct ath11k *ar, { struct ath11k_pdev_dp *dp = &ar->dp; struct dp_srng *dp_srng; - void *hal_srng; + struct hal_srng *hal_srng; void *src_srng_desc; int ret = 0; @@ -4554,6 +4554,8 @@ int ath11k_dp_rx_monitor_link_desc_return(struct ath11k *ar, hal_srng = &ar->ab->hal.srng_list[dp_srng->ring_id]; } + spin_lock_bh(&hal_srng->lock); + ath11k_hal_srng_access_begin(ar->ab, hal_srng); src_srng_desc = ath11k_hal_srng_src_get_next_entry(ar->ab, hal_srng); @@ -4569,6 +4571,9 @@ int ath11k_dp_rx_monitor_link_desc_return(struct ath11k *ar, } ath11k_hal_srng_access_end(ar->ab, hal_srng); + + spin_unlock_bh(&hal_srng->lock); + return ret; } -- 2.25.1