Skip to content
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

victim.base && "no enclave found in /proc/self/maps #54

Closed
Homyee opened this issue Oct 1, 2022 · 4 comments
Closed

victim.base && "no enclave found in /proc/self/maps #54

Homyee opened this issue Oct 1, 2022 · 4 comments

Comments

@Homyee
Copy link

Homyee commented Oct 1, 2022

hello
when i run app/aep-redirect, the error happen

idt.c] locking IRQ handler pages 0x558324224000/0x55832422a000 [main.c] Creating enclave... [main.c] Dry run to allocate pages [main.c] revoking data page access rights.. [main.c] data at 0x7f200d811190 with PTE: [pt.c] /dev/sgx-step opened! [pt.c] /dev/mem opened! +-------------------------------------------------------------------------------------------+ | XD | PK | IGN | RSVD | PHYS ADRS | IGN | G | PAT | D | A | PCD | PWT | U/S | R/W | P | | 1 | x | x | 0 | 0x00008097f000 | x | x | x | 0 | 1 | x | x | 1 | 1 | 1 | +-------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------+ | XD | PK | IGN | RSVD | PHYS ADRS | IGN | G | PAT | D | A | PCD | PWT | U/S | R/W | P | | 0 | x | x | 1 | 0x007f7f680000 | x | x | x | 0 | 1 | x | x | 0 | 0 | 0 | +-------------------------------------------------------------------------------------------+ [main.c] revoking code page access rights.. [main.c] code at 0x7f200d803000 with PTE: +-------------------------------------------------------------------------------------------+ | XD | PK | IGN | RSVD | PHYS ADRS | IGN | G | PAT | D | A | PCD | PWT | U/S | R/W | P | | 0 | x | x | 0 | 0x000080971000 | x | x | x | 0 | 1 | x | x | 1 | 0 | 1 | +-------------------------------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------+ | XD | PK | IGN | RSVD | PHYS ADRS | IGN | G | PAT | D | A | PCD | PWT | U/S | R/W | P | | 0 | x | x | 1 | 0x007f7f68e000 | x | x | x | 0 | 1 | x | x | 0 | 0 | 0 | +-------------------------------------------------------------------------------------------+ ==== Victim Enclave ==== [enclave.c] assertion 'victim.base && "no enclave found in /proc/self/maps"' failed: No such file or directory Aborted

How could I solve it? Thanks.

@jovanbulck
Copy link
Owner

jovanbulck commented Oct 1, 2022

Hm this error indicates that the created enclave cannot be found in the process address space. Possible causes could be:

  • Are you running in SGX hardware mode and didn't change the Makefiles to run in simulation mode or so?
  • Are you using one of the supported drivers /dev/isgx or /dev/sgx_enclave?

If the error persists, could you please post the debug output of virtual address space layout, by enabling this line?

@Homyee
Copy link
Author

Homyee commented Oct 1, 2022

I did nothing , I didn't change the Makefile, I follow the installation instructions step by step,then the error happen

the virtual address space layout:

555555554000-555555555000 r--p 00000000 103:0b 1446897 /home/homyee/Documents/sgx-step/app/aep-redirect/app
555555555000-55555555a000 r-xp 00001000 103:0b 1446897 /home/homyee/Documents/sgx-step/app/aep-redirect/app
55555555a000-55555555b000 r-xp 00006000 103:0b 1446897 /home/homyee/Documents/sgx-step/app/aep-redirect/app
55555555b000-55555555e000 r--p 00007000 103:0b 1446897 /home/homyee/Documents/sgx-step/app/aep-redirect/app
55555555e000-55555555f000 r--p 00009000 103:0b 1446897 /home/homyee/Documents/sgx-step/app/aep-redirect/app
55555555f000-555555560000 rw-p 0000a000 103:0b 1446897 /home/homyee/Documents/sgx-step/app/aep-redirect/app
555555560000-555555561000 rw-p 0000b000 103:0b 1446897 /home/homyee/Documents/sgx-step/app/aep-redirect/app
555555561000-555555582000 rw-p 00000000 00:00 0 [heap]
7ffff7600000-7ffff7601000 r--s 00000000 00:05 85 /dev/sgx_enclave
7ffff7601000-7ffff760d000 r-xs 00000000 00:05 85 /dev/sgx_enclave
7ffff760d000-7ffff7610000 r--s 00000000 00:05 85 /dev/sgx_enclave
7ffff7610000-7ffff7611000 r--s 00000000 00:05 85 /dev/sgx_enclave
7ffff7611000-7ffff7716000 rw-s 00001000 00:05 85 /dev/sgx_enclave
7ffff7716000-7ffff7726000 ---p 00000000 00:00 0
7ffff7726000-7ffff7766000 rw-s 00000000 00:05 85 /dev/sgx_enclave
7ffff7766000-7ffff7776000 ---p 00000000 00:00 0
7ffff7776000-7ffff7779000 rw-s 00000000 00:05 85 /dev/sgx_enclave
7ffff7779000-7ffff7789000 ---p 00000000 00:00 0
7ffff7789000-7ffff778a000 rw-s 00000000 00:05 85 /dev/sgx_enclave
7ffff778a000-7ffff7800000 ---p 00000000 00:00 0
7ffff79e3000-7ffff79e6000 rw-p 00000000 00:00 0
7ffff79e6000-7ffff79f3000 r--p 00000000 103:0a 3539064 /usr/lib/x86_64-linux-gnu/libm-2.31.so
7ffff79f3000-7ffff7a9a000 r-xp 0000d000 103:0a 3539064 /usr/lib/x86_64-linux-gnu/libm-2.31.so
7ffff7a9a000-7ffff7b33000 r--p 000b4000 103:0a 3539064 /usr/lib/x86_64-linux-gnu/libm-2.31.so
7ffff7b33000-7ffff7b34000 r--p 0014c000 103:0a 3539064 /usr/lib/x86_64-linux-gnu/libm-2.31.so
7ffff7b34000-7ffff7b35000 rw-p 0014d000 103:0a 3539064 /usr/lib/x86_64-linux-gnu/libm-2.31.so
7ffff7b35000-7ffff7b37000 rw-p 00000000 00:00 0
7ffff7b37000-7ffff7b3a000 r--p 00000000 103:0a 3539318 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff7b3a000-7ffff7b4c000 r-xp 00003000 103:0a 3539318 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff7b4c000-7ffff7b4f000 r--p 00015000 103:0a 3539318 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff7b4f000-7ffff7b50000 ---p 00018000 103:0a 3539318 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff7b50000-7ffff7b51000 r--p 00018000 103:0a 3539318 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff7b51000-7ffff7b52000 rw-p 00019000 103:0a 3539318 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff7b52000-7ffff7beb000 r--p 00000000 103:0a 3562229 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.29
7ffff7beb000-7ffff7cef000 r-xp 00099000 103:0a 3562229 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.29
7ffff7cef000-7ffff7d5b000 r--p 0019d000 103:0a 3562229 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.29
7ffff7d5b000-7ffff7d66000 r--p 00208000 103:0a 3562229 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.29
7ffff7d66000-7ffff7d69000 rw-p 00213000 103:0a 3562229 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.29
7ffff7d69000-7ffff7d6c000 rw-p 00000000 00:00 0
7ffff7d6c000-7ffff7d6d000 r--p 00000000 103:0a 3539063 /usr/lib/x86_64-linux-gnu/libdl-2.31.so
7ffff7d6d000-7ffff7d6f000 r-xp 00001000 103:0a 3539063 /usr/lib/x86_64-linux-gnu/libdl-2.31.so
7ffff7d6f000-7ffff7d70000 r--p 00003000 103:0a 3539063 /usr/lib/x86_64-linux-gnu/libdl-2.31.so
7ffff7d70000-7ffff7d71000 r--p 00003000 103:0a 3539063 /usr/lib/x86_64-linux-gnu/libdl-2.31.so
7ffff7d71000-7ffff7d72000 rw-p 00004000 103:0a 3539063 /usr/lib/x86_64-linux-gnu/libdl-2.31.so
7ffff7d72000-7ffff7d73000 r--p 00000000 103:0a 3548651 /usr/lib/x86_64-linux-gnu/libsgx_enclave_common.so.1.1.123.1
7ffff7d73000-7ffff7d78000 r-xp 00001000 103:0a 3548651 /usr/lib/x86_64-linux-gnu/libsgx_enclave_common.so.1.1.123.1
7ffff7d78000-7ffff7d7a000 r--p 00006000 103:0a 3548651 /usr/lib/x86_64-linux-gnu/libsgx_enclave_common.so.1.1.123.1
7ffff7d7a000-7ffff7d7b000 r--p 00007000 103:0a 3548651 /usr/lib/x86_64-linux-gnu/libsgx_enclave_common.so.1.1.123.1
7ffff7d7b000-7ffff7d7c000 rw-p 00008000 103:0a 3548651 /usr/lib/x86_64-linux-gnu/libsgx_enclave_common.so.1.1.123.1
7ffff7d7c000-7ffff7d9e000 r--p 00000000 103:0a 3539043 /usr/lib/x86_64-linux-gnu/libc-2.31.so
7ffff7d9e000-7ffff7f16000 r-xp 00022000 103:0a 3539043 /usr/lib/x86_64-linux-gnu/libc-2.31.so
7ffff7f16000-7ffff7f64000 r--p 0019a000 103:0a 3539043 /usr/lib/x86_64-linux-gnu/libc-2.31.so
7ffff7f64000-7ffff7f68000 r--p 001e7000 103:0a 3539043 /usr/lib/x86_64-linux-gnu/libc-2.31.so
7ffff7f68000-7ffff7f6a000 rw-p 001eb000 103:0a 3539043 /usr/lib/x86_64-linux-gnu/libc-2.31.so
7ffff7f6a000-7ffff7f6e000 rw-p 00000000 00:00 0
7ffff7f6e000-7ffff7f74000 r--p 00000000 103:0a 3539171 /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
7ffff7f74000-7ffff7f85000 r-xp 00006000 103:0a 3539171 /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
7ffff7f85000-7ffff7f8b000 r--p 00017000 103:0a 3539171 /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
7ffff7f8b000-7ffff7f8c000 r--p 0001c000 103:0a 3539171 /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
7ffff7f8c000-7ffff7f8d000 rw-p 0001d000 103:0a 3539171 /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
7ffff7f8d000-7ffff7f93000 rw-p 00000000 00:00 0
7ffff7f93000-7ffff7f9a000 r--p 00000000 103:0a 1968628 /usr/lib/libsgx_urts.so
7ffff7f9a000-7ffff7fad000 r-xp 00007000 103:0a 1968628 /usr/lib/libsgx_urts.so
7ffff7fad000-7ffff7fb5000 r--p 0001a000 103:0a 1968628 /usr/lib/libsgx_urts.so
7ffff7fb5000-7ffff7fb6000 ---p 00022000 103:0a 1968628 /usr/lib/libsgx_urts.so
7ffff7fb6000-7ffff7fb7000 r--p 00022000 103:0a 1968628 /usr/lib/libsgx_urts.so
7ffff7fb7000-7ffff7fb9000 rw-p 00023000 103:0a 1968628 /usr/lib/libsgx_urts.so
7ffff7fb9000-7ffff7fbd000 rw-p 00000000 00:00 0
7ffff7fcf000-7ffff7fd0000 r--p 00000000 103:0a 3539017 /usr/lib/x86_64-linux-gnu/ld-2.31.so
7ffff7fd0000-7ffff7ff3000 r-xp 00001000 103:0a 3539017 /usr/lib/x86_64-linux-gnu/ld-2.31.so
7ffff7ff3000-7ffff7ffb000 r--p 00024000 103:0a 3539017 /usr/lib/x86_64-linux-gnu/ld-2.31.so
7ffff7ffc000-7ffff7ffd000 r--p 0002c000 103:0a 3539017 /usr/lib/x86_64-linux-gnu/ld-2.31.so
7ffff7ffd000-7ffff7ffe000 rw-p 0002d000 103:0a 3539017 /usr/lib/x86_64-linux-gnu/ld-2.31.so
7ffff7ffe000-7ffff7fff000 rw-p 00000000 00:00 0
7ffffffde000-7ffffffff000 rwxp 00000000 00:00 0 [stack]
ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0 [vsyscall]

@jovanbulck
Copy link
Owner

Hi Homyee,

Thanks for following up with the extra info. This turned out to be a bug in the /proc/self/maps scanf parsing, good catch!

The commit above should fix this now (at least the parsing works correctly on my system with the layout you provided above).

Let me know if this fixes it for you? And if not, feel free to re-open the issue!

Hope it helps!

@Homyee
Copy link
Author

Homyee commented Oct 2, 2022

Hi jovanbulck,
It works!
Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants