-
Notifications
You must be signed in to change notification settings - Fork 33
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
Blacksmith on non-Coffee Lake CPUs #4
Comments
Hi @hariv The DRAM address functions are obtained from an i7-8700K (Coffee Lake). It is very likely that those functions are different on other CPUs. In this case, you would need to first-reverse engineer them (e.g., using DRAMA or TRRespass' DRAMA) and then update the DRAM addressing matrices in DRAMAddr.cpp. |
Got it. Thank you @pjattke. |
Hi. @pjattke.
|
Could we get any followup on this? I used DRAMA tool as well and obtained memory functions, but don't know how to input them into the code. |
Dear @heechul and @DominikBucko, I'm sorry for the late reply but I didn't have time to work on that yet. I'll soon (in the next days) provide you with a script that generates the addressing matrices that you can input into Blacksmith. Thanks for your patience and understanding! |
Dear @heechul and @DominikBucko, Finally, I managed to find some time to update our DRAM addressing matrices script. Sorry for the delay. You can find the script Regards, |
Hi @pjattke Thanks a lot for sharing the script. I have a question. If I'm not mistaken, the output of the script seems a bit different from the default configuration in the blacksmith repository when dram_fns and row_fn in the script was configured to match with the known functions in the repository (i.e., dram_fns = [0x2040, 0x24000, 0x48000, 0x90000], row_fn = 0x3ffe0000). For example, in the aforementioned single_rank configuration, DRAM_MTX[4] - DRAM_MTX[10] are shifted right by 1 bit in the generated matrix compared to the matrix in the code repository. Can you clarify on this? Thanks Heechul. |
Hi @heechul To summarize what my colleague told me, who has implemented this part of Blacksmith:
This is because the bank/rank functions on our CPU (i7-8700K) consist each of two bits that are combined by XOR. So if you change any of them, you will end up in a different bank. However, coming back to your question: I cannot tell why the output is different (shifted by one bit). My colleague told me that he will look into this more once he finds time. Meanwhile, you can just try to use the output generated by mat-gen.py and report back if that worked for you. In any way, I will try to replace this DRAM addressing part in the next couple of weeks by something that makes it easier to work with as I recognize that the current solution is cumbersome. |
Hi @pjattke Thanks for following this up.
Thanks |
Dear @heechul, Thanks for your update.
Regards, |
Hi @pjattke Thanks for confirming the annotation. Happy new year! |
Hi Patrik, for an i3-8350k system I have created a log with DRAMA, see attachment. |
Hi @JKRde, |
Hi Patrik, Unfortunately I have not yet managed to determine the BR |
Hi @pjattke , ~~~~~~~~~~ Found Functions ~~~~~~~~~~
Valid Function: 0x8000 bits: 15
Valid Function: 0x10000 bits: 16
Valid Function: 0x20080 bits: 7 + 17
Valid Function: 0x1000040 bits: 6 + 24
Valid Function: 0x2200000 bits: 21 + 25
Valid Function: 0x4400000 bits: 22 + 26
Valid Function: 0x8800000 bits: 23 + 27
Valid Function: 0x145140 bits: 6 + 8 + 12 + 14 + 18 + 20
0x8000
0x10000
0x20080
0x1000040
0x2200000
0x4400000
0x8800000
0x145140
~~~~~~~~~~ Looking for row bits ~~~~~~~~~~
[LOG] - Set #0
[LOG] - 184716da80 - 18824693eb Time: 273 <== GOTCHA
[LOG] - 184716da80 - 18553ecda1 Time: 270 <== GOTCHA
[LOG] - 184716da80 - 18160cf469 Time: 270 <== GOTCHA
[LOG] - 184716da80 - 189352a594 Time: 267 <== GOTCHA
[LOG] - 184716da80 - 180714b92f Time: 264 <== GOTCHA
[LOG] - Set #1
[LOG] - 1833714c40 - 18541b138a Time: 273 <== GOTCHA
[LOG] - 1833714c40 - 1899d90349 Time: 276 <== GOTCHA
[LOG] - 1833714c40 - 18373f65f1 Time: 279 <== GOTCHA
[LOG] - 1833714c40 - 1808cd7a0f Time: 279 <== GOTCHA
[LOG] - 1833714c40 - 1822712c20 Time: 279 <== GOTCHA
[LOG] - Row mask: 0xffff800000 bits: 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39
0xffff800000 Continuously, I parse them into the script mat-gen.py as below. num_channels = 4
num_dimms = 16
num_ranks = 2
num_banks = 16
dram_fns = [0x8000, 0x10000, 0x20080, 0x1000040, 0x2200000, 0x4400000, 0x8800000, 0x145140]
row_fn = 0xffff800000
col_fn = 8192 - 1 However, the script mat-gen.py will throw the error because https://gist.github.com/pjattke/b56baff62be77f16ad8d33376789be67#file-mat-gen-py-L56 requires a 30x30 square which is not satisfied by my drama result and parsed info in mat-gen.py. |
Hi @TheSilentDawn. Thanks for your interest in Blacksmith. Could you please provide us with some more information:
The Best |
Hi @pjattke ,
num_channels = 1
num_dimms = 1
num_ranks = 2
num_banks = 16 I rerun drama from trrespass. The result is below. root@ubuntu: ~/trrespass-master/drama/obj#./tester -s 16 -t 460 -o access.csv -v
...
~~~~~~~~~~ Found Functions ~~~~~~~~~~
Valid Function: 0x2000 bits: 13
Valid Function: 0x200040 bits: 6 + 21
Valid Function: 0x440000 bits: 18 + 22
Valid Function: 0x880000 bits: 19 + 23
Valid Function: 0x1100000 bits: 20 + 24
0x2000
0x200040
0x440000
0x880000
0x1100000
~~~~~~~~~~ Looking for row bits ~~~~~~~~~~
[LOG] - Set #0
[LOG] - 3d6b5b940 - 3bb6a30f0 Time: 413 <== GOTCHA
[LOG] - 3d6b5b940 - 39cb725cd Time: 407 <== GOTCHA
[LOG] - 3d6b5b940 - 3aa59e8af Time: 458 <== GOTCHA
[LOG] - 3d6b5b940 - 3e097750e Time: 458 <== GOTCHA
[LOG] - 3d6b5b940 - 3961e2b9a Time: 458 <== GOTCHA
[LOG] - Set #1
[LOG] - 3c86ac200 - 3e0485651 Time: 458 <== GOTCHA
[LOG] - 3c86ac200 - 3e8c106cb Time: 458 <== GOTCHA
[LOG] - 3c86ac200 - 3b1f18208 Time: 458 <== GOTCHA
[LOG] - 3c86ac200 - 3f53f1a9f Time: 458 <== GOTCHA
[LOG] - 3c86ac200 - 3ddf18e91 Time: 458 <== GOTCHA
[LOG] - Row mask: 0xffff000000 bits: 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39
0xffff000000 Based on my understanding the variable dram_fns in mat-gen.py should be configurated as [0x2000, 0x200040, 0x440000, 0x880000, 0x1100000] and the variable row_fn should be configurated as 0xffff000000 following the result from trrespass drama. However, I'm confused with the variable col_fn, which value should it be? If I try to create a 30x30 matrix, it should be 524288 - 1. But the script mat-gen.py will throw an error meaning not invertible. |
Hi @pjattke , xxx:~/trrespass-master/drama # ./obj/tester -s 8 -o ddr3.csv -v
~~~~~~~~~~ Found Functions ~~~~~~~~~~
Valid Function: 0x4000 bits: 14
Valid Function: 0x80000 bits: 19
Valid Function: 0x42000 bits: 13 + 18
0x4000
0x80000
0x42000
~~~~~~~~~~ Looking for row bits ~~~~~~~~~~
[LOG] - Set #0
[LOG] - 2d9cde780 - 2fe09de11 Time: 288 <== GOTCHA
[LOG] - 2d9cde780 - 2de7842b5 Time: 280 <== GOTCHA
[LOG] - 2d9cde780 - 2a4b8df0f Time: 272 <== GOTCHA
[LOG] - 2d9cde780 - 2e74ac4b4 Time: 280 <== GOTCHA
[LOG] - 2d9cde780 - 2b10de59e Time: 304 <== GOTCHA
[LOG] - Set #1
[LOG] - 2f0f163c0 - 2b636d892 Time: 280 <== GOTCHA
[LOG] - 2f0f163c0 - 2af73e536 Time: 304 <== GOTCHA
[LOG] - 2f0f163c0 - 29eb7593b Time: 284 <== GOTCHA
[LOG] - 2f0f163c0 - 2d2d4c2c3 Time: 284 <== GOTCHA
[LOG] - 2f0f163c0 - 2f3074bc3 Time: 276 <== GOTCHA
[LOG] - Row mask: 0xffff000000 bits: 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39
0xffff000000 Could you please help to explain what configuration should be in mat-gen.py? |
Hi @TheSilentDawn. I'm sorry, but I do not have the resources anytime in near future to help with this further. There is a little chance that one of my students will have the time to make You will need to study the I'm sorry that I cannot give you a more positive reply. I hope you understand. Good luck! |
@pjattke We have a student who is using blacksmith in a project. As part of the project he did some polishing on the address function import part of blacksmith and will post a PR soon. |
Has anyone successfully caused bitflips on DRAMs produced by Blacksmith between 2023-2024 ? I ran the project without any error message, but I didn't flip any bits on any DRAMs.Has this method now become impossible to bypass the existing TRR mechanism? |
Hi @missyoufenglan87, we have also found more recent DIMMs where we could not trigger bit flips with Blacksmith anymore. We have not investigated this further on a larger scale though. It is likely that the DRAM vendors meanwhile have improved their mitigations. |
Great work and this repo is the best and the only we can Confirmed Reproduce. Memory Module: HMA81GU6JJR8N-VK This is a 1 Rank 16 Banks module. Steps:
|
Thanks for your sharing, I have the same dram_fns and row_fn results after running the Trrespass/Drama, and I followed your steps to update the mat-gen.py, DRAMAddr.cpp, and GlobalDefines.hpp. However, when I run the blacksmith program, it is always running without print any information to the stdout.log, even though I use the I tried to update the threshold in GlobalDefines.hpp, in Trrespass/Drama, I got the threshold of row buffer conflict should be around 300, and I use this value, but it print "Could not find conflicting address sets. Is the number of banks (8) defined correctly?". If I update this threshold to be 430 (the default value in this repo), it just run without stop and does not print anything. I appreciate if you can tell me any hints about this issue. |
@jpjy
|
Thanks for your prompt reply. I tried
|
Congrats on making it to work. I think the author made it quite clear that only a portion of CPU are supported, so I would recommand you to confirm you are using the supported one of their list. I tried this project on two independent |
Thanks for your suggestions and happy holiday. I will try other memory modules. |
Thanks for your prompt reply@pjattke . I deployed your latest project "Zenhammer" to the Intel platform and successfully caused the flip, but haven't found your code for bit flip exploitation as mentioned in your paper. I wonder if you can provide this part of code at your convenience. |
@missyoufenglan87 Could you please drop me an email regarding that. You can find my mail address on the Blacksmith paper, thanks! |
@pjattke I have sent an email to your ETH mailbox,Looking forward to your reply, thanks again |
Did anyone try running blacksmith on CPUs other than Coffee Lake?
I was able to run it successfully on Kaby Lake, but it didn't work on Comet Lake. It errors out immediately saying it could not find conflicting address sets and asks if the number of banks has been defined correctly (which I checked is correct).
The text was updated successfully, but these errors were encountered: