ssrg-vt / popcorn-chameleon

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

error: ‘UFFD_FEATURE_PAGEFAULT_FLAG_WP’ was not declared in this scope #4

Open xjtuwxg opened 5 years ago

xjtuwxg commented 5 years ago

Compile and install popcorn-chameleon on Linux 4.9.0-8, with chameleon target installation location as /home/xiaoguang/works/chameleon/install.

xiaoguang@echo6:~/works/chameleon/popcorn-chameleon/build$ time make -j4
Scanning dependencies of target parasite_lib
[  6%] Generating chameleon-parasite.h header
[  6%] Built target parasite_lib
Scanning dependencies of target chameleon
[ 13%] Building CXX object src/CMakeFiles/chameleon.dir/arch.cpp.o
[ 20%] Building CXX object src/CMakeFiles/chameleon.dir/alarm.cpp.o
[ 26%] Building CXX object src/CMakeFiles/chameleon.dir/binary.cpp.o
[ 33%] Building CXX object src/CMakeFiles/chameleon.dir/chameleon.cpp.o
[ 40%] Building CXX object src/CMakeFiles/chameleon.dir/memoryview.cpp.o
[ 46%] Building CXX object src/CMakeFiles/chameleon.dir/parasite.cpp.o
[ 53%] Building CXX object src/CMakeFiles/chameleon.dir/process.cpp.o
[ 60%] Building CXX object src/CMakeFiles/chameleon.dir/randomize.cpp.o
[ 66%] Building CXX object src/CMakeFiles/chameleon.dir/trace.cpp.o
[ 73%] Building CXX object src/CMakeFiles/chameleon.dir/transform.cpp.o
[ 80%] Building CXX object src/CMakeFiles/chameleon.dir/types.cpp.o
[ 86%] Building CXX object src/CMakeFiles/chameleon.dir/userfaultfd.cpp.o
[ 93%] Building CXX object src/CMakeFiles/chameleon.dir/utils.cpp.o
In file included from /home/xiaoguang/works/chameleon/popcorn-chameleon/src/userfaultfd.cpp:4:0:
/home/xiaoguang/works/chameleon/popcorn-chameleon/src/userfaultfd.cpp: In function ‘void printFeatures(uint64_t)’:
/home/xiaoguang/works/chameleon/popcorn-chameleon/src/userfaultfd.cpp:18:30: error: ‘UFFD_FEATURE_PAGEFAULT_FLAG_WP’ was not declared in this scope
            << MASK(features, UFFD_FEATURE_PAGEFAULT_FLAG_WP) << std::endl);
                              ^
/home/xiaoguang/works/chameleon/popcorn-chameleon/include/log.h:42:18: note: in definition of macro ‘DEBUGMSG’
               << __VA_ARGS__ << std::dec; \
                  ^~~~~~~~~~~
/home/xiaoguang/works/chameleon/popcorn-chameleon/src/userfaultfd.cpp:18:15: note: in expansion of macro ‘MASK’
            << MASK(features, UFFD_FEATURE_PAGEFAULT_FLAG_WP) << std::endl);
               ^~~~
xjtuwxg commented 5 years ago

According to userfault, the feature bits were introduced from Linux 4.11. So update the kernel or use a VM w/ latest kernel could avoid this issue. I tried the installation again want to know whether issue #3 is caused by running the chameleon in a VM.