Issues when implementing memory encryption #1660
Unanswered
moritz-x64
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,$0xfefefe...fe$ with a length of 64 bytes again. The code is shown below.
I am currently trying to implement memory encryption in gem5 at the DRAM level. Each access to the DRAM should be encrypted and decrypted transparently. Currently the encryption is done in the
AbstractMemory
class. Specifically in theaccess()
andfunctionalAccess()
functions. Full blocks of 64 bytes are encrypted and decrypted and the actual data is read/written at an offset. For testing purposes, the encryption consists of a simple XOR operation with a key likeWhen I try to run a FS simulation with the provided
x86-ubuntu-run.py
, it crashes early with a BadAddressError. From my observations, encryption and offset reads and writes are working fine because when the key is set to all zeros the kernel boots as expected. On closer inspection of a trace, I noticed that the kernel functioncopy_bootdata
is already doing some memory accesses, reading data that should all be zero, but instead is 0x00000000fefefefe. This leads me to the conclusion that at some point the memory is set to zero without using timing or functional accesses which would encrypt the 0x00 to 0xfe. Because when read, the zeroed data will be xored with 0xfe, resulting in 0xfe.The actual crash at the end is caused by a corrupted address translation, which also looks also very suspicious with all those 0xfe bytes:
Any help in identifying the potential write byassing
access()
andfunctionalAccess()
or other things I may have overlooked is greatly appreciated.Beta Was this translation helpful? Give feedback.
All reactions