ssrg-vt / popcorn-chameleon

Secure Popcorn Linux runtime state transformation framework
GNU General Public License v3.0
4 stars 1 forks source link

Running chameleon error #3

Open xjtuwxg opened 5 years ago

xjtuwxg commented 5 years ago

Follow the install instruction, and compile the application with the following Makefile:

PREFIX     = /home/xgwang/extdisk/chameleon/install/
CC         = $(PREFIX)/x86_64/bin/musl-clang
CFLAGS     = -static -popcorn-metadata -popcorn-target=x86_64-linux-gnu -secure-popcorn \
             -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mno-red-zone
STACK      = $(PREFIX)/bin/gen-stackinfo
CHAMELEON = /home/xgwang/extdisk/chameleon/popcorn-chameleon/build/bin/chameleon
SRC        = main.c
BIN        = main

all: compile stack

compile:
        @echo "Compile:"
        $(CC) $(CFLAGS) $(SRC) -o $(BIN)

stack:
        @echo "Gen stackinfo:"
        $(STACK) -f $(BIN)

run:
        $(CHAMELEON) -d -- $(BIN)

Got a running error as follows: It seems there is a segmentation fault happens when doing compel_stop_on_syscall

[    src/transform.cpp:1469 ] DEBUG: 4001c8 size = 1  ret    %rsp (%rsp)[8byte] -> %rsp
[    src/transform.cpp:1132 ] DEBUG:  -> detected offset 8
[    src/transform.cpp:1573 ] DEBUG: rewrote 3 instruction(s)
[    src/transform.cpp:1601 ] DEBUG: randomizing function took 1818 us
[    src/transform.cpp:177  ] DEBUG: code randomization time: 3837 us
[      src/process.cpp:583  ] DEBUG: 2236: stealing userfault from child
[ compel ] DEBUG: LC3: Set up parasite blob using memfd
[ compel ] DEBUG: LC3: Putting parasite blob into 0x7f457cf08000->0x7fa5c20b0000
[ compel ] DEBUG: LC3: Dumping general registers for 2236 in native mode
[ compel ] DEBUG: LC4: cpu: x86_family 21 x86_vendor_id AuthenticAMD x86_model_id AMD Opteron 63xx class CPU
[ compel ] DEBUG: LC4: cpu: fpu: xfeatures_mask 0x5 xsave_size 832 xsave_size_max 832 xsaves_size 0
[ compel ] DEBUG: LC4: cpu: fpu: x87 floating point registers     xstate_offsets      0 / 0      xstate_sizes    160 / 160
[ compel ] DEBUG: LC4: cpu: fpu: AVX registers                    xstate_offsets    576 / 576    xstate_sizes    256 / 256
[ compel ] DEBUG: LC3: Dumping GP/FPU registers for 2236
[ compel ] DEBUG: LC3: Putting tsock into pid 2236
[ compel ] DEBUG: LC3: Wait for parasite being daemonized...
[ compel ] DEBUG: LC4: Wait for ack 2 on daemon socket
pie: 2236: Running daemon thread leader
pie: 2236: __sent ack msg: 2 2 0
pie: 2236: Daemon waits for command
[ compel ] DEBUG: LC4: Fetched ack: 2 2 0
[ compel ] DEBUG: LC3: Parasite 2236 has been switched to daemon mode
[ compel ] DEBUG: LC4: Sent msg to daemon 64 0 0
pie: 2236: __fetched msg: 64 0 0
DEBUG: parasite: initialized uffd 7
DEBUG: parasite: sent uffd to chameleon
pie: 2236: __sent ack msg: 64 64 0
pie: 2236: Daemon waits for command
[ compel ] DEBUG: LC4: Wait for ack 64 on daemon socket
[ compel ] DEBUG: LC4: Fetched ack: 64 64 0
[ compel ] DEBUG: LC4: Waiting for 2236 to trap
[ compel ] DEBUG: LC4: Daemon 2236 exited trapping
[ compel ] DEBUG: LC4: Sent msg to daemon 3 0 0
pie: 2236: __fetched msg: 3 0 0
pie: 2236: 2236: new_sp=0x7fa5c20b4004 ip 0x0
[ compel ] DEBUG: LC4: 2236 was trapped
[ compel ] DEBUG: LC4: `- Expecting exit
[ compel ] DEBUG: LC1: Error (compel/src/lib/infect.c:1448): Task 2236 is in unexpected state: b7f
[ compel ] DEBUG: LC1: Error (compel/src/lib/infect.c:1456): Task stopped with 11: Segmentation fault
[ chameleon ] ERROR: could not set up state transformer: compel cure failed
rlyerly commented 5 years ago

This is strange -- I've never encountered this error before.

@xjtuwxg can you send me a login (preferably via e-mail and not here) and give me instructions on how to reproduce the error so I can debug?

xjtuwxg commented 5 years ago

Hey Rob, I've sent my environment info to your vt email @rlyerly