Raizo62 / vwifi

Simulator of WiFi (802.11) interfaces to communicate between several Virtual Machines
GNU Lesser General Public License v3.0
57 stars 8 forks source link

Scanning is workable but connecting the hotspot is failed under ubuntu18 #7

Closed 174high closed 1 year ago

174high commented 1 year ago

BSS 02:00:00:00:00:00(on wlan0) last seen: 3350.335s [boottime] TSF: 1666870337229033 usec (19292d, 11:32:17) freq: 2412 beacon interval: 100 TUs capability: ESS ShortSlotTime (0x0401) signal: 20.00 dBm last seen: 3692 ms ago Information elements from Probe Response frame: SSID: mac80211_open Supported rates: 1.0 2.0 5.5 11.0 6.0 9.0 12.0 18.0 DS Parameter set: channel 1 TIM: DTIM Count 1 DTIM Period 2 Bitmap Control 0x0 Bitmap[0] 0x0 ERP: Barker_Preamble_Mode Extended supported rates: 24.0 36.0 48.0 54.0 Extended capabilities:


wlan0: authenticate with 02:00:00:00:00:00 [ 1258.712506] ------------[ cut here ]------------ [ 1258.712529] WARNING: CPU: 0 PID: 2128 at /build/linux-hwe-5.4-huXhHV/linux-hwe-5.4-5.4.0/net/mac80211/sta_info.c:513 sta_info_insert_rcu+0x6d/0x910 [mac80211] [ 1258.712529] Modules linked in: mac80211_hwsim mac80211 cfg80211 libarc4 nls_utf8 isofs vboxvideo(OE) binfmt_misc intel_rapl_msr intel_rapl_common intel_powerclamp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel crypto_simd cryptd glue_helper snd_intel8x0 snd_ac97_codec intel_rapl_perf joydev input_leds vmwgfx ac97_bus serio_raw snd_pcm ttm snd_seq_midi snd_seq_midi_event drm_kms_helper snd_rawmidi snd_seq snd_seq_device snd_timer drm snd fb_sys_fops syscopyarea soundcore sysfillrect vboxguest(OE) sysimgblt mac_hid sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 hid_generic usbhid hid psmouse ahci libahci i2c_piix4 e1000 pata_acpi video [ 1258.712556] CPU: 0 PID: 2128 Comm: iw Tainted: G W OE 5.4.0-42-generic #46~18.04.1-Ubuntu [ 1258.712557] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 1258.712570] RIP: 0010:sta_info_insert_rcu+0x6d/0x910 [mac80211] [ 1258.712572] Code: 00 00 0f b7 83 bc 08 00 00 8b 8b b8 08 00 00 66 33 82 ec 0c 00 00 8b b2 e8 0c 00 00 31 ce 0f b7 c0 09 f0 74 05 83 e1 01 74 2d <0f> 0b 41 bd ea ff ff ff 4c 89 f7 e8 93 dc 32 ca 48 89 de 4c 89 e7 [ 1258.712572] RSP: 0018:ffffc1010490f450 EFLAGS: 00010246 [ 1258.712574] RAX: 0000000000000000 RBX: ffff9feeb83cc000 RCX: 0000000000000002 [ 1258.712574] RDX: ffff9feeb9dc28c0 RSI: 0000000000000000 RDI: ffff9fee818e0d38 [ 1258.712575] RBP: ffffc1010490f4d8 R08: ffff9feebea2f100 R09: 0000000000000000 [ 1258.712576] R10: ffffc1010490f400 R11: ffff9fee8b5f3cd2 R12: ffff9fee818e07a0 [ 1258.712576] R13: ffffc1010490f538 R14: ffff9fee818e0d38 R15: 0000000000000001 [ 1258.712578] FS: 00007fd2f7576240(0000) GS:ffff9feebea00000(0000) knlGS:0000000000000000 [ 1258.712578] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1258.712579] CR2: 000055f486956f28 CR3: 000000003b82a003 CR4: 00000000000606f0 [ 1258.712584] Call Trace: [ 1258.712602] ? ieee80211_recalc_smps_chanctx+0x142/0x320 [mac80211] [ 1258.712617] ? ieee80211_assign_vif_chanctx+0x223/0x410 [mac80211] [ 1258.712629] sta_info_insert+0xe/0x10 [mac80211] [ 1258.712644] ieee80211_prep_connection+0x428/0x980 [mac80211] [ 1258.712658] ieee80211_mgd_auth+0x293/0x400 [mac80211] [ 1258.712677] ? cfg80211_get_bss+0x185/0x260 [cfg80211] [ 1258.712692] ieee80211_auth+0x18/0x20 [mac80211] [ 1258.712707] cfg80211_mlme_auth+0x103/0x210 [cfg80211] [ 1258.712721] cfg80211_conn_do_work+0x195/0x3b0 [cfg80211] [ 1258.712735] cfg80211_connect+0x337/0x790 [cfg80211] [ 1258.712748] nl80211_connect+0x300/0x800 [cfg80211] [ 1258.712753] genl_family_rcv_msg+0x21c/0x490 [ 1258.712754] ? netlink_sendskb+0x53/0x70 [ 1258.712756] genl_rcv_msg+0x4c/0x90 [ 1258.712757] ? genl_family_rcv_msg+0x490/0x490 [ 1258.712758] netlink_rcv_skb+0x51/0x120 [ 1258.712759] genl_rcv+0x28/0x40 [ 1258.712760] netlink_unicast+0x1a4/0x250 [ 1258.712762] netlink_sendmsg+0x2eb/0x3f0 [ 1258.712764] sock_sendmsg+0x63/0x70 [ 1258.712766] __sys_sendmsg+0x200/0x280 [ 1258.712768] _sys_sendmsg+0x88/0xd0 [ 1258.712771] ? call_rcu+0x10/0x20 [ 1258.712773] ? destroy_inode+0x65/0x80 [ 1258.712775] ? evict+0x139/0x1a0 [ 1258.712776] ? iput+0x143/0x210 [ 1258.712779] ? _cond_resched+0x19/0x40 [ 1258.712781] sys_sendmsg+0x63/0xa0 [ 1258.712782] ? __sys_sendmsg+0x63/0xa0 [ 1258.712784] __x64_sys_sendmsg+0x1f/0x30 [ 1258.712787] do_syscall_64+0x57/0x190 [ 1258.712788] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 1258.712789] RIP: 0033:0x7fd2f6c6fa94 [ 1258.712791] Code: 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b5 0f 1f 80 00 00 00 00 48 8d 05 51 df 2c 00 8b 00 85 c0 75 13 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 54 f3 c3 66 90 41 54 55 41 89 d4 53 48 89 f5 [ 1258.712791] RSP: 002b:00007ffe1ac25fa8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 1258.712793] RAX: ffffffffffffffda RBX: 000055f486953990 RCX: 00007fd2f6c6fa94 [ 1258.712793] RDX: 0000000000000000 RSI: 00007ffe1ac25fe0 RDI: 0000000000000003 [ 1258.712794] RBP: 000055f486958d80 R08: 0000000000000001 R09: 000055f486953ab0 [ 1258.712795] R10: 000055f485ff0be0 R11: 0000000000000246 R12: 000055f4869593d0 [ 1258.712795] R13: 00007ffe1ac25fe0 R14: 000055f486955dc8 R15: 000055f4869593d0 [ 1258.712797] ---[ end trace 9d655072b5377519 ]--- [ 1258.712800] wlan0: failed to insert STA entry for the AP (error -22)

Raizo62 commented 1 year ago

Hi

Can i have more details of your topology ? I will could reproduce it OS (Ubuntu 18.04.6 LTS on Client and Serveur ?) / vwifi-client and vwifi-server on the same guest ? IP or VHost ? Which wifi software do you use ? Wifi config ?

Could you not use a newer version of Ubuntu ?

174high commented 1 year ago

Environment: ubuntu-18.04.5-desktop-amd64.iso

I ran vwifi-server , vwifi-client in different virtual machine nonetheless they are in the same domain . vwifi-server and vwifi-client can connect with each other . I set up 3 virtual machine . one was as host , one was a AP , one was a STA . when STA scan , it has result . when connected to AP , it crashed .

but anyway , could tell me what version you are using ? I reckon you don't need reproduce it .

I didn't see that coming that it crashed using a little bit older version of ubuntu .

Raizo62 commented 1 year ago

vwifi uses the kernel module mac80211_hwsim. This module has evolved a little over time. You can test with the last stable distribution(Debian/Ubuntu/...). I use the Debian 11 bullseye. vwifi is also already installed and configured to use on LiveRaizo.

174high commented 1 year ago

OK , I am using ubuntu 22.04 for test . I'll keep you in the loop if nothing inferior happens .

174high commented 1 year ago

[ 1324.153749] wlan0: authenticate with 02:00:00:00:00:00

[ 1324.153776] ------------[ cut here ]------------

[ 1324.153777] WARNING: CPU: 0 PID: 3376 at net/mac80211/sta_info.c:545 sta_info_insert_rcu+0x74/0x130 [mac80211]

[ 1324.153822] Modules linked in: vsock_loopback vmw_vsock_virtio_transport_common vmw_vsock_vmci_transport vsock vmw_vmci mac80211_hwsim mac80211 cfg80211 libarc4 isofs vboxvideo drm_vram_helper drm_ttm_helper nls_iso8859_1 intel_rapl_msr intel_rapl_common snd_intel8x0 snd_ac97_codec ac97_bus intel_powerclamp snd_pcm crct10dif_pclmul snd_seq_midi snd_seq_midi_event ghash_clmulni_intel aesni_intel snd_rawmidi snd_seq crypto_simd cryptd snd_seq_device joydev snd_timer rapl snd soundcore input_leds serio_raw vboxguest mac_hid sch_fq_codel vmwgfx ttm drm_kms_helper cec rc_core fb_sys_fops syscopyarea sysfillrect sysimgblt ipmi_devintf ipmi_msghandler msr parport_pc ppdev lp parport mtd drm ramoops efi_pstore reed_solomon pstore_blk pstore_zone ip_tables x_tables autofs4 hid_generic usbhid hid crc32_pclmul ahci psmouse libahci i2c_piix4 e1000 pata_acpi video

[ 1324.153869] CPU: 0 PID: 3376 Comm: kworker/0:2 Tainted: G W 5.15.0-52-generic #58-Ubuntu

[ 1324.153872] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006

[ 1324.153874] Workqueue: events cfg80211_conn_work [cfg80211]

[ 1324.153916] RIP: 0010:sta_info_insert_rcu+0x74/0x130 [mac80211]

[ 1324.153948] Code: 78 0a 00 00 0f b7 90 04 11 00 00 41 8b bc 24 74 0a 00 00 8b b0 00 11 00 00 31 ca 31 fe 0f b7 d2 09 d6 74 06 40 f6 c7 01 74 32 <0f> 0b b8 ea ff ff ff 4c 89 e6 4c 89 ff 89 45 d8 e8 97 fa ff ff 4c

[ 1324.153950] RSP: 0018:ffffad384248ba08 EFLAGS: 00010246

[ 1324.153952] RAX: ffff94ed4f4c0980 RBX: 0000000000000000 RCX: 0000000000000000

[ 1324.153953] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000002

[ 1324.153954] RBP: ffffad384248ba30 R08: ffff94ed4f4c0980 R09: ffff94ed4cd82e40

[ 1324.153955] R10: 0000000000000000 R11: ffff94ed497f4268 R12: ffff94ed46aa4000

[ 1324.153956] R13: 000000000000006c R14: ffff94ed4ae48f28 R15: ffff94ed4ae48820

[ 1324.153958] FS: 0000000000000000(0000) GS:ffff94edbdc00000(0000) knlGS:0000000000000000

[ 1324.153959] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033

[ 1324.153961] CR2: 00007fcc01bda920 CR3: 0000000006cd0006 CR4: 00000000000706f0

[ 1324.153967] Call Trace:

[ 1324.153968]

[ 1324.153970] ? drv_bss_info_changed+0x94/0x1a0 [mac80211]

[ 1324.154000] sta_info_insert+0x10/0x30 [mac80211]

[ 1324.154029] ieee80211_prep_connection+0x374/0x640 [mac80211]

[ 1324.154074] ieee80211_mgd_auth+0x1b6/0x400 [mac80211]

[ 1324.154139] ? cfg80211_get_bss+0x1d5/0x2a0 [cfg80211]

[ 1324.154170] ieee80211_auth+0x18/0x20 [mac80211]

[ 1324.154203] cfg80211_mlme_auth+0x101/0x1e0 [cfg80211]

[ 1324.154236] cfg80211_conn_do_work+0x1a4/0x410 [cfg80211]

[ 1324.154269] cfg80211_conn_work+0xd7/0x150 [cfg80211]

[ 1324.154300] ? save_fpregs_to_fpstate+0x3f/0xa0

[ 1324.154304] ? finish_task_switch.isra.0+0x7e/0x280

[ 1324.154308] process_one_work+0x22b/0x3d0

[ 1324.154310] worker_thread+0x53/0x420

[ 1324.154312] ? process_one_work+0x3d0/0x3d0

[ 1324.154313] kthread+0x12a/0x150

[ 1324.154316] ? set_kthread_struct+0x50/0x50

[ 1324.154318] ret_from_fork+0x22/0x30

[ 1324.154322]

[ 1324.154323] ---[ end trace a9b89818fc386813 ]---

[ 1324.154327] wlan0: failed to insert STA entry for the AP (error -22)

It crashs again . I reckon your driver is imcompatible with Ubuntu . It scans well therefore i think the topology is correct basically .
Anyway let me try our workable image .

174high commented 1 year ago

BTW , I don't know how to use your virtual machine . I can't figure out how to connect the internal nerwork .

Raizo62 commented 1 year ago
Raizo62 commented 1 year ago

It crashs again . I reckon your driver is imcompatible with Ubuntu .

It is strange because i believe that it is the same kernel as Debian. I will investigate.

Raizo62 commented 1 year ago

You are right. I can reproduce the crash with ubuntu 22.04

Raizo62 commented 1 year ago

I believe that i found the problem : I suppose that you have not changed the MAC addresses of the wlan interfaces before to use them with Network GUI of Ubuntu ? I have used "macchanger -a wlan0" (from the package macchanger) before, and the 2 ubuntu are connected without crash.

Could you test ?

174high commented 1 year ago

Dear Raizo62 It's workable now .

Thanks

Raizo62 commented 1 year ago

Or, don't use the same wlan interface with the 2 Ubuntu guest (so, they don't use the same mac address)

Raizo62 commented 1 year ago

Thank you for your help.

174high commented 1 year ago

Or, don't use the same wlan interface with the 2 Ubuntu guest (so, they don't use the same mac address)

Got it . Thanks