-
Notifications
You must be signed in to change notification settings - Fork 20
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
sm_expected_hash.h is missing #2
Comments
We're currently in the middle of trying to figure out the best way to handle expected hash management. For enclave applications this isn't too bad, so we ship the current expected hash along with the newest enclave app version. Unfortunately for the security monitor, the hash is different depending on the target platform type (currently, between qemu and the hifive test board) since they use different boot processes. I'll put together a temporary set of instructions for generating/using a valid hash, and add a valid sm hash to the riscv-pk repo for now. If you've got any ideas we'd love to hear them! |
I'll think about that (haven't even seen the riscv-pk repo yet, tho), but in the meantime I worked around that (by just making a hash up, which somewhat disturbingly has not obviously broken anything), and now I get this:
|
I've pushed a working hash for the current sm, and updated the BUILDING file to indicate to copy it for now. I think you are on an old version of the keystone-demo, that hash and error message don't match up with the current enclave. We are currently moving to doing development in a new flow, new commits to the keystone meta-repo should be showing up under the dev branch shortly. You can pull to the latest version of the submodules if the dev branch isn't up to date yet. Bad hashes absolutely break the attestation flow (I just added a feature to the demo only for ignoring that during testing since generating the hash files is manual right now.) |
I only checked out keystone-demo a few hours ago. Not sure what you mean about the new flow and dev branch? which one is the meta repo? are you saying I should be on dev not master? or what? |
Apologies for the confusion. You checked it out while I was in the middle of merging in feature changes we made for our hardware demo. I'm getting things cleaned up right now :) If you checked out keystone/keystone (the meta-repo, containing mostly submodules) make sure you check out the dev branch of that. Second, for the keystone-demo, I've removed the extraneous branches. You should be on master for that. I realized the issue is likely that you are using the dummy client, which was supposed to get removed during a recent merge. It is no longer supported. Updated instructions on running the demo are available here momentarily: http://docs.keystone-enclave.org/en/dev/Keystone-Demo/Building.html I'll remove the old dummy client code. |
Ah, I see. I'm currently on a plane so I'm not sure how wise it would be to switch branches (given the many gigabytes of download the original one was) but I can give it a try. |
I just bumped and double checked the dev branch for keystone, and the master branch for keystone-demo. If you were working off keystone:master rather than keystone:dev we also switched to a dynamically loaded kernel module. This shouldn't affect the demo itself but the module now needs to be loaded before the host will work. (http://docs.keystone-enclave.org/en/dev/Getting-Started/Running-Keystone-with-QEMU.html#insert-keystone-driver) Let me know if you run into any issues with the trusted_client version. |
As a heads up, we're removing the demo documentation from the main docs page, and moving it into the keystone-demo repository. I'm also updating them based on the problems you've run into. Thanks for sticking with us :) Should be clear and up-to-date docs available shortly for the demo. |
Hmm. The switch to the dev branch has not gone well. I'm pretty good with git generally, but I find submodules confusing, I guess because I don't use them much. What am I supposed to do after checking out the dev branch to get the submodules back in sync? I fear I've broken my repo anyway, so that may be it for the day. |
Hi,
Can you try
git submodule sync
git submodule update --init
and see if there's no error?
and if linux-keystone-driver is checked out.
Thanks
Dayeol
…On Fri, Jan 11, 2019, 12:37 PM Ben Laurie ***@***.*** wrote:
Hmm. The switch to the dev branch has not gone well. I'm pretty good with
git generally, but I find submodules confusing, I guess because I don't use
them much.
What am I supposed to do after checking out the dev branch to get the
submodules back in sync?
I fear I've broken my repo anyway, so that may be it for the day.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB9sJ1ofLvfkxilYdKJBK8m7NzCWp7T2ks5vCPYCgaJpZM4Z7qWz>
.
|
Finally had time to try this. All works until I try ./test inside qemu, and then it fails with lots of this kind of thing:
|
If you are running the ./test script supplied by the sdk tests, I think its not currently insmod'ing the keystone driver by default since we made the switch to a module. Both the sdk tests and the demo should work if you do: I'll go add that to the test script. |
If you haven't compiled linux-keystone-driver, you need to compile it and copy the driver into disk image first.
and as David mentioned, you need to insert the module in QEMU guest
I know it is pretty annoying to manually run each of the commands. |
I was already doing that, so that's not it. BTW, I have the build as a makefile already. I was waiting for it to work before I sent a PR. |
Does that happen the first time you run the ./test script immediately after booting qemu? We've seen that problem when the module isn't loaded, or when we've had a memory leak or similar problem and the driver has run out of places to allocate enclaves in the past. So if the module is loaded and this is the first run of the boot we'll have to dig into it. Can you run |
Yes, immediately after booting.
|
All submodules seem to be correct. The most likely causes of the problem are: You can check (1) by accessing the security monitor memory 0x80000000.
If above command generates a kernel fault, it means that the security monitor is initialized, and the memory is protected by PMP. You can check (2) by Could you let us know if one of two were the cause? Also FYI, we have a script for travis CI in |
|
I still couldn't reproduce the issue in my end. Could you help me debug the issue by adding
You might need to re-compile sdk and copy binaries before launching QEMU.
|
Also, did you rebuild |
The error is "Inappropriate ioctl for device". And yes, I rebuilt everything. Note, by "rebuilt" I mean "followed the build instructions". I don't mean that I cleaned everything and built again. |
Opened a new issue keystone-enclave/keystone#29. |
@benlaurie, if you are still getting the same error, can you try with a fresh repo, fast-build.sh uses pre-built riscv toolchain instead of compiling all. I believe that the problem is somehow caused while moving around the branches. Also could you let me know which OS are you using? |
Closing the thread because it was inactive for a while. |
I get as far as
make trusted_client.riscv
and it fails with:The text was updated successfully, but these errors were encountered: