Discussion:
BluetoothLE kernel crypto api
(too old to reply)
Stiefel
2018-11-22 06:43:11 UTC
Permalink
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
--
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 android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Stiefel
2018-11-22 07:44:39 UTC
Permalink
Yes I found those but I was not sure if they were used as default if
nothing was set for the kernel.
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.
https://osdn.net/projects/android-x86/scm/git/kernel/tree/kernel-4.18/arch/x86/configs/
(change to the branch you want to see)
Post by Stiefel
Hi,
first of all thanks for accepting me to the group. And now the
question/story.
Post by Stiefel
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.
Post by Stiefel
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
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.
Post by Stiefel
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
https://gist.github.com/stiefel40k/bb86cfc62a4de40172d96b91a1436091) The
issue comes as soon as bind is called.
Post by Stiefel
To be clear this test works on my laptop as well as inside an official
image. Only the images I build fail.
Post by Stiefel
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.
Post by Stiefel
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.
Post by Stiefel
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.
Post by Stiefel
Thanks for the help in advance!
Cheers,
stiefel
--
You received this message because you are subscribed to the Google
Groups "Android-x86" group.
Post by Stiefel
To unsubscribe from this group and stop receiving emails from it, send
<javascript:>.
Post by Stiefel
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
--
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 android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Stiefel
2018-11-22 08:08:31 UTC
Permalink
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...
Post by Stiefel
Yes I found those but I was not sure if they were used as default if
nothing was set for the kernel.
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.
https://osdn.net/projects/android-x86/scm/git/kernel/tree/kernel-4.18/arch/x86/configs/
(change to the branch you want to see)
Post by Stiefel
Hi,
first of all thanks for accepting me to the group. And now the
question/story.
Post by Stiefel
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.
Post by Stiefel
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
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.
Post by Stiefel
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
https://gist.github.com/stiefel40k/bb86cfc62a4de40172d96b91a1436091) The
issue comes as soon as bind is called.
Post by Stiefel
To be clear this test works on my laptop as well as inside an official
image. Only the images I build fail.
Post by Stiefel
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.
Post by Stiefel
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.
Post by Stiefel
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.
Post by Stiefel
Thanks for the help in advance!
Cheers,
stiefel
--
You received this message because you are subscribed to the Google
Groups "Android-x86" group.
Post by Stiefel
To unsubscribe from this group and stop receiving emails from it, send
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
--
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 android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...