BluetoothLE kernel crypto api

35 views
Skip to first unread message

Stiefel

unread,
Nov 22, 2018, 1:43:11 AM11/22/18
to Android-x86
Hi,

first of all thanks for accepting me to the group. And now the question/story.

I'm currently trying to port the TaintDroid framework, that it works with VirtualBox. The reason for that is, that I need Bluetooth access for my project, which is not provided within the Android emulator. I managed to update TaintDroid from 4.3 to 4.4.4 through 4.3.1, however the Bluetooth doesn't seem to cooperate.

The Bluetooth USB-Adapter seems to work as expected. If I download one of the official ISOs from the website, they boot without an issue, and They can start my BLE-Testapp without an issue. (Testproject here:  https://github.com/googlesamples/android-BluetoothLeGatt) However if I build the ISO myself (even without the TaintDroid changes) the bluetoothd daemon crashes partially on start. After adding a lot of Log-Outputs to the Bluez library I managed to trace the origin of the error. 

As the Bluez initializes the Gatt sub-system for BLE it tries to use the Cryptop API of the kernel, however it can't bind to the socket as it throws a "No such file or directory"-Error. To test this efficiently and relatively independent from the big Android system I wrote a small test-program. (Test program here: https://gist.github.com/stiefel40k/bb86cfc62a4de40172d96b91a1436091) The issue comes as soon as bind is called.

To be clear this test works on my laptop as well as inside an official image. Only the images I build fail.

My first idea was, that the kernel was probably configured wrong, or it doesn't support the desired algorithms. The second idea was quickly dropped, as every supported algorithm is listed in /proc/crypto. To verify this one can unload for example the Intel AES module, and quickly a big portion of the algorithms disappear and upon loading the module reappear. So it leaves us with the kernel config. Unfortunately the android-x86 kernels are not configured to export their config into proc so I had to improvise. At the start I used the default kernel config, which indeed doesn't support user-space access to the kernel Crypto API, so I quickly changed that and recompiled the kernel (to be honest without clean). And started the new ISO, but binding error stayed.

My next idea was, that the kernel still might be configured wrong, so I extracted the kernel image from the original ISO which I downloaded, rebuilt the ISO with this kernel image and spun it up again, and the error is still there. What I didn't do until now, is that putting my kernel into the original image, and see what happens, because if it works fine, would mean that the kernel itself is correct, but something else is wrong.

At this point I'm a bit lost and I was wondering if somebody could either provide the original kernel configs for Android 4.4 and 5.1, or guide me to a new direction which might solve this issue.

Thanks for the help in advance!
Cheers,
stiefel

Chih-Wei Huang

unread,
Nov 22, 2018, 2:33:18 AM11/22/18
to Android-x86
Android-x86 kernel has been configured to
export the config through /proc/config.gz
(i.e. CONFIG_IKCONFIG_PROC=y) for years.

For the very old release, this is not enabled.
But you can still find the config in our kernel repo:

https://osdn.net/projects/android-x86/scm/git/kernel/tree/kernel-4.18/arch/x86/configs/

(change to the branch you want to see)

Stiefel <gabor...@gmail.com> 於 2018年11月22日 週四 下午2:43寫道:
> --
> You received this message because you are subscribed to the Google Groups "Android-x86" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
> To post to this group, send email to andro...@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-x86.
> For more options, visit https://groups.google.com/d/optout.



--
Chih-Wei
Android-x86 project
http://www.android-x86.org

Stiefel

unread,
Nov 22, 2018, 2:44:39 AM11/22/18
to Android-x86
Yes I found those but I was not sure if they were used as default if nothing was set for the kernel.

Stiefel

unread,
Nov 22, 2018, 3:08:31 AM11/22/18
to Android-x86
Ok nvm. I found the http://www.android-x86.org/documents/customizekernel site, so yeah it must be the right one...but then I don't understand why it doesn't work...
Reply all
Reply to author
Forward
0 new messages