public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [wireless?] WARNING in __cfg80211_connect_result (2)
@ 2024-05-27 10:59 syzbot
  2024-06-27  0:16 ` syzbot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: syzbot @ 2024-05-27 10:59 UTC (permalink / raw)
  To: davem, edumazet, johannes, kuba, linux-kernel, linux-wireless,
	netdev, pabeni, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    0b4f5add9fa5 Merge branch 'mlx5-fixes'
git tree:       net
console output: https://syzkaller.appspot.com/x/log.txt?x=16d3e7dc980000
kernel config:  https://syzkaller.appspot.com/x/.config?x=48c05addbb27f3b0
dashboard link: https://syzkaller.appspot.com/bug?extid=d6eb9cee2885ec06f5e3
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/012c6c28629f/disk-0b4f5add.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/a95912632824/vmlinux-0b4f5add.xz
kernel image: https://storage.googleapis.com/syzbot-assets/4bc604c85096/bzImage-0b4f5add.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+d6eb9cee2885ec06f5e3@syzkaller.appspotmail.com

------------[ cut here ]------------
WARNING: CPU: 1 PID: 2887 at net/wireless/sme.c:846 __cfg80211_connect_result+0x19ea/0x21d0 net/wireless/sme.c:846
Modules linked in:
CPU: 1 PID: 2887 Comm: kworker/u8:13 Not tainted 6.9.0-syzkaller-12082-g0b4f5add9fa5 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Workqueue: cfg80211 cfg80211_event_work
RIP: 0010:__cfg80211_connect_result+0x19ea/0x21d0 net/wireless/sme.c:846
Code: a3 00 89 c3 31 ff 89 c6 e8 83 eb b3 f6 85 db 74 29 e8 5a 17 9a f6 84 c0 74 27 e8 31 e7 b3 f6 e9 84 00 00 00 e8 27 e7 b3 f6 90 <0f> 0b 90 4c 89 ff 4c 89 f6 e8 68 23 00 00 eb 91 e8 11 e7 b3 f6 eb
RSP: 0018:ffffc90009f579e0 EFLAGS: 00010293
RAX: ffffffff8ae22d59 RBX: 0000000000000000 RCX: ffff88802b8c8000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90009f57b00 R08: ffffffff8ae22929 R09: 1ffffffff25f4abd
R10: dffffc0000000000 R11: fffffbfff25f4abe R12: ffff88807cb8f898
R13: dffffc0000000000 R14: ffff88807cb8f818 R15: ffff88805ff1f000
FS:  0000000000000000(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b3362a000 CR3: 00000000732a4000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 cfg80211_process_wdev_events+0x356/0x510 net/wireless/util.c:1105
 cfg80211_process_rdev_events+0xac/0x110 net/wireless/util.c:1147
 cfg80211_event_work+0x2f/0x40 net/wireless/core.c:335
 process_one_work kernel/workqueue.c:3231 [inline]
 process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312
 worker_thread+0x86d/0xd70 kernel/workqueue.c:3393
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [syzbot] [wireless?] WARNING in __cfg80211_connect_result (2)
  2024-05-27 10:59 [syzbot] [wireless?] WARNING in __cfg80211_connect_result (2) syzbot
@ 2024-06-27  0:16 ` syzbot
  2024-07-03 15:01 ` [syzbot] [syzbot] [wireless?] WARNING in __cfg80211_connect_result syzbot
  2024-07-03 15:16 ` [syzbot] [syzbot] [wireless?] WARNING in __cfg80211_connect_result (2) syzbot
  2 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2024-06-27  0:16 UTC (permalink / raw)
  To: davem, edumazet, johannes, kuba, linux-kernel, linux-wireless,
	netdev, pabeni, syzkaller-bugs

syzbot has found a reproducer for the following issue on:

HEAD commit:    a6a6a9809411 net: Drop explicit initialization of struct i..
git tree:       net-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=1324ea82980000
kernel config:  https://syzkaller.appspot.com/x/.config?x=e78fc116033e0ab7
dashboard link: https://syzkaller.appspot.com/bug?extid=d6eb9cee2885ec06f5e3
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=12a8b81a980000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=13d426c1980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/5fb6ec98e2e9/disk-a6a6a980.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/f39f26a93081/vmlinux-a6a6a980.xz
kernel image: https://storage.googleapis.com/syzbot-assets/5997cea80d62/bzImage-a6a6a980.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+d6eb9cee2885ec06f5e3@syzkaller.appspotmail.com

------------[ cut here ]------------
WARNING: CPU: 0 PID: 35 at net/wireless/sme.c:846 __cfg80211_connect_result+0x19ea/0x21d0 net/wireless/sme.c:846
Modules linked in:
CPU: 0 PID: 35 Comm: kworker/u8:2 Not tainted 6.10.0-rc4-syzkaller-00937-ga6a6a9809411 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Workqueue: cfg80211 cfg80211_event_work
RIP: 0010:__cfg80211_connect_result+0x19ea/0x21d0 net/wireless/sme.c:846
Code: a4 00 89 c3 31 ff 89 c6 e8 43 4f b2 f6 85 db 74 29 e8 0a 7b 98 f6 84 c0 74 27 e8 f1 4a b2 f6 e9 84 00 00 00 e8 e7 4a b2 f6 90 <0f> 0b 90 4c 89 ff 4c 89 f6 e8 68 23 00 00 eb 91 e8 d1 4a b2 f6 eb
RSP: 0018:ffffc90000ab79e0 EFLAGS: 00010293
RAX: ffffffff8ae3da39 RBX: 0000000000000000 RCX: ffff88801aefbc00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90000ab7b00 R08: ffffffff8ae3d609 R09: 1ffffffff25f6cbd
R10: dffffc0000000000 R11: fffffbfff25f6cbe R12: ffff88802ac63098
R13: dffffc0000000000 R14: ffff88802ac63018 R15: ffff888022eeb000
FS:  0000000000000000(0000) GS:ffff8880b9400000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000200029c0 CR3: 0000000078998000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 cfg80211_process_wdev_events+0x356/0x510 net/wireless/util.c:1105
 cfg80211_process_rdev_events+0xac/0x110 net/wireless/util.c:1147
 cfg80211_event_work+0x2f/0x40 net/wireless/core.c:335
 process_one_work kernel/workqueue.c:3231 [inline]
 process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312
 worker_thread+0x86d/0xd70 kernel/workqueue.c:3393
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [syzbot] [syzbot] [wireless?] WARNING in __cfg80211_connect_result
  2024-05-27 10:59 [syzbot] [wireless?] WARNING in __cfg80211_connect_result (2) syzbot
  2024-06-27  0:16 ` syzbot
@ 2024-07-03 15:01 ` syzbot
  2024-07-03 15:16 ` [syzbot] [syzbot] [wireless?] WARNING in __cfg80211_connect_result (2) syzbot
  2 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2024-07-03 15:01 UTC (permalink / raw)
  To: linux-kernel

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: [syzbot] [wireless?] WARNING in __cfg80211_connect_result
Author: en-wei.wu@canonical.com

#syz test

--- a/drivers/net/wireless/virtual/virt_wifi.c
+++ b/drivers/net/wireless/virtual/virt_wifi.c
@@ -136,6 +136,9 @@ static struct ieee80211_supported_band band_5ghz = {
 /* Assigned at module init. Guaranteed locally-administered and unicast. */
 static u8 fake_router_bssid[ETH_ALEN] __ro_after_init = {};
 
+#define VIRT_WIFI_SSID_LEN 8
+#define VIRT_WIFI_SSID "VirtWifi"
+
 static void virt_wifi_inform_bss(struct wiphy *wiphy)
 {
 	u64 tsf = div_u64(ktime_get_boottime_ns(), 1000);
@@ -146,8 +149,8 @@ static void virt_wifi_inform_bss(struct wiphy *wiphy)
 		u8 ssid[8];
 	} __packed ssid = {
 		.tag = WLAN_EID_SSID,
-		.len = 8,
-		.ssid = "VirtWifi",
+		.len = VIRT_WIFI_SSID_LEN,
+		.ssid = VIRT_WIFI_SSID,
 	};
 
 	informed_bss = cfg80211_inform_bss(wiphy, &channel_5ghz,
@@ -213,6 +216,8 @@ struct virt_wifi_netdev_priv {
 	struct net_device *upperdev;
 	u32 tx_packets;
 	u32 tx_failed;
+	u32 connect_requested_ssid_len;
+	u8 connect_requested_ssid[IEEE80211_MAX_SSID_LEN];
 	u8 connect_requested_bss[ETH_ALEN];
 	bool is_up;
 	bool is_connected;
@@ -224,11 +229,21 @@ static int virt_wifi_connect(struct wiphy *wiphy, struct net_device *netdev,
 			     struct cfg80211_connect_params *sme)
 {
 	struct virt_wifi_netdev_priv *priv = netdev_priv(netdev);
+	u32 ssid_len;
 	bool could_schedule;
 
 	if (priv->being_deleted || !priv->is_up)
 		return -EBUSY;
 
+	if (!sme->ssid) {
+		wiphy_err(wiphy, "invalid SSID\n");
+		return -EINVAL;
+	}
+
+	ssid_len = min_t(u32, sme->ssid_len, IEEE80211_MAX_SSID_LEN);
+	priv->connect_requested_ssid_len = ssid_len;
+	memcpy(priv->connect_requested_ssid, sme->ssid, ssid_len);
+
 	could_schedule = schedule_delayed_work(&priv->connect, HZ * 2);
 	if (!could_schedule)
 		return -EBUSY;
@@ -252,12 +267,15 @@ static void virt_wifi_connect_complete(struct work_struct *work)
 		container_of(work, struct virt_wifi_netdev_priv, connect.work);
 	u8 *requested_bss = priv->connect_requested_bss;
 	bool right_addr = ether_addr_equal(requested_bss, fake_router_bssid);
+	bool right_ssid = (priv->connect_requested_ssid_len == VIRT_WIFI_SSID_LEN ?
+			  !memcmp(priv->connect_requested_ssid, VIRT_WIFI_SSID,
+				  priv->connect_requested_ssid_len) : false);
 	u16 status = WLAN_STATUS_SUCCESS;
 
 	if (is_zero_ether_addr(requested_bss))
 		requested_bss = NULL;
 
-	if (!priv->is_up || (requested_bss && !right_addr))
+	if (!priv->is_up || (requested_bss && !right_addr) || !right_ssid)
 		status = WLAN_STATUS_UNSPECIFIED_FAILURE;
 	else
 		priv->is_connected = true;


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [syzbot] [syzbot] [wireless?] WARNING in __cfg80211_connect_result (2)
  2024-05-27 10:59 [syzbot] [wireless?] WARNING in __cfg80211_connect_result (2) syzbot
  2024-06-27  0:16 ` syzbot
  2024-07-03 15:01 ` [syzbot] [syzbot] [wireless?] WARNING in __cfg80211_connect_result syzbot
@ 2024-07-03 15:16 ` syzbot
  2 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2024-07-03 15:16 UTC (permalink / raw)
  To: linux-kernel

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: [syzbot] [wireless?] WARNING in __cfg80211_connect_result (2)
Author: en-wei.wu@canonical.com

#syz test

--- a/drivers/net/wireless/virtual/virt_wifi.c
+++ b/drivers/net/wireless/virtual/virt_wifi.c
@@ -136,6 +136,9 @@ static struct ieee80211_supported_band band_5ghz = {
 /* Assigned at module init. Guaranteed locally-administered and unicast. */
 static u8 fake_router_bssid[ETH_ALEN] __ro_after_init = {};
 
+#define VIRT_WIFI_SSID_LEN 8
+#define VIRT_WIFI_SSID "VirtWifi"
+
 static void virt_wifi_inform_bss(struct wiphy *wiphy)
 {
 	u64 tsf = div_u64(ktime_get_boottime_ns(), 1000);
@@ -146,8 +149,8 @@ static void virt_wifi_inform_bss(struct wiphy *wiphy)
 		u8 ssid[8];
 	} __packed ssid = {
 		.tag = WLAN_EID_SSID,
-		.len = 8,
-		.ssid = "VirtWifi",
+		.len = VIRT_WIFI_SSID_LEN,
+		.ssid = VIRT_WIFI_SSID,
 	};
 
 	informed_bss = cfg80211_inform_bss(wiphy, &channel_5ghz,
@@ -213,6 +216,8 @@ struct virt_wifi_netdev_priv {
 	struct net_device *upperdev;
 	u32 tx_packets;
 	u32 tx_failed;
+	u32 connect_requested_ssid_len;
+	u8 connect_requested_ssid[IEEE80211_MAX_SSID_LEN];
 	u8 connect_requested_bss[ETH_ALEN];
 	bool is_up;
 	bool is_connected;
@@ -224,11 +229,21 @@ static int virt_wifi_connect(struct wiphy *wiphy, struct net_device *netdev,
 			     struct cfg80211_connect_params *sme)
 {
 	struct virt_wifi_netdev_priv *priv = netdev_priv(netdev);
+	u32 ssid_len;
 	bool could_schedule;
 
 	if (priv->being_deleted || !priv->is_up)
 		return -EBUSY;
 
+	if (!sme->ssid) {
+		wiphy_err(wiphy, "invalid SSID\n");
+		return -EINVAL;
+	}
+
+	ssid_len = min_t(u32, sme->ssid_len, IEEE80211_MAX_SSID_LEN);
+	priv->connect_requested_ssid_len = ssid_len;
+	memcpy(priv->connect_requested_ssid, sme->ssid, ssid_len);
+
 	could_schedule = schedule_delayed_work(&priv->connect, HZ * 2);
 	if (!could_schedule)
 		return -EBUSY;
@@ -252,12 +267,15 @@ static void virt_wifi_connect_complete(struct work_struct *work)
 		container_of(work, struct virt_wifi_netdev_priv, connect.work);
 	u8 *requested_bss = priv->connect_requested_bss;
 	bool right_addr = ether_addr_equal(requested_bss, fake_router_bssid);
+	bool right_ssid = (priv->connect_requested_ssid_len == VIRT_WIFI_SSID_LEN ?
+			  !memcmp(priv->connect_requested_ssid, VIRT_WIFI_SSID,
+				  priv->connect_requested_ssid_len) : false);
 	u16 status = WLAN_STATUS_SUCCESS;
 
 	if (is_zero_ether_addr(requested_bss))
 		requested_bss = NULL;
 
-	if (!priv->is_up || (requested_bss && !right_addr))
+	if (!priv->is_up || (requested_bss && !right_addr) || !right_ssid)
 		status = WLAN_STATUS_UNSPECIFIED_FAILURE;
 	else
 		priv->is_connected = true;


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-07-03 15:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-27 10:59 [syzbot] [wireless?] WARNING in __cfg80211_connect_result (2) syzbot
2024-06-27  0:16 ` syzbot
2024-07-03 15:01 ` [syzbot] [syzbot] [wireless?] WARNING in __cfg80211_connect_result syzbot
2024-07-03 15:16 ` [syzbot] [syzbot] [wireless?] WARNING in __cfg80211_connect_result (2) syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox