From a9789e3e71438d35f2ae6e7e0a7c4f67e99c7157 Mon Sep 17 00:00:00 2001 From: Jo Van Bulck Date: Tue, 1 Oct 2024 16:23:32 +0000 Subject: [PATCH] app/bench: Fix strlen scenario --- README.md | 10 +++------- app/bench/main.c | 4 ++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4aa7493..a168a32 100644 --- a/README.md +++ b/README.md @@ -255,16 +255,12 @@ $ make run ``` To test timer single-stepping functionality, try for example building and -running the `strlen` attack from the paper for a benchmark enclave that -processes the secret string 100 repeated times: +running a benchmark enclave to single-step a slide of 100 successive `nop` +instructions: ```bash $ cd app/bench -$ NUM=100 STRLEN=1 make parse # alternatively vary NUM and use BENCH=1 or ZIGZAG=1 -$ # (above command defaults to the Dell Inspiron 13 7359 evaluation laptop machine; -$ # use DESKTOP=1 to build for a Dell Optiplex 7040 machine) -$ # use SGX_SDK=/home/jo/sgxsdk/ for a local SDK installation -$ # use M32=1 To produce a 32-bit executable +$ NUM=100 make parse # alternatively vary NUM and use STRLEN=1 or ZIGZAG=1 ``` The above command builds `libsgxstep`, the benchmark victim enclave, and the diff --git a/app/bench/main.c b/app/bench/main.c index 1a029e1..1a1bb72 100644 --- a/app/bench/main.c +++ b/app/bench/main.c @@ -133,8 +133,8 @@ void attacker_config_runtime(void) { void attacker_config_page_table(void) { void *code_adrs; #if (ATTACK_SCENARIO == STRLEN) - void *str_adrs; - str_adrs = get_symbol_offset("secret_str"); + void *str_adrs = get_enclave_base(); + str_adrs += get_symbol_offset("secret_str"); info("enclave string adrs at %p", str_adrs); ASSERT(pte_str_encl = remap_page_table_level(str_adrs, PTE)); ASSERT(PRESENT(*pte_str_encl));