From nobody Sat Feb 7 05:30:16 2026 Received: from mail-oo1-f53.google.com (mail-oo1-f53.google.com [209.85.161.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0C9426A0B9 for ; Fri, 23 Jan 2026 17:56:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769190982; cv=none; b=XHXCzxJsSSFmQGa4wBhMRNi8C2Fg2TcMM+s2n8OrqGCZS22tZVupJGR6RiHsDZhm9sbrs3phSvqSgBhD0t79stmQ3Hyv3QmSq3oFF7RGI4vk1ir1v72xvoacB5oP3EBgGyUE6XNO5OMtou62VIGz8gEC9zuRK4nXwGoalkpecyk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769190982; c=relaxed/simple; bh=3s1ZvG4P3WmIZF3H5HsQvvQxalPtq1UMEG/svuL5U4I=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=D9PRUKkSXWT1GAdXWZt7DXjfBPN42vFO2SxbynXPvYq/HZjlrDHloXQq3e9MsEORpk/YtKMxbewV0rt9pkUbseKqhP/ihKwMdlcZuD4c6fcPJRj0MkG/sBBNPEvCZsIQJKsXCenNGp7OGLD2qd1tMa8CDcks+z3AxGqqnwvH5eM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=u.northwestern.edu; spf=pass smtp.mailfrom=u.northwestern.edu; dkim=pass (2048-bit key) header.d=u-northwestern-edu.20230601.gappssmtp.com header.i=@u-northwestern-edu.20230601.gappssmtp.com header.b=ZWEYsGcX; arc=none smtp.client-ip=209.85.161.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=u.northwestern.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=u.northwestern.edu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=u-northwestern-edu.20230601.gappssmtp.com header.i=@u-northwestern-edu.20230601.gappssmtp.com header.b="ZWEYsGcX" Received: by mail-oo1-f53.google.com with SMTP id 006d021491bc7-66106a2f8d0so1728517eaf.2 for ; Fri, 23 Jan 2026 09:56:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=u-northwestern-edu.20230601.gappssmtp.com; s=20230601; t=1769190979; x=1769795779; 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; bh=CFDEOmaGngrWuic2vWW8nkHShPa2cF6a+SEkB8r9KMU=; b=ZWEYsGcXpRFmz/5GGyV6e6sogXR2ENIEmjkzAe9UUFfykGLNFEPnwTAsERny72VR4U mVc4XsHH0WupFZRupWNAffsJVptUm3vw6pL8vHWCWtXhVhgdSxT3gFqJ8iE+lR2bokdn AYAQn1a7+33I3qoF6Ju68grI4bGc2+CEp2l1bv4ZM5Ir5uhRnj1uyQvHkW6UsfFcuZdH gNJUpvlaE9IS49iOA5oRJG0SJElHx5cGwg06FnP3kCoc4BFYOsgSxf5VYr943zK0UaoR HWZJxVkaALTjFlhD/1wa5HMSDMoLQRsUyDKe6yWNbG8cC9Zy1hWHFZGJTJYvj04JAmAp z92A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769190979; x=1769795779; 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; bh=CFDEOmaGngrWuic2vWW8nkHShPa2cF6a+SEkB8r9KMU=; b=Xo2fuEI7r6iiL50LyDkH/Wjs6g8rWnic/JbYUpDREDaGWzmksYNiuX1R3O+UdNE1Pi XMLztDyZj0n7YrExtrtt8jw0A9GAxA17S5ppUahQD0lsNyPsPV7zOj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:27dd:f565 with SMTP id 006d021491bc7-662caaefbddmr1770681eaf.22.1769190979584; Fri, 23 Jan 2026 09:56:19 -0800 (PST) Received: from security.cs.northwestern.edu (security.cs.northwestern.edu. [165.124.184.136]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-662cb666c45sm1354143eaf.15.2026.01.23.09.56.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jan 2026 09:56:19 -0800 (PST) From: Ziyi Guo To: Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org, linux-kernel@vger.kernel.org, Ziyi Guo Subject: [PATCH v2] wifi: ath10k: fix lock protection in ath10k_wmi_event_peer_sta_ps_state_chg() Date: Fri, 23 Jan 2026 17:56:11 +0000 Message-Id: <20260123175611.767731-1-n7l8m4@u.northwestern.edu> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ath10k_wmi_event_peer_sta_ps_state_chg() uses lockdep_assert_held() to assert that ar->data_lock should be held by the caller, but neither ath10k_wmi_10_2_op_rx() nor ath10k_wmi_10_4_op_rx() acquire this lock before calling this function. The field arsta->peer_ps_state is documented as protected by ar->data_lock in core.h, and other accessors (ath10k_peer_ps_state_disable, ath10k_dbg_sta_read_peer_ps_state) properly acquire this lock. Add spin_lock_bh()/spin_unlock_bh() around the peer_ps_state update, and remove the lockdep_assert_held() to be aligned with new locking, following the pattern used by other WMI event handlers in the driver. Signed-off-by: Ziyi Guo Reviewed-by: Baochen Qiang --- v2: - Remove lockdep_assert_held() as suggested, since we are now taking the lock internally. drivers/net/wireless/ath/ath10k/wmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/a= th/ath10k/wmi.c index b4aad6604d6d..061a2fa8f00f 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -5289,7 +5289,6 @@ ath10k_wmi_event_peer_sta_ps_state_chg(struct ath10k = *ar, struct sk_buff *skb) struct ath10k_sta *arsta; u8 peer_addr[ETH_ALEN]; =20 - lockdep_assert_held(&ar->data_lock); =20 ev =3D (struct wmi_peer_sta_ps_state_chg_event *)skb->data; ether_addr_copy(peer_addr, ev->peer_macaddr.addr); @@ -5305,7 +5304,9 @@ ath10k_wmi_event_peer_sta_ps_state_chg(struct ath10k = *ar, struct sk_buff *skb) } =20 arsta =3D (struct ath10k_sta *)sta->drv_priv; + spin_lock_bh(&ar->data_lock); arsta->peer_ps_state =3D __le32_to_cpu(ev->peer_ps_state); + spin_unlock_bh(&ar->data_lock); =20 exit: rcu_read_unlock(); --=20 2.34.1