microsoft / Komodo

Formally-verified reference monitor for a secure isolated execution ("enclave") environment on ARM TrustZone
https://www.microsoft.com/en-us/research/project/komodo/
Other
102 stars 28 forks source link

stuck in RNG wait for test word #18

Open zpzigi opened 5 years ago

zpzigi commented 5 years ago

Hello, I used the recommended raspbian image(2016-05-10-raspbian-jessie) and the custom QEMU (b479fb060fe3f3090221a94fe9071c3cd2b207f0) to run Komodo on QEMU, but it is still stuck.

When I run Komodo on QEMU, it is stuck with the message "RNG wait for test word". I searched for the message in Komodo's source code and deleted the infinite loop about checking RNG status. Then, running Komodo on QEMU is stuck with the message "Uncompressing Linux... done, booting the kernel."

Before running QEMU, I copied config.txt and piimage.txt inside the guestdisk's FAT boot partition. For GUEST_KERNEL, I used the kernel7.img inside the raspbian image. Do I need to change any content in config.txt in piiamge folder before I copy it in the FAT boot partition? Currently, the contents in my config.txt is as follows (default). kernel=piimage.img kernel_address=0 kernel_old=1

Thank you in advance.

zpzigi commented 5 years ago

I could run Komodo on QEMU succesfully by using the linux kernel image I built instead of using the kernel7.img inside the raspbian's FAT boot partition. The problem about being stuck in "RNG wait for test word" still remains. I temporarily passed it by commenting out the infinite loop after the message.

0xabu commented 5 years ago

This is a bug, and it's my fault -- sorry! We added that feature late (commit aeeb07d8) and at that point were only running on real Pi2 hardware. QEMU (at least the version on my branch) doesn't emulate the RNG, so the livelock there is expected. Commenting it as you've done will let you boot, but it isn't a complete fix -- as soon as an enclave calls the GET_RANDOM SVC, you'll be stuck in the same loop in the monitor implementation. The correct fix is to emulate the RNG device in QEMU.

I'm not sure why the default kernel didn't work for you; that's the same thing I was using. Note that the bootloader has a hard-coded kernel command line for QEMU:

console=ttyAMA0,115200 root=/dev/mmcblk0p2 root fstype=ext4 rootwait earlyprintk loglevel=8 init=/bin/bash nosmp

… perhaps this wasn't right for some reason. You can edit it in piloader/atags.c.