Skip to content

Commit

Permalink
app/bench: Fix strlen scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
jovanbulck committed Oct 1, 2024
1 parent 41a718d commit a9789e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/bench/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit a9789e3

Please sign in to comment.