Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: linux-wireless@vger.kernel.org
Cc: Johannes Berg <johannes.berg@intel.com>,
	syzbot+1c8c45017f784e646b47@syzkaller.appspotmail.com
Subject: [PATCH RESEND wireless 06/10] wifi: mac80211: don't access the TSF of a down interface
Date: Tue,  8 Sep 2026 14:28:17 +0200	[thread overview]
Message-ID: <20260908122838.201719-18-johannes@sipsolutions.net> (raw)
In-Reply-To: <20260908122838.201719-12-johannes@sipsolutions.net>

From: Johannes Berg <johannes.berg@intel.com>

The tsf debugfs files call the driver even if the interface
isn't up, tgriggering check-sdata-in-driver warnings.

Reject the access in that case.

Assisted-by: LLM
Fixes: 37a41b4affa3 ("mac80211: add ieee80211_vif param to tsf functions")
Reported-by: syzbot+1c8c45017f784e646b47@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=1c8c45017f784e646b47
Link: https://patch.msgid.link/20260904170057.6de1230f9a7b.I7115b209d73732ac2a9916fe19ffee6b1d9abc2f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/debugfs_netdev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index 8346d3eb1143..6aba22493670 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -657,6 +657,9 @@ static ssize_t ieee80211_if_fmt_tsf(
 	struct ieee80211_local *local = sdata->local;
 	u64 tsf;
 
+	if (!ieee80211_sdata_running((struct ieee80211_sub_if_data *)sdata))
+		return -ENETDOWN;
+
 	tsf = drv_get_tsf(local, (struct ieee80211_sub_if_data *)sdata);
 
 	return scnprintf(buf, buflen, "0x%016llx\n", (unsigned long long) tsf);
@@ -670,6 +673,9 @@ static ssize_t ieee80211_if_parse_tsf(
 	int ret;
 	int tsf_is_delta = 0;
 
+	if (!ieee80211_sdata_running(sdata))
+		return -ENETDOWN;
+
 	if (strncmp(buf, "reset", 5) == 0) {
 		if (local->ops->reset_tsf) {
 			drv_reset_tsf(local, sdata);
-- 
2.55.0


  parent reply	other threads:[~2026-09-08 12:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 12:28 [PATCH RESEND wireless 00/10] mac80211 syzbot fixes - part 2 Johannes Berg
2026-09-08 12:28 ` [PATCH RESEND wireless 01/10] wifi: mac80211: don't allow injecting frames wider than the chanctx Johannes Berg
2026-09-08 12:28 ` [PATCH RESEND wireless 02/10] wifi: mac80211: reset the AP_VLAN tailroom counter on ifdown Johannes Berg
2026-09-08 12:28 ` [PATCH RESEND wireless 03/10] wifi: mac80211: require a peer station for TDLS setup confirm Johannes Berg
2026-09-08 12:28 ` [PATCH RESEND wireless 04/10] wifi: mac80211: don't allow link changes when iface is down Johannes Berg
2026-09-08 12:28 ` [PATCH RESEND wireless 05/10] wifi: mac80211: don't RCU-dereference the mesh CSA settings we just set Johannes Berg
2026-09-08 12:28 ` Johannes Berg [this message]
2026-09-08 12:28 ` [PATCH RESEND wireless 07/10] wifi: mac80211: add HE 6 GHz capability in the scan elems len Johannes Berg
2026-09-08 12:28 ` [PATCH RESEND wireless 08/10] wifi: mac80211: mesh: reset the CSA state when leaving Johannes Berg
2026-09-08 12:28 ` [PATCH RESEND wireless 09/10] wifi: mac80211: mesh: release the channel if start fails Johannes Berg
2026-09-08 12:28 ` [PATCH RESEND wireless 10/10] wifi: mac80211: set up the TX info early to fix failure paths Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260908122838.201719-18-johannes@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=johannes.berg@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=syzbot+1c8c45017f784e646b47@syzkaller.appspotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox