-
Notifications
You must be signed in to change notification settings - Fork 85
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
Will this board work with "Internalblue" - CYW920819EVB-02 #27
Comments
The one I have is also revision 2, so it's definitely supported :) |
@jiska2342 Thanks. Actually ordered 2 boards. CYW20735B1 came first. Followed the instructions and want to enter Board is connected. MAC is there
But get this
https://github.com/francozappa/bias/blob/master/bias/enable_diag.py Tried also with C program:
But also get Any ideas how to enter diagnostic mode? |
@jiska2342 Had some troubles to get latest InternalBlue running. Had success with 0.3 release
Seems like the problem is also with
Ran as root. |
I can send other packets, but This works:
And this, does not:
|
Hi, Vendor diagnostics works on Linux as documented in https://github.com/seemoo-lab/internalblue/blob/master/doc/linux_bluez.md - but BlueZ fails on WICED eval boards with this, it's somewhere deep in the driver and broken. USB Broadcom is recognized correctly and you'll get a separate monitor device in Wireshark. The Sorry if this didn't work as you expected. Not sure what exactly the BIAS team did with LMP, as there are also other ways to get LMP out of the chip with binary patching etc. The current release is using Python 3, I guess that is why you got the other errors? |
Ah and maybe not entirely clear from the previous post: USB and UART are implemented differently within BlueZ. So, vendor diagnostics seem to only work in the combination USB and if the device ID indicates Broadcom, even though, in theory, USB+UART, Broadcom+Cypress know this feature. Definitely saw it working well on other stacks like Android as well as in the reverse-engineered firmware itself. @psy once looked into this BlueZ issue but the code is a mess ;) |
Wait what? https://github.com/francozappa/bias/blob/master/bias/enable_diag.py @francozappa how did you get this working? |
Thank you very much @jiska2342 Will try to compile bluez from source. Could this be the check you mentioned: bluez/bluez@eb907a1#diff-49758a48be328c46fa27adab91b6ba73 |
Hi @jiska2342 , Thanks for helping with the devboard setup. Once you attach to the devboard then you can send vendor-specific commands to activate diagnostic mode. I guess that you are doing a similar thing automatically with |
Hi @marcinguy, that looks pretty much like the check. H4 is the name of the UART protocol used. I'm not sure if that is the only check, though. Because you also need to define that HCI filter format as you had it in your raw C socket example. Also not sure how that socket error of the invalid argument is generated and how that is internally handled by BlueZ. The setup as it should work with the driver/chip combo is as follows:
As the combination of the correct chip and so on is rare, I only saw that once myself when I booted Ubuntu on a MacBook. I still have that MacBook here but not really the time to debug why all the other combinations do not work with BlueZ as they should be working. @francozappa you can always send vendor-specific HCI commands (H4 type 0x01) via BlueZ. However, BlueZ filters diagnostic messages (H4 type 0x07). Really, no idea how your code ever worked on BlueZ. And from a security perspective, it's a good thing to decouple the vendor-specific H4 packet type from the remaining stack. The Android stack also filters type 0x07 and this is one of the things our InternalBlue patch for Android 6+7 enables besides debugging over the BT snoop socket in general. The macOS and iOS stack are pretty much aware of all proprietary Broadcom features. Using Apple's Bluetooth PacketLogger, I initially found the H4 type 0x07. |
@jiska2342 Thank you again. Compiled bluez with adding 0x7 support in several places, but it seems Kernel is also involved. Tried to link C program against modified version of bluez also do GDB to skip the check of 0x7, but then it got another error. So it seems there is Kernel also involved here. But then I am a novice here :) I don't have the file
How can I see the LMP messages? Will try with @francozappa modified Kernel, seem like last resort: |
The file Ah and maybe another funny detail to add about the InternalBlue implementations of these stacks. On iOS as well as on Android 8+, we're currently just echoing into the UART device. For iOS, we disable On Linux, the access to On Android, if you enable diagnostics with 0x07, the stack will crash once it's getting the first 0x07 answer because it cannot parse it. On UART H4, each packet type has a slightly different format with hard-coded type, length, value. If you break it, the stack will decide to handle it as a hardware fault and start |
Probably the only way to get it working, yes. Definitely won't work on the normal BlueZ stack. |
@jiska2342 With the modified kernel it seems to work. |
Okay, great :D |
@jiska2342 To wrap up this subject. It seems like Bluez was not involved, hindering this. Only patched Kernel solved this. If you want I can make a PR to add link to @francozappa modified kernel to have it work in Linux/Bluez setup (I can provide full tree, compiled image). No need to touch Bluez. Feel free to close the issue from my side. |
If it's convenient for me to get the compiled image from you? Many thanks. |
I created a diff, which should make it easier to create a pre-compiled kernel :) https://github.com/seemoo-lab/internalblue/blob/master/linux/bias_linux-4.14.111.diff |
Hi,
Will this board work with Internalblue:
https://www.mouser.de/ProductDetail/Cypress-Semiconductor/CYW920819EVB-02?qs=%2Fha2pyFadugICnogBdJ27y6wc6auC18DiNMDVcMRKbY1cC%2FDSbgy9g%3D%3D
Seems like this is 02 revision.
Seems like it is also supported by Internalblue
internalblue/internalblue/fw/fw_0x220c.py
Line 47 in 96912a5
Not sure if in this revision.
Want to use it for: https://github.com/francozappa/bias tests.
Thanks,
The text was updated successfully, but these errors were encountered: