-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mt7921u active monitor mode breaks driver #839
Comments
Looks like this driver (https://github.com/openwrt/mt76) doesn't compile (out of the box) running Linux 6.6.1:
|
BTW: |
update
it will receive packets:
But once the first frame has been injected, every thing stops:
Looks like frame injection killed the driver. |
You might want to retest with the recently released firmware: Section 2. |
Thanks for that information. I'll give it a try, but I still think it is related to the driver. |
This is the latest working firmware: This one does not load: |
It loads here: $ ethtool -i wlx00c0cab37abb Adapter: Alfa AXML Remember that wifi firmware for the 7921 requires two firmware files: WIFI_MT7961_patch_mcu_1_2_hdr.bin There is also a bluetooth file but you won't be using it to so you can delete the file from the system: BT_RAM_CODE_MT7961_1_2_hdr.bin |
I double checked this: old firmware:
new firmware:
only the BT firmware has been loaded.
All three bin's have been replaced:
I give it another try without compressing the files.
same result. BTW: connected to USB2 port I'm on kernel
|
$ uname -r I haven't gone to kernel 6.6 yet on this system, which is my main dev box, but will investigate doing a test with 6.6 on another box. Keep in mind that loading the bluetooth firmware is basically worthless as you can't run USB3 and bluetooth together on a USB WiFi adapter. I'm pretty sure the communications between Mediatek and the makers was poor in this respect as the bt firmware should not be loaded if the adapter is in USB3 mode. |
At the moment, I'm running out of ideas. |
I got nothing. I've never seen firmware compressed but if you say it works, it probably works. Got any other distros to try? |
zstd compression is not something new: BTW: |
I wonder if you had a bad download of one of the wifi firmware files? |
Good point - let's compare it: $ md5sum WIFI_MT7961_patch_mcu_1_2_hdr.bin $ md5sum WIFI_RAM_CODE_MT7961_1.bin |
Here are my results from /lib/firmware/mediatek $ md5sum WIFI_MT7961_patch_mcu_1_2_hdr.bin $ md5sum WIFI_RAM_CODE_MT7961_1.bin I can't check the BT firmware because it does not exist on my system. I delete it to prevent it from loading and using resources. It should not load given that BT is turned off in our adapters (Alfa AXML) but it does... that is a programming mistake that needs to be corrected. |
Thanks. The md5 hashes matches. |
Alright @ZerBea , you know better than to change 2 variables at the same time. |
Unfortunately the system on which I compiled the kernel does not have USB3 hardware. Conclusion: the ERROR is back (after a while): and packet injection is still not working. |
As a final test I compiled kernel 6.1 and got the same results. |
To make sure it is not a malfunction of my device. Is packet injection working on your system (kernel 6.5 and latest firmware)? |
Interesting. It looks to me that you have the makings of additional bugs reports. It is also possible there is one source that is the cause. Hard to say. The USB subsystem drivers, and especially the USB3 drivers, are not mankind's great invention. I'm going to try to setup to test with kernel 6.6 and 6.7 tomorrow if I feel better. I have two test systems in my lab but only one is setup and it is using secure boot which is not going to work with this very well at all so I need to rethink my setup. Will report. |
Great, thanks. Linux kernel 6.1, 6.5 and 6.6 All tested devices / drivers (the latest tested device only with a driver patch) passed the tests on all systems: |
I found the problem. Driver reports that active monitor mode is possible:
But if hcxdumptool set active monitor mode, it stops working. If active monitor mode is disabled, everything's fine
I don't think the problem is related to hcxdumptool, because it can be reproduced with iw, ip link and tshark, too:
|
Have you modified the original message to reflect this finding? How does this finding reflect overall? Is packet injection working with active monitor mode off? I'm a little fuzzy after being sick for so many days. Why is active monitor mode needed? |
The head line has been modified. Packet injection is working like a charm: Background:
It is not working on:
I see three options: hcxdumptool does not set active monitor mode by default even if the driver reports that it is supported. active monitor mode capability should not be reported by the driver mt7921u: active monitor mode should be fixed by driver |
It might help since this post has followed a long path to get where it is, if you use "Edit:" at the top of the original post then add what you have added in your last 2 posts so as to make it easy for a person that might fix it to understand without having to track things down. It might also, as am alternative work if you close this report and start a clean new post. I'm going to try to consolidate the information and add it to my main mt7921u bug list at my site. It seems quite clear at this point that active monitor is broken and is the cause of the problem at this point. |
Kernel 5.15 and 6.1 - not working out of the box as expected:
After the BT firmware has been removed:
Frame injection and VIF is working:
Active monitor mode not:
|
Now kernel 6.6.45. As long as the BT stuff is removed,
Monitor mode and packet injection is working:
Active monitor mode is not working:
My conclusion: |
Thank you Mike! I'll see if I can get a kernel patched to remove active monitor for Oscar Real deal would be for drivers to be fixed; do you think it is ever going to happen?? |
There is no need to patch the kernel, because monitor mode and frame injection is working as expected. Real deal would be for drivers to be fixed; do you think it is ever going to happen?? |
Thanks for the suggestion, thanks for your bug report | It is a very rude way to communicate with userbase, I feel sorry for them - hope @morrownr can get some noise on this topic Thanks Mike, for your patience and support! |
Rude is not the problem. I think everyone can imagine what happens when one of this bugs reaches the major penetration testing distributions. |
It's definitely not the case, not walking their talk - I guess developer who managed your report might not be driver's maintainer I won't spend ~70€ for that adapter hoping to have it fixed one day, but I'm going to start raising kernel bugs on distribution trackers - hopefully they're considered a bit more - will start with debian |
...but I'm going to start raising kernel bugs on distribution trackers Mostly I'm running three different versions (via systemd-boot): Arch Linux kernel == Linux stable: 6.10.5 Arch Linux LTS kernel == Linux longterm: 6.6.46 If you run hcxlabtool or hcxdumptool you don't need to set active monitor mode. |
FYI @ZerBea - if I clear monitor mode flags - my 7921e get unbearably slow in scanning - setting control + otherbss as flags alleviate decently (perhaps fcsfail too) |
@alexl83 |
Sorry for the delay. Health problems affecting my wife and I. I try to catch up when I can. I just ran the following on my Edup adapter based on the mt7921au: (driver = mt7921u) $ sudo hcxdumptool -i wlxe84e06aa849b --rcascan=active
I then ran the following on my Asus PCIe card based on the mt7922: (driver = mt7921e) $ sudo hcxdumptool -i wlp2s0 --rcascan=active
I am not an expert with hcxdumptool so you will to tell me what I did and what it means. I can run additional tests. Certainly I would like to test active monitor but will test anything you want. Testing active monitor is a waste of time on any Realtek but I also have adapters based on mt7612u and mt7610u chips. I can also grab my axml to see what it does. Mt opinion is that Alfa screwed something up in the axml.
I would argue that Mediatek is the best wireless platform for monitor mode and ap mode use cases. I've helped people with their wireless problems for several years. With usb adapters we only have the choice of Mediatel and Realtek. Mediatek is much better. I think Alfa just screwed this up with the axml because I am not seeing many of the reported problems with my Edup adapter with the same chip as the axml. There is no doubt there is a problem... exactly what the core issue is and how it can best be fixed is not obvious to me at this point but I am trying to see if we can get to the bottom of it and you guys are helping. |
@morrownr The major difference: On exit, you get some general information: BTW: |
I forgot to mention: |
Thanks for the explanation on the test I did. Now, what command line should I use to test active monitor? I want to do a test on both my Edup adapter and the Alfa adapter to see if I see variances in results. I'll also test my mt7922 card as it uses the mt7921 driver as well. |
@morrownr
If active monitor mode is available (as reported by the driver), run hcxdumptool in active monitor mode: If you see something like this, it is working:
If you see something like this (e.g. AXML) it is not working:
If you see something like this please remove the BT firmware:
At this point, it is possible that the entire USB subsystem became instable. So better to reboot your system. I suggest to run Wireshark on a second interface/system to monitor the entire traffic. |
Thanks. Now for some testing:
No luck: ^C It was only scanning band 1. How do I get it to scan all bands? And should I test it in a USB2 port to see if there is an issue with that? |
Add -F to scan all available (allowed by regulatory domain) frequencies. |
BTW: |
Not too old but now it updated. I'll do some testing... |
Going to be a delay. Not feeling well but will continue when able. |
Take care, and guys - thanks a lot for your support and your efforts! |
@ZerBea Hi, I happen to have two mt7921u adapters (The EDUP AX3000M and the Panda PAU0F), I tried running those commands and didn't get any output like The two adapters are plugged into USB 3 ports, and are named Let me know if there is more things I can do to help test this, I'd be happy to do so. Thanks! Edit: Did some additional testing. When an adapter is downgraded to using a USB 2.0 connection, scanning speeds in monitor mode are significantly improved. To be clear I just connected an adapter to a USB 2.0 extension cable and verified with Using a USB 3.0 extension cable (understandably) has no effect on scanning speeds, still very very slow. |
@kylefmohr , thanks. You're running an old version of hcxdumptool. This version does not show possible reasons why packet injection is not working. Due to the massive bugs (driver & mac80211) I decided to add more information to hcxdumptool,
e.g. errors occurred during runtime:
while it is not broken if the device was plugged in an USB2 port:
As well as an expanded debug log - which can we activated in Makefile:
As you can see, running this kernel:
Monitor mode and frame injection is completely broken if my mt76 device was plugged in an USB3 port! Additional on kernel 6.11-rc 1-4, my entire system crashes if I plug in an ALFA AWUS036AXML: I closed this issue report here, because there are much bigger problems than a "not working active monitor mode". BTW: OpenWRT 23.05 isn't flawless too. It crashes after a while running an ALFA AWUS036AXML under heavy traffic. |
Thanks! I hadn't seen those, it looks like some good progress is being made. Apologies if I made it sound like the fault was with hcxtools, my intention is to help figure out what's wrong with MediaTek's driver for this chipset. I'll let this thread die finally, and continue to keep an eye on morrownr/USB-WiFi#107 which is open for tracking bugs with this driver (as well as the other threads you linked). I have used various hcxtools for years and years now and they have never steered me wrong. Thanks for all of your hard work, it is appreciated. |
I forgot to mention that the only distribution that works with most of my devices is OpenWRT 23.05! |
@kylefmohr , you're welcome. Don't worry about that, I've bisected the Linux kernel and I know that none of this problems is caused by hcxdumptool. |
Hi @kylefmohr
I could use a report on the Panda PAU0F. I have the EDUP adapter and think it is excellent but not much info on the Panda adapter yet. I want the info for my Plug and Play List.
I agree with this assessment. USB WiFi adapters, particularly the newer models, have been taking a hit on Linux over the last several months because they depend on 3 subsystems or stacks if you will. They depend on the following stacks: wireless, bluetooth and usb. The wireless stack has been undergoing a lot of modernization work to support WiFi 6 and 7 features and it is playing hell on many existing drivers. The USB stack, particularly the usb 3 support, is problematic also but USB3 was never one of mankind's greatest inventions. As we can see with some of the mt7921au based adapters on some systems, even bluetooth can shut wifi down. It is not a good time to be on the bleeding edge and most of my advice to users is to back off to kernel 6.6 or 6.1 if it is a system you need to work without wifi bugs right now. |
@morrownr replied back in morrownr/USB-WiFi#107 let me know if you'd like any more info! |
Does anybody have any news about this? It's a pity that the mediatek chipset, one of the best, is not working correctly on newer kernel versions 😢 I was checking the kernel bug tracker: https://bugzilla.kernel.org/show_bug.cgi?id=219040 <- this was a failure with a sad ending https://bugzilla.kernel.org/show_bug.cgi?id=218763 <- this I opened myself was mostly avoided asking me to do something that I don't have time (and probably also the skills) to do by the way... @ZerBea , I need to contact you to ask you something offtopic of this, but I can't find an email, a twitter account, discord or something (you hardened your presence on social media! haha... anyway I'm not an OSINT expert). If you have time, please contact me (my email is public on my profile, or on airgeddon discord server or wherever). |
You should have received an email now. |
I got an ALFA AWUS036AXML. Setting active monitor mode causes the driver to stop.
It took me several days to figure out what went wrong. A lot of tests have let this thread grow.
This is the conclusion (the entire history is below).
Steps to reproduce by common tools like iw, ip link and tshark.
monitor mode:
active monitor mode:
Background:
Running active monitor mode, the device ACK incoming frames addressed to the virtual MAC of the device.
This feature is really useful to perform PMKID attacks.
At the moment, active monitor mode is working on:
It is not working on:
I see three options:
hcxdumptool does not set active monitor mode by default even if the driver reports that it is supported.
That has been done by this commit:
ZerBea/hcxdumptool@8d3f24e
active monitor mode capability should not be reported by the driver
[code]
mt7601u:
$ iw list | grep active
Device supports active monitor (which will ACK incoming frames)
mt7921u:
$ iw list | grep active
Device supports active monitor (which will ACK incoming frames)
[/code]
active monitor mode should be fixed by driver
The text was updated successfully, but these errors were encountered: