diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd75dab..1281cb9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ jobs: # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. # You can convert this to a matrix build if you need cross-platform coverage. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: [ubuntu-20.04] + runs-on: [ubuntu-24.04] steps: - uses: actions/checkout@v3 diff --git a/.gitignore b/.gitignore index 983a332..9774347 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ build/ .idea/ cmake-build-debug/ test/*.so -test/riscv/bin/ -test/riscv/build/ -test/riscv/*.txt +test/bin/ +test/build/ +test/testdir/ +test/testfile.txt +test/testfile2.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index b6b701d..09c8b8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -cmake_minimum_required(VERSION 3.3) +cmake_minimum_required(VERSION 3.10) project(syscall_intercept C ASM) set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) @@ -43,11 +43,10 @@ endif() option(PERFORM_STYLE_CHECKS "check coding style, license headers (requires perl)" OFF) +option(BUILD_TESTS "build and enable tests" ON) if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86(_64)?)$") - option(BUILD_TESTS "build and enable tests" ON) option(BUILD_EXAMPLES "build examples" ON) elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(riscv(32|64))$") - option(BUILD_TESTS "build and enable tests" OFF) option(BUILD_EXAMPLES "build examples" OFF) endif() option(TREAT_WARNINGS_AS_ERRORS @@ -56,6 +55,28 @@ option(EXPECT_SPURIOUS_SYSCALLS "account for some unexpected syscalls in tests - enable while using sanitizers, gcov" OFF) option(STATIC_CAPSTONE "statically link libcapstone into the shared library" OFF) +##################################### +# External projects +##################################### +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/capstone) + +set(CAPSTONE_INCLUDE_FOLDER "${CMAKE_CURRENT_BINARY_DIR}/capstone/_deps/capstone-src/include/capstone") +set(CAPSTONE_LIB_FOLDER "${CMAKE_CURRENT_BINARY_DIR}/capstone/_deps/capstone-build") + +execute_process( + COMMAND ${CMAKE_COMMAND} + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DBUILD_SHARED_LIBS=ON + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH= + "${CMAKE_CURRENT_SOURCE_DIR}/capstone" + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/capstone" +) + +execute_process(COMMAND make + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/capstone" +) + find_program(CTAGS ctags) if(CTAGS) option(AUTO_RUN_CTAGS "create tags file every on every rebuild" ON) @@ -68,7 +89,7 @@ set(SYSCALL_INTERCEPT_VERSION_PATCH 0) set(SYSCALL_INTERCEPT_VERSION ${SYSCALL_INTERCEPT_VERSION_MAJOR}.${SYSCALL_INTERCEPT_VERSION_MINOR}.${SYSCALL_INTERCEPT_VERSION_PATCH}) -include(cmake/find_capstone.cmake) + include(GNUInstallDirs) include(cmake/toolchain_features.cmake) include(CheckLanguage) @@ -105,10 +126,9 @@ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(riscv(32|64))$") ) endif() -# set the following directories according with your installation of capstone -include_directories(include "/usr/local/include/capstone") -include_directories(${PROJECT_SOURCE_DIR}/src) -link_directories("/usr/local/lib") + +include_directories(include ${PROJECT_SOURCE_DIR}/src ${CAPSTONE_INCLUDE_FOLDER}) +link_directories(${CAPSTONE_LIB_FOLDER}) set(CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/README.md b/README.md index 4249c0b..67da8a1 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,24 @@ # syscall_intercept + [//]: # ([![Build Status](https://travis-ci.org/pmem/syscall_intercept.svg)](https://travis-ci.org/pmem/syscall_intercept)) [//]: # ([![Coverage Status](https://codecov.io/github/pmem/syscall_intercept/coverage.svg)](https://codecov.io/gh/pmem/syscall_intercept)) [//]: # ([![Coverity Scan Build Status](https://scan.coverity.com/projects/12890/badge.svg)](https://scan.coverity.com/projects/syscall_intercept)) -This repository contains a multi-architecture porting of [syscall_intercept](https://github.com/pmem/syscall_intercept) working on both x86_64 and RISC-V +This repository contains a multi-architecture porting of [syscall_intercept](https://github.com/pmem/syscall_intercept) working on both **x86_64** and **RISC-V**. +Full-featured support for **aarch64** (ARM64) is in progress. +[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) # Dependencies # + ## Runtime dependencies ## * libcapstone -- the disassembly engine used under the hood (RISC-V support requires version **5.0** or higher, while apt installs version 4.0.2 by default, as february 2025). - Compiling capstone by hand will require setting [CMakeLists.txt](CMakeLists.txt#L109) accordingly + Since a manual installation of Capstone could not be automatically detected while compiling syscall_intercept, we ensured that libcapstone v5.0.6 is **automatically compiled** from source during the syscall_intercept cmake execution. ## Build dependencies ## @@ -56,20 +60,14 @@ There is an install target. For now, all it does, is cp. make install ``` -Testing on **x86_64**: +Running test suite: ```shell make test ``` -Testing on **RISC-V**:\ -Go to `syscall_intercept/test/riscv/`, then -```shell -make -make test -``` - # Synopsis # + ```c #include ``` @@ -188,6 +186,7 @@ ls: reading directory '.': Operation not supported # Under the hood: # + ##### Assumptions: ##### In order to handle syscalls in user space, the library relies on the following assumptions: @@ -311,20 +310,20 @@ aa20a: bltu a5,a0,aa262 <__open+0xaa> | aa20a: bltu a5,a0,aa262 <__ope ``` # Limitations: # + + * Only Linux is supported * Only x86\_64 and RISC-V are supported * Only tested with glibc, although perhaps it works with some other libc implementations as well * RISC-V version assumes `$t6` is not used as base pointer or as source register without being reinitialized after an `ecall` and before the ending of -a function - tested with glibc 2.35, 2.37 and 2.39 -* :warning: **Clone** is not fully handled on **RISC-V**. Whereas in x86_64 - version it is possible to define post-clone hook functions for both the - parent and child threads, on RISC-V it is only possible to define a pre-clone - hook function therefore providing a similar interception to every other system - calls. An example is present in [intercept_sys_clone.c](test/riscv/src/intercept_sys_clone.c) +a function. While this assumption involves heuristics, this choice was tested +on different glibc version, i.e. 2.35, 2.37 and 2.39, and on different kernel +implementations manifesting a consistent and working behaviour. # Debugging: # + Besides logging, the most important factor during debugging is to make sure the system calls in the debugger are not intercepted. To achieve this, use the INTERCEPT_HOOK_CMDLINE_FILTER variable described above. @@ -340,7 +339,8 @@ process itself. # RISC-V porting # -Ottavio Monticelli (Maintainer) \ + +Ottavio Monticelli (Maintainer) \ Marco Edoardo Santimaria (Maintainer) \ Marco Aldinucci (Maintainer and Principal Investigator) \ Iacopo Colonnelli (Maintainer and Principal Investigator) diff --git a/capstone/CMakeLists.txt b/capstone/CMakeLists.txt new file mode 100644 index 0000000..4e208f6 --- /dev/null +++ b/capstone/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.10) +project(capstone) +include(FetchContent) + +##################################### +# Import external project from git +##################################### +FetchContent_Declare(capstone + GIT_REPOSITORY https://github.com/capstone-engine/capstone.git + # the following git tag refers to capstone version 5.0.6 + GIT_TAG accf4df62f1fba6f92cae692985d27063552601c +) + +FetchContent_MakeAvailable(capstone) + diff --git a/src/arch/riscv/intercept_template.S b/src/arch/riscv/intercept_template.S index 053e7fe..5ab555f 100644 --- a/src/arch/riscv/intercept_template.S +++ b/src/arch/riscv/intercept_template.S @@ -57,6 +57,24 @@ intercept_asm_wrapper_tmpl: sd t3, 48(sp) sd t4, 56(sp) sd t5, 64(sp) + /* + * t5 content will be evaluated in intercept_wrapper to determine which + * interception routine must be called. 1 for post_clone, 0 otherwise + */ + li t5, 0 # choose intercept_routine + j intercept_asm_wrapper_patch_desc_addr +post_clone: + addi sp, sp, -72 + addi t6, sp, 72 # sp+72 is the sp value before interception + sd t6, 0(sp) + sd ra, 16(sp) + sd t0, 24(sp) + sd t1, 32(sp) + sd t2, 40(sp) + sd t3, 48(sp) + sd t4, 56(sp) + sd t5, 64(sp) + li t5, 1 # choose intercept_routine_post_clone intercept_asm_wrapper_patch_desc_addr: /* load patch_desc address in t0 */ @@ -135,11 +153,18 @@ intercept_asm_wrapper_wrapper_level1_addr: * If t6 is zero, a0 contains a syscall number, and that syscall * is executed here. * If t6 is 1, a0 contains the return value of the hooked syscall. + * If t6 is 2, a clone syscall is executed here. */ beqz t6, execute_unhandled_ecall srli t6, t6, 1 beqz t6, handled_ecall - ebreak # if t6 holds invalid value, i. e. different from 0 or 1 + srli t6, t6, 1 + beqz t6, execute_clone + ebreak # if t6 holds invalid value, i. e. different from 0, 1 or 2 + +execute_clone: + ecall + j post_clone execute_unhandled_ecall: ecall diff --git a/src/arch/riscv/intercept_wrapper.S b/src/arch/riscv/intercept_wrapper.S index ab2eda6..1751046 100644 --- a/src/arch/riscv/intercept_wrapper.S +++ b/src/arch/riscv/intercept_wrapper.S @@ -110,8 +110,14 @@ intercept_wrapper: /* argument passed to intercept_routine */ mv a0, sp - jal intercept_routine + li t0, 1 + beq t5, t0, l0 # which function should be called? + jal intercept_routine + j l1 +l0: + jal intercept_routine_post_clone +l1: /* * At this point, the return value of the C * function (a struct wrapper_ret instance) is in a0, a1. @@ -130,7 +136,14 @@ intercept_wrapper: ld t3, 32(sp) ld t4, 40(sp) - /* no point in restoring in context values at 48(sp), 56(sp) and 64(sp) */ + /* + * No point in restoring in context values at 48(sp) and 56(sp), while a0 + * must be restored only if system call has not been handled yet + */ + li a1, 1 + beq t6, a1, handled_ecall + ld a0, 64(sp) +handled_ecall: ld a1, 72(sp) ld a2, 80(sp) ld a3, 88(sp) diff --git a/src/arch/riscv/patcher.c b/src/arch/riscv/patcher.c index d78e42e..f3c4a90 100644 --- a/src/arch/riscv/patcher.c +++ b/src/arch/riscv/patcher.c @@ -555,8 +555,8 @@ create_j(unsigned char *from, void *to) uint32_t *instructions = (uint32_t *)from; debug_dump("%p: ecall -> jalr %ld\t# %p\n", from, delta, to); - const ptrdiff_t JALR_MAX_OFFSET = 2147481598; // ((2^31-1)-4095)+(2^11-1) = 0x7ffff000 + 0x7ff - const ptrdiff_t JALR_MIN_OFFSET = -2147483648; // (-2^31) = -0x80000000 + const ptrdiff_t JALR_MAX_OFFSET = ABS_MAX_POS_OFFSET; // ((2^31-1)-4095)+(2^11-2) = 0x7ffff000 + 0x7fe + const ptrdiff_t JALR_MIN_OFFSET = -(ABS_MAX_NEG_OFFSET); // (-2^31) = -0x80000000 - 0x800 if ((delta & 0x1) != 0) { diff --git a/src/intercept.c b/src/intercept.c index cdc28ba..9a127a4 100644 --- a/src/intercept.c +++ b/src/intercept.c @@ -621,6 +621,25 @@ get_syscall_in_context(struct context *context, struct syscall_desc *sys) sys->args[5] = SIXTH_ARG_REG; } +/* + * intercept_routine_post_clone + * The routine called by an assembly wrapper when a clone syscall returns zero, + * and a new stack pointer is used in the child thread. + */ +struct wrapper_ret +intercept_routine_post_clone(struct context *context) +{ + if (THREAD_PID == 0) { + if (intercept_hook_point_clone_child != NULL) + intercept_hook_point_clone_child(); + } else { + if (intercept_hook_point_clone_parent != NULL) + intercept_hook_point_clone_parent(THREAD_PID); + } + + return (struct wrapper_ret){FIRST_RET_REG = THREAD_PID, SECOND_RET_REG = 1 }; +} + /* * intercept_routine(...) * This is the function called from the asm wrappers, @@ -679,7 +698,7 @@ intercept_routine(struct context *context) #if defined(__x86_64__) || defined(_M_X64) if (desc.nr == SYS_vfork || desc.nr == SYS_rt_sigreturn) { #elif defined(__riscv) - if (desc.nr == SYS_clone || desc.nr == SYS_rt_sigreturn) { + if (desc.nr == SYS_rt_sigreturn) { #endif /* can't handle these syscalls the normal way */ return (struct wrapper_ret){FIRST_RET_REG = SYSCALL_NR, SECOND_RET_REG = 0 }; @@ -698,7 +717,7 @@ intercept_routine(struct context *context) * the clone_child_intercept_routine instead, executing * it on the new child threads stack, then returns to libc. */ -#if defined(__x86_64__) || defined(_M_X64) + if (desc.nr == SYS_clone && desc.args[1] != 0) { return (struct wrapper_ret){ FIRST_RET_REG = SYSCALL_NR, SECOND_RET_REG = 2 }; @@ -711,7 +730,7 @@ intercept_routine(struct context *context) } #endif else -#endif + result = syscall_no_intercept(desc.nr, desc.args[0], desc.args[1], @@ -719,28 +738,23 @@ intercept_routine(struct context *context) desc.args[3], desc.args[4], desc.args[5]); + + /* + * Here clone calls with arg[1] == 0 are granted the execution + * of their post_clone hook functions + */ + if (desc.nr == SYS_clone) { + THREAD_PID = result; + intercept_routine_post_clone(context); + } +#ifdef SYS_clone3 + else if (desc.nr == SYS_clone3) { + THREAD_PID = result; + intercept_routine_post_clone(context); + } +#endif } intercept_log_syscall(patch, &desc, KNOWN, result); return (struct wrapper_ret){ FIRST_RET_REG = result, SECOND_RET_REG = 1 }; } - -/* - * intercept_routine_post_clone - * The routine called by an assembly wrapper when a clone syscall returns zero, - * and a new stack pointer is used in the child thread. - */ - -struct wrapper_ret -intercept_routine_post_clone(struct context *context) -{ - if (THREAD_PID == 0) { - if (intercept_hook_point_clone_child != NULL) - intercept_hook_point_clone_child(); - } else { - if (intercept_hook_point_clone_parent != NULL) - intercept_hook_point_clone_parent(THREAD_PID); - } - - return (struct wrapper_ret){FIRST_RET_REG = THREAD_PID, SECOND_RET_REG = 1 }; -} diff --git a/src/intercept.h b/src/intercept.h index d06f889..f07e48f 100644 --- a/src/intercept.h +++ b/src/intercept.h @@ -245,6 +245,8 @@ void activate_patches(struct intercept_desc *desc); #define SIXTH_ARG_REG PARAM_BY_ARCH(context->r9,context->a[5]) #define FIRST_RET_REG PARAM_BY_ARCH(.rax,.a[0]) #define SECOND_RET_REG PARAM_BY_ARCH(.rdx,.a[1]) +#define ABS_MAX_NEG_OFFSET PARAM_BY_ARCH(INT32_MAX,((long)INT32_MAX+0x800)) +#define ABS_MAX_POS_OFFSET PARAM_BY_ARCH(INT32_MAX,INT32_MAX-0x801) bool is_overwritable_nop(const struct intercept_disasm_result *ins); diff --git a/src/intercept_desc.c b/src/intercept_desc.c index 43c9513..bfc9516 100644 --- a/src/intercept_desc.c +++ b/src/intercept_desc.c @@ -631,7 +631,7 @@ allocate_trampoline_table(struct intercept_desc *desc) unsigned char *guess; /* Where we would like to allocate the table */ size_t size; - if ((uintptr_t)desc->text_end < INT32_MAX) { + if ((uintptr_t)desc->text_end < ABS_MAX_NEG_OFFSET) { /* start from the bottom of memory */ guess = (void *)0; } else { @@ -641,7 +641,7 @@ allocate_trampoline_table(struct intercept_desc *desc) * Round up to a memory page boundary, as this address must be * mappable. */ - guess = desc->text_end - INT32_MAX; + guess = desc->text_end - ABS_MAX_NEG_OFFSET; guess = (unsigned char *)(((uintptr_t)guess) & ~((uintptr_t)(0xfff))) + 0x1000; } @@ -679,7 +679,7 @@ allocate_trampoline_table(struct intercept_desc *desc) */ guess = end; - if (guess + size >= desc->text_start + INT32_MAX) { + if (guess + size >= desc->text_start + ABS_MAX_POS_OFFSET) { /* Too far away */ xabort("unable to find place for trampoline table"); } diff --git a/src/intercept_log.c b/src/intercept_log.c index 8b26b66..f6fc96c 100644 --- a/src/intercept_log.c +++ b/src/intercept_log.c @@ -46,6 +46,7 @@ #include #include #include +#include #include /* @@ -274,6 +275,7 @@ static const struct flag_desc clone_flags[] = { FLAG_ENTRY(CLONE_UNTRACED), FLAG_ENTRY(CLONE_VFORK), FLAG_ENTRY(CLONE_VM), + FLAG_ENTRY(SIGCHLD), { .flag = 0, } }; diff --git a/src/syscall_formats.c b/src/syscall_formats.c index d397f4d..9df4e6d 100644 --- a/src/syscall_formats.c +++ b/src/syscall_formats.c @@ -51,12 +51,12 @@ static const struct syscall_format formats[] = { #ifdef SYS_stat SARGS(stat, rdec, arg_cstr, arg_pointer), #endif - SARGS(fstat, rdec, arg_fd, arg_pointer), + SARGS(fstat, rdec, arg_atfd, arg_pointer), #ifdef SYS_lstat SARGS(lstat, rdec, arg_cstr, arg_pointer), #endif #ifdef SYS_poll - SARGS(poll, rdec, arg_pointer, arg_, arg_), + SARGS(poll, rdec, arg_pointer, arg_dec, arg_dec), #endif SARGS(lseek, rdec, arg_fd, arg_dec, arg_seek_whence), SARGS(mmap, rpointer, arg_pointer, arg_, arg_, arg_, arg_fd, arg_), @@ -118,7 +118,7 @@ static const struct syscall_format formats[] = { SARGS(socketpair, rdec, arg_, arg_, arg_, arg_), SARGS(setsockopt, rdec, arg_fd, arg_, arg_, arg_, arg_), SARGS(getsockopt, rdec, arg_fd, arg_, arg_, arg_, arg_), - SARGS(clone, rdec, arg_clone_flags, arg_pointer, arg_pointer, arg_pointer, arg_), + SARGS(clone, rdec, arg_clone_flags, arg_pointer, arg_pointer, arg_, arg_), #ifdef SYS_fork SARGS(fork, rdec, arg_none), #endif @@ -200,6 +200,7 @@ static const struct syscall_format formats[] = { SARGS(geteuid, rdec, arg_none), SARGS(getegid, rdec, arg_none), SARGS(setpgid, rdec, arg_none), + SARGS(getppid, rdec, arg_none), #ifdef SYS_getpgrp SARGS(getpgrp, rdec, arg_none), #endif @@ -285,6 +286,12 @@ static const struct syscall_format formats[] = { #ifdef SYS_ioperm SARGS(ioperm, rdec, arg_, arg_, arg_), #endif +#ifdef SYS_create_module + SARGS(create_module, rpointer, arg_pointer, arg_dec), +#endif + SARGS(init_module, rdec, arg_pointer, arg_dec, arg_pointer), + SARGS(delete_module, rdec, arg_cstr, arg_), + SARGS(quotactl, rdec, arg_dec, arg_pointer, arg_dec, arg_pointer), SARGS(gettid, rdec, arg_none), SARGS(readahead, rdec, arg_fd, arg_dec, arg_dec), SARGS(setxattr, rdec, arg_cstr, arg_cstr, arg_buf_in, arg_dec, arg_), @@ -372,7 +379,7 @@ static const struct syscall_format formats[] = { #ifdef SYS_futimesat SARGS(futimesat, rdec, arg_atfd, arg_cstr, arg_), #endif - SARGS(newfstatat, rdec, arg_atfd, arg_cstr, arg_, arg_), + SARGS(newfstatat, rdec, arg_atfd, arg_cstr, arg_pointer, arg_), SARGS(unlinkat, rdec, arg_atfd, arg_cstr, arg_), #ifdef SYS_renameat SARGS(renameat, rdec, arg_atfd, arg_cstr, arg_atfd, arg_cstr), @@ -381,11 +388,11 @@ static const struct syscall_format formats[] = { SARGS(symlinkat, rdec, arg_cstr, arg_atfd, arg_cstr), SARGS(readlinkat, rdec, arg_atfd, arg_cstr, arg_buf_out, arg_dec), SARGS(fchmodat, rdec, arg_atfd, arg_cstr, arg_oct_mode), - SARGS(faccessat, rdec, arg_atfd, arg_cstr, arg_oct_mode), + SARGS(faccessat, rdec, arg_atfd, arg_cstr, arg_access_mode), SARGS(pselect6, rdec, arg_, arg_, arg_, arg_, arg_, arg_), - SARGS(ppoll, rdec, arg_, arg_, arg_, arg_, arg_), + SARGS(ppoll, rdec, arg_pointer, arg_dec, arg_, arg_, arg_dec), SARGS(unshare, rdec, arg_), - SARGS(set_robust_list, rdec, arg_, arg_), + SARGS(set_robust_list, rdec, arg_, arg_dec), SARGS(get_robust_list, rdec, arg_, arg_, arg_), SARGS(splice, rdec, arg_fd, arg_, arg_fd, arg_, arg_, arg_), SARGS(tee, rdec, arg_fd, arg_fd, arg_, arg_), diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5452223..b181c5b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -39,87 +39,13 @@ find_package(Threads) include_directories(${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/test) -set(CMAKE_ASM_CREATE_SHARED_LIBRARY ${CMAKE_C_CREATE_SHARED_LIBRARY}) +add_compile_options(-Wno-unused-result) +add_compile_options(-Wno-unused-variable) -add_executable(asm_pattern asm_pattern.c - $ - $) - -target_link_libraries(asm_pattern - PRIVATE ${CMAKE_DL_LIBS} ${capstone_LDFLAGS}) - -set(asm_patterns - nosyscall - pattern1 - pattern2 - pattern3 - pattern4 - pattern_loop - pattern_loop2 - pattern_symbol_boundary0 - pattern_symbol_boundary1 - pattern_symbol_boundary2 - pattern_symbol_boundary3 - pattern_nop_padding0 - pattern_nop_padding1 - pattern_nop_padding2 - pattern_nop_padding3 - pattern_nop_padding4 - pattern_nop_padding5 - pattern_nop_padding6 - pattern_nop_padding7 - pattern_nop_padding8 - pattern_nop_padding9 - pattern_lea_rip_rdi - pattern_lea_rip_r12) - -try_compile(ASSEMBLER_SUPPORTS_ENDBR64 ${CMAKE_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/pattern_endbr64.in.S - CMAKE_FLAGS "-DCMAKE_ASM_LINK_EXECUTABLE='echo skip linking'") -if(ASSEMBLER_SUPPORTS_ENDBR64) - list(APPEND asm_patterns pattern_endbr64) +if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86(_64)?)$") + add_subdirectory(arch/x86_64) endif() -set(asm_patterns_failing - pattern_double_syscall - pattern_rets - pattern_jmps) - -macro(add_asm_test test_name failing) - add_library(${test_name}.in SHARED ${test_name}.in.S) - add_library(${test_name}.out SHARED ${test_name}.out.S) - if(LINKER_HAS_NOSTDLIB) - set_target_properties(${test_name}.in - PROPERTIES LINK_FLAGS "-nostdlib") - set_target_properties(${test_name}.out - PROPERTIES LINK_FLAGS "-nostdlib") - endif() - if(HAS_NOUNUSEDARG) - target_compile_options(${test_name}.in BEFORE - PRIVATE "-Wno-unused-command-line-argument") - target_compile_options(${test_name}.out BEFORE - PRIVATE "-Wno-unused-command-line-argument") - - endif() - add_test(NAME "asm_pattern_${test_name}" - COMMAND $ - $ - $) - if(${failing}) - set_tests_properties("asm_pattern_${test_name}" - PROPERTIES WILL_FAIL ON - PASS_REGULAR_EXPRESSION "Invalid patch") - endif() -endmacro() - -foreach(name ${asm_patterns}) - add_asm_test(${name} FALSE) -endforeach() - -foreach(name ${asm_patterns_failing}) - add_asm_test(${name} TRUE) -endforeach() - set(CHECK_LOG_COMMON_ARGS -DMATCH_SCRIPT=${PROJECT_SOURCE_DIR}/utils/match.pl -DEXPECT_SPURIOUS_SYSCALLS=${EXPECT_SPURIOUS_SYSCALLS} @@ -141,6 +67,7 @@ add_test(NAME "fork_logging" add_library(hook_test_preload_o OBJECT hook_test_preload.c) add_executable(hook_test hook_test.c) +target_link_libraries(hook_test PUBLIC ${CAPSTONE_LIB_FOLDER}/libcapstone.so) add_library(hook_test_preload_with_shared SHARED $) @@ -157,7 +84,7 @@ add_test(NAME "hook_with_shared" add_library(hook_test_preload_with_static SHARED $) -target_link_libraries(hook_test_preload_with_static PRIVATE syscall_intercept_static) +target_link_libraries(hook_test_preload_with_static PRIVATE syscall_intercept_static ${CAPSTONE_LIB_FOLDER}/libcapstone.so) add_test(NAME "hook_with_static" COMMAND ${CMAKE_COMMAND} -DTEST_EXTRA_PRELOAD=${TEST_EXTRA_PRELOAD} @@ -246,91 +173,12 @@ add_test(NAME "clone_thread" set_tests_properties("clone_thread" PROPERTIES PASS_REGULAR_EXPRESSION "clone_hook_child called") -add_library(intercept_sys_write SHARED intercept_sys_write.c) -target_link_libraries(intercept_sys_write PRIVATE syscall_intercept_shared) - -add_executable(executable_with_syscall_pie executable_with_syscall.S) -if(HAS_NOUNUSEDARG) - target_compile_options(executable_with_syscall_pie BEFORE - PRIVATE "-Wno-unused-command-line-argument") -endif() -set_target_properties(executable_with_syscall_pie - PROPERTIES POSITION_INDEPENDENT_CODE True) -if(HAS_ARG_PIE) - target_compile_options(executable_with_syscall_pie PRIVATE "-pie") - target_link_libraries(executable_with_syscall_pie PRIVATE "-pie") -endif() - -add_executable(executable_with_syscall_no_pie executable_with_syscall.S) -if(HAS_NOUNUSEDARG) - target_compile_options(executable_with_syscall_no_pie BEFORE - PRIVATE "-Wno-unused-command-line-argument") -endif() -set_target_properties(executable_with_syscall_no_pie - PROPERTIES POSITION_INDEPENDENT_CODE False) -if(HAS_ARG_NOPIE) - target_compile_options(executable_with_syscall_no_pie PRIVATE "-nopie") - target_link_libraries(executable_with_syscall_no_pie PRIVATE "-nopie") -elseif(HAS_ARG_NO_PIE) - target_compile_options(executable_with_syscall_no_pie PRIVATE "-no-pie") - target_link_libraries(executable_with_syscall_no_pie PRIVATE "-no-pie") +if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86(_64)?)$") + set(MATCH_FILE ${CMAKE_CURRENT_SOURCE_DIR}/arch/x86_64/syscall_format.log.match) +elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(riscv(32|64))$") + set(MATCH_FILE ${CMAKE_CURRENT_SOURCE_DIR}/arch/riscv/syscall_format.log.match) endif() -add_test(NAME "prog_pie_intercept_libc_only" - COMMAND ${CMAKE_COMMAND} - -DTEST_EXTRA_PRELOAD=${TEST_EXTRA_PRELOAD} - -DTEST_PROG=$ - -DLIB_FILE=$ - -DTEST_PROG_ARGS=original_syscall - -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake) -set_tests_properties("prog_pie_intercept_libc_only" - PROPERTIES PASS_REGULAR_EXPRESSION "original_syscall") - -add_test(NAME "prog_no_pie_intercept_libc_only" - COMMAND ${CMAKE_COMMAND} - -DTEST_EXTRA_PRELOAD=${TEST_EXTRA_PRELOAD} - -DTEST_PROG=$ - -DLIB_FILE=$ - -DTEST_PROG_ARGS=original_syscall - -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake) -set_tests_properties("prog_no_pie_intercept_libc_only" - PROPERTIES PASS_REGULAR_EXPRESSION "original_syscall") - -add_test(NAME "prog_pie_intercept_all" - COMMAND ${CMAKE_COMMAND} - -DTEST_EXTRA_PRELOAD=${TEST_EXTRA_PRELOAD} - -DINTERCEPT_ALL=1 - -DTEST_PROG=$ - -DLIB_FILE=$ - -DTEST_PROG_ARGS=original_syscall - -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake) -set_tests_properties("prog_pie_intercept_all" - PROPERTIES PASS_REGULAR_EXPRESSION "intercepted_call") - -add_test(NAME "prog_no_pie_intercept_all" - COMMAND ${CMAKE_COMMAND} - -DTEST_EXTRA_PRELOAD=${TEST_EXTRA_PRELOAD} - -DINTERCEPT_ALL=1 - -DTEST_PROG=$ - -DLIB_FILE=$ - -DTEST_PROG_ARGS=original_syscall - -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake) -set_tests_properties("prog_no_pie_intercept_all" - PROPERTIES PASS_REGULAR_EXPRESSION "intercepted_call") - -add_executable(vfork_logging vfork_logging.c) -add_test(NAME "vfork_logging" - COMMAND ${CMAKE_COMMAND} - -DTEST_EXTRA_PRELOAD=${TEST_EXTRA_PRELOAD} - -DTEST_PROG=$ - -DLIB_FILE=$ - -DMATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/libcintercept2.log.match - -DTEST_NAME=vfork_logging - ${CHECK_LOG_COMMON_ARGS}) -set_tests_properties("vfork_logging" - PROPERTIES PASS_REGULAR_EXPRESSION "in_child_created_using_vfork") - - add_executable(syscall_format syscall_format.c) target_link_libraries(syscall_format PRIVATE syscall_intercept_shared) add_test(NAME "syscall_format_logging" @@ -338,6 +186,32 @@ add_test(NAME "syscall_format_logging" -DTEST_EXTRA_PRELOAD=${TEST_EXTRA_PRELOAD} -DTEST_PROG=$ -DLIB_FILE= - -DMATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/syscall_format.log.match + -DMATCH_FILE=${MATCH_FILE} -DTEST_NAME=syscall_format_logging ${CHECK_LOG_COMMON_ARGS}) + +set(GENERIC_TESTS + clone + fcntl + fork + mkdirat + openat + read + statx + write +) + +foreach(test_name IN LISTS GENERIC_TESTS) + add_library(intercept_sys_${test_name} SHARED intercept_sys_${test_name}.c) + target_link_libraries(intercept_sys_${test_name} PRIVATE syscall_intercept_shared) + + add_executable(${test_name}_test ${test_name}_test.c) + target_link_libraries(${test_name}_test PRIVATE syscall_intercept_shared) + + add_test(NAME "${test_name}_generic" + COMMAND ${CMAKE_COMMAND} -E env + LD_LIBRARY_PATH=$:$ + LD_PRELOAD=$ + $ + ) +endforeach() diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 0000000..86293bb --- /dev/null +++ b/test/Makefile @@ -0,0 +1,99 @@ +# +# Copyright 2025, University of Turin +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# * Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +CC = gcc +CFLAGS += -I../include +CFLAGS += -L../build +CFLAGS += -lsyscall_intercept +CFLAGS += -fpic -shared + +BIN_DIR = ./bin +BUILD_DIR = ./build +SRC_DIR = src + +LD_LIBRARY_PATH = ./build:../build +LD_PRELOAD = ./build + +TESTS += clone +TESTS += fcntl +TESTS += fork +TESTS += mkdirat +TESTS += openat +TESTS += read +TESTS += statx +TESTS += write + +EXECUTABLES += $(BIN_DIR)/clone_test +EXECUTABLES += $(BIN_DIR)/fcntl_test +EXECUTABLES += $(BIN_DIR)/fork_test +EXECUTABLES += $(BIN_DIR)/mkdirat_test +EXECUTABLES += $(BIN_DIR)/openat_test +EXECUTABLES += $(BIN_DIR)/read_test +EXECUTABLES += $(BIN_DIR)/statx_test +EXECUTABLES += $(BIN_DIR)/write_test + +INTERCEPT_LIBS += $(BUILD_DIR)/intercept_sys_clone.so +INTERCEPT_LIBS += $(BUILD_DIR)/intercept_sys_fcntl.so +INTERCEPT_LIBS += $(BUILD_DIR)/intercept_sys_fork.so +INTERCEPT_LIBS += $(BUILD_DIR)/intercept_sys_mkdirat.so +INTERCEPT_LIBS += $(BUILD_DIR)/intercept_sys_openat.so +INTERCEPT_LIBS += $(BUILD_DIR)/intercept_sys_read.so +INTERCEPT_LIBS += $(BUILD_DIR)/intercept_sys_statx.so +INTERCEPT_LIBS += $(BUILD_DIR)/intercept_sys_write.so + +all: $(BIN_DIR) $(BUILD_DIR) $(EXECUTABLES) $(INTERCEPT_LIBS) + +$(BUILD_DIR)/%.so: %.c + $(CC) -o $@ $< $(CFLAGS) + +$(BIN_DIR)/%: %.c + $(CC) $< -o $@ + +test: $(TESTS) + +$(TESTS): + @echo "Running test: $@" + @LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) LD_PRELOAD=$(LD_PRELOAD)/intercept_sys_$@.so $(BIN_DIR)/$@_test \ + && echo "Test $@ - \033[32mPASSED\033[0m" \ + || echo "Test $@ - \033[31mFAILED\033[0m" + @echo + +clean: + rm -rf $(BIN_DIR)/ + rm -rf $(BUILD_DIR)/ + rm -rf testdir/ + rm -f testfile.txt testfile2.txt + +$(BIN_DIR): + mkdir -p $(BIN_DIR) + +$(BUILD_DIR): + mkdir -p $(BUILD_DIR) diff --git a/test/README.md b/test/README.md new file mode 100644 index 0000000..f708496 --- /dev/null +++ b/test/README.md @@ -0,0 +1,94 @@ +# Test directory # + +All the source files for executables and initialization libraries and utility +files for testing are stored here. In the current directory only architecture +agnostic tests are present, while architecture specific tests are stored in a +dedicated directory inside `arch/`. As an example, inside `arch/x86_64/` some +assembly tests are stored, which must be optionally compiled just when building +on amd64 CPUs. + + +**RISC-V specific tests are coming soon**. However, the architecture agnostic +test suite can be run properly. + +# How to build # + +Tests are automatically built when building the library. If the library still +has to be built, from the root directory of the project run +```shell +mkdir build +cd build +cmake .. +make +``` + +[CMakeLists.txt](CMakeLists.txt) is written to automatically detect the CPU +architecture and select which tests must be compiled accordingly. + +In the end, running +```shell +make test +``` +will run the compiled test suite. + +# Testing logic # + +Different approaches are used to test syscall_intercept but an overall +distinction can be made between high-level and low-level coded tests. +- **Matching tests**: these tests verify the correct execution of the system + call interception. Some of them use the library logging logic to produce a + log file which gets then inspected to make sure it matches the expected output. + I.e., [syscall_format.c](syscall_format.c) makes a lot of system calls of + in a mock context just to create a log file which will be compared to + [syscall_format.log.match](syscall_format.log.match). One mismatch is enough + to fail the test.
Since system calls implementation may vary across + different glibc versions, the .match files could need to be updated to grant + a correct testing process. Depending on the glibc versions an `fstat` system + call could actually call `fstat` or `newfstatat`, or a `fstat` call with a + negative file descriptor could be forwarded to the kernel (invoking + syscall_intercept logic) or return before invoking the kernel (not invoking + syscall_intercept logic at all, and so the logging). Current .match files are + designed with glibc 2.35 and 2.39 versions in mind, which are the default + shipped versions with Ubuntu 22.04 and 24.04 respectively. Moreover, even the + same version on different architectures could involve different implementations. +
For these reasons, failing of a test of such type does not necessarily + imply that syscall_intercept is malfunctioning. +- **Assertion tests**: these tests basically assert a condition which can't possibly be true unless + the hook function is executed as expected thanks to a correct interception of + the tested system call. As an example, the `write` test writes a string to a + file, then reads the written string from that file and in the end asserts that + the two strings are perfectly equal. By looking at the content of + [write_test.c](src/write_test.c) it is obvious how the assertion could never be + true since the written string and the expected string are different. The hook + function which will be executed before forwarding the system call to the kernel + will make sure to modify the string that is going to be written to the file so + that the actual written string and the expected string match. + All the tests implementing such pattern are named in the suite as `_generic`. +- **Patching tests**: these tests verify the correct execution of the patching + process. They work in couples with an input and an output pattern file, both + coded in assembly. The input object file will be patched by syscall_intercept + producing a patched binary which will be compared with the output file by + `memcmp()`. Failing of such tests implies that the patching process is not + writing the expected binary code.
**RISC-V tests of such type are coming soon.** + +Assertion tests must be considered as couples containing an executable +and an initialization library, named as follows: +- `_test.c` +- `intercept_sys_.c` + +Granted that syscall_intercept is already built, assertion tests can alternatively +be compiled in this directory with +```shell +make +``` +and executed with +```shell +make test +``` + +Alternatively, it is possible to execute a specific test with the following +command, where syscall-name must be replaced with one of the entries in +the TESTS variable in the Makefile +``` +make +``` \ No newline at end of file diff --git a/test/arch/riscv/syscall_format.log.match b/test/arch/riscv/syscall_format.log.match new file mode 100644 index 0000000..2c90270 --- /dev/null +++ b/test/arch/riscv/syscall_format.log.match @@ -0,0 +1,734 @@ +$(S) $(XX) -- read(9, (null), 44) = ? +$(S) $(XX) -- read(9, (null), 44) = 22 +$(S) $(XX) -- read(7, $(XX), 19) = ? +$(S) $(XX) -- read(7, "expected_output_data\x06\xff", 19) = 22 +$(S) $(XX) -- write(7, "input_data\x01\x02\x03\n\r\t\0\0\0\0", 20) = ? +$(S) $(XX) -- write(7, "input_data\x01\x02\x03\n\r\t\0\0\0\0", 20) = 22 +$(S) $(XX) -- pread64(7, $(XX), 19, 4294967311) = ? +$(S) $(XX) -- pread64(7, "expected_output_data\x06\xff", 19, 4294967311) = 22 +$(S) $(XX) -- pread64(-99, $(XX), 18, 0) = ? +$(S) $(XX) -- pread64(-99, "expected_output_data\x06\xff", 18, 0) = 22 +$(S) $(XX) -- pread64(8, (null), 18, 0) = ? +$(S) $(XX) -- pread64(8, (null), 18, 0) = 22 +$(S) $(XX) -- pwrite64(7, "input_data\x01\x02\x03\n\r\t\0\0\0", 19, 4294967311) = ? +$(S) $(XX) -- pwrite64(7, "input_data\x01\x02\x03\n\r\t\0\0\0", 19, 4294967311) = 22 +$(S) $(XX) -- pwrite64(-99, "input_data\x01\x02\x03\n\r\t\0\0", 18, 0) = ? +$(S) $(XX) -- pwrite64(-99, "input_data\x01\x02\x03\n\r\t\0\0", 18, 0) = 22 +$(S) $(XX) -- pwrite64(-100, (null), 18, -1) = ? +$(S) $(XX) -- pwrite64(-100, (null), 18, -1) = 22 +$(S) $(XX) -- readv(1, 0x0000000000123000, 4) = ? +$(S) $(XX) -- readv(1, 0x0000000000123000, 4) = 22 +$(S) $(XX) -- readv(1, (null), 4) = ? +$(S) $(XX) -- readv(1, (null), 4) = 22 +$(S) $(XX) -- writev(1, 0x0000000000123000, 4) = ? +$(S) $(XX) -- writev(1, 0x0000000000123000, 4) = 22 +$(S) $(XX) -- writev(1, (null), 4) = ? +$(S) $(XX) -- writev(1, (null), 4) = 22 +$(S) $(XX) -- preadv(1, 0x123000, 0x4, 0x1000) = ? +$(S) $(XX) -- preadv(1, 0x123000, 0x4, 0x1000) = 22 +$(S) $(XX) -- preadv(1, 0x0, 0x4, 0x1000) = ? +$(S) $(XX) -- preadv(1, 0x0, 0x4, 0x1000) = 22 +$(S) $(XX) -- pwritev(1, 0x123000, 0x4, 0x1000) = ? +$(S) $(XX) -- pwritev(1, 0x123000, 0x4, 0x1000) = 22 +$(S) $(XX) -- pwritev(1, 0x0, 0x4, 0x1000) = ? +$(S) $(XX) -- pwritev(1, 0x0, 0x4, 0x1000) = 22 +$(S) $(XX) -- openat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", O_RDWR | O_CREAT | O_DSYNC | O_RSYNC, 0321) = ? +$(S) $(XX) -- openat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", O_RDWR | O_CREAT | O_DSYNC | O_RSYNC, 0321) = 22 +$(S) $(XX) -- openat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", O_RDONLY) = ? +$(S) $(XX) -- openat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", O_RDONLY) = 22 +$(S) $(XX) -- openat(AT_FDCWD, (null), O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = ? +$(S) $(XX) -- openat(AT_FDCWD, (null), O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = 22 +$(S) $(XX) -- openat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = ? +$(S) $(XX) -- openat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = 22 +$(S) $(XX) -- openat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", O_RDWR | O_NONBLOCK) = ? +$(S) $(XX) -- openat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", O_RDWR | O_NONBLOCK) = 22 +$(S) $(XX) -- openat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", O_RDONLY) = ? +$(S) $(XX) -- openat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", O_RDONLY) = 22 +$(S) $(XX) -- openat(AT_FDCWD, (null), O_RDONLY) = ? +$(S) $(XX) -- openat(AT_FDCWD, (null), O_RDONLY) = 22 +$(S) $(XX) -- openat(99, "input_data\x01\x02\x03\n\r\t", O_RDONLY | O_CREAT, 0777) = ? +$(S) $(XX) -- openat(99, "input_data\x01\x02\x03\n\r\t", O_RDONLY | O_CREAT, 0777) = 22 +$(S) $(XX) -- openat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", O_RDWR | O_TMPFILE, 0333) = ? +$(S) $(XX) -- openat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", O_RDWR | O_TMPFILE, 0333) = 22 +$(S) $(XX) -- close(9) = ? +$(S) $(XX) -- close(9) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), (null), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), (null), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", (null), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", (null), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), $(XX), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), $(XX), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", $(XX), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", $(XX), $(XX)) = 22 +$(S) $(XX) -- newfstatat(0, "", (null), $(XX)) = ? +$(S) $(XX) -- newfstatat(0, "", (null), $(XX)) = 22 +$(OPT)$(S) $(XX) -- newfstatat(-1, "", $(XX), $(XX)) = ? +$(OPT)$(S) $(XX) -- newfstatat(-1, "", $(XX), $(XX)) = 22 +$(OPT)$(S) $(XX) -- newfstatat(AT_FDCWD, "", $(XX), $(XX)) = ? +$(OPT)$(S) $(XX) -- newfstatat(AT_FDCWD, "", $(XX), $(XX)) = 22 +$(S) $(XX) -- newfstatat(2, "", $(XX), $(XX)) = ? +$(S) $(XX) -- newfstatat(2, "", $(XX), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), (null), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), (null), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", (null), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", (null), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), $(XX), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), $(XX), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", $(XX), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", $(XX), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", (null), 0x0) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", (null), 0x0) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), (null), 0x0) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), (null), 0x0) = 22 +$(S) $(XX) -- newfstatat(-1000, "", $(XX), 0x0) = ? +$(S) $(XX) -- newfstatat(-1000, "", $(XX), 0x0) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", $(XX), 0x100) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", $(XX), 0x100) = 22 +$(S) $(XX) -- ppoll((null), 0, $(XX), $(XX), $(N)) = ? +$(S) $(XX) -- ppoll((null), 0, $(XX), $(XX), $(N)) = 22 +$(S) $(XX) -- ppoll($(XX), 3, $(XX), $(XX), $(N)) = ? +$(S) $(XX) -- ppoll($(XX), 3, $(XX), $(XX), $(N)) = 22 +$(S) $(XX) -- ppoll($(XX), 2, 0x123000, 0x234000, 2) = ? +$(S) $(XX) -- ppoll($(XX), 2, 0x123000, 0x234000, 2) = 22 +$(S) $(XX) -- lseek(0, 0, SEEK_SET) = ? +$(S) $(XX) -- lseek(0, 0, SEEK_SET) = 22 +$(S) $(XX) -- lseek(0, 0, SEEK_CUR) = ? +$(S) $(XX) -- lseek(0, 0, SEEK_CUR) = 22 +$(S) $(XX) -- lseek(0, 0, SEEK_END) = ? +$(S) $(XX) -- lseek(0, 0, SEEK_END) = 22 +$(S) $(XX) -- lseek(0, 0, SEEK_HOLE) = ? +$(S) $(XX) -- lseek(0, 0, SEEK_HOLE) = 22 +$(S) $(XX) -- lseek(0, 0, SEEK_DATA) = ? +$(S) $(XX) -- lseek(0, 0, SEEK_DATA) = 22 +$(S) $(XX) -- lseek(2, -1, SEEK_SET) = ? +$(S) $(XX) -- lseek(2, -1, SEEK_SET) = 22 +$(S) $(XX) -- lseek(2, -1, SEEK_CUR) = ? +$(S) $(XX) -- lseek(2, -1, SEEK_CUR) = 22 +$(S) $(XX) -- lseek(2, -1, SEEK_END) = ? +$(S) $(XX) -- lseek(2, -1, SEEK_END) = 22 +$(S) $(XX) -- lseek(2, -1, SEEK_HOLE) = ? +$(S) $(XX) -- lseek(2, -1, SEEK_HOLE) = 22 +$(S) $(XX) -- lseek(2, -1, SEEK_DATA) = ? +$(S) $(XX) -- lseek(2, -1, SEEK_DATA) = 22 +$(S) $(XX) -- lseek(-100, 99999, SEEK_SET) = ? +$(S) $(XX) -- lseek(-100, 99999, SEEK_SET) = 22 +$(S) $(XX) -- lseek(-100, 99999, SEEK_CUR) = ? +$(S) $(XX) -- lseek(-100, 99999, SEEK_CUR) = 22 +$(S) $(XX) -- lseek(-100, 99999, SEEK_END) = ? +$(S) $(XX) -- lseek(-100, 99999, SEEK_END) = 22 +$(S) $(XX) -- lseek(-100, 99999, SEEK_HOLE) = ? +$(S) $(XX) -- lseek(-100, 99999, SEEK_HOLE) = 22 +$(S) $(XX) -- lseek(-100, 99999, SEEK_DATA) = ? +$(S) $(XX) -- lseek(-100, 99999, SEEK_DATA) = 22 +$(S) $(XX) -- mmap((null), 0x0, 0x0, 0x0, 0, 0x0) = ? +$(S) $(XX) -- mmap((null), 0x0, 0x0, 0x0, 0, 0x0) = -22 EINVAL (Invalid argument) +$(S) $(XX) -- mmap(0x0000000000123000, 0x8000, 0x4, 0x1, 99, 0x1000) = ? +$(S) $(XX) -- mmap(0x0000000000123000, 0x8000, 0x4, 0x1, 99, 0x1000) = 0x0000000000000016 +$(S) $(XX) -- mprotect(0x0000000000123000, 0x4000, 0x1) = ? +$(S) $(XX) -- mprotect(0x0000000000123000, 0x4000, 0x1) = 22 +$(S) $(XX) -- mprotect((null), 0x4000, 0x2) = ? +$(S) $(XX) -- mprotect((null), 0x4000, 0x2) = 22 +$(S) $(XX) -- munmap(0x0000000000123000, 0x4000) = ? +$(S) $(XX) -- munmap(0x0000000000123000, 0x4000) = 22 +$(S) $(XX) -- munmap((null), 0x4000) = ? +$(S) $(XX) -- munmap((null), 0x4000) = 22 +$(S) $(XX) -- brk($(N)) = ? +$(S) $(XX) -- brk($(N)) = 22 +$(S) $(XX) -- brk(0) = ? +$(S) $(XX) -- brk(0) = 22 +$(S) $(XX) -- mremap(0x0000000000123000, 4294967302, 4294967372, 1, $(XX)) = ? +$(S) $(XX) -- mremap(0x0000000000123000, 4294967302, 4294967372, 1, $(XX)) = 0x0000000000000016 +$(S) $(XX) -- msync(0x0000000000123000, 0, 1) = ? +$(S) $(XX) -- msync(0x0000000000123000, 0, 1) = 22 +$(S) $(XX) -- msync((null), 888, 2) = ? +$(S) $(XX) -- msync((null), 888, 2) = 22 +$(S) $(XX) -- mincore(0x0000000000123000, 99, 0x0000000000234000) = ? +$(S) $(XX) -- mincore(0x0000000000123000, 99, 0x0000000000234000) = 22 +$(S) $(XX) -- mincore(0x0000000000234000, 1234, (null)) = ? +$(S) $(XX) -- mincore(0x0000000000234000, 1234, (null)) = 22 +$(S) $(XX) -- mincore((null), 0, 0x0000000000123000) = ? +$(S) $(XX) -- mincore((null), 0, 0x0000000000123000) = 22 +$(S) $(XX) -- madvise(0x0000000000123000, 99, 0) = ? +$(S) $(XX) -- madvise(0x0000000000123000, 99, 0) = 22 +$(S) $(XX) -- madvise(0x0000000000234000, 1234, 4) = ? +$(S) $(XX) -- madvise(0x0000000000234000, 1234, 4) = 22 +$(S) $(XX) -- madvise((null), 0, 2) = ? +$(S) $(XX) -- madvise((null), 0, 2) = 22 +$(S) $(XX) -- mlock(0x123000, 0x3000) = ? +$(S) $(XX) -- mlock(0x123000, 0x3000) = 22 +$(S) $(XX) -- mlock2(0x123000, 0x3000, 0x0) = ? +$(S) $(XX) -- mlock2(0x123000, 0x3000, 0x0) = 22 +$(S) $(XX) -- munlock(0x123000, 0x3000) = ? +$(S) $(XX) -- munlock(0x123000, 0x3000) = 22 +$(S) $(XX) -- mlockall(0x1) = ? +$(S) $(XX) -- mlockall(0x1) = 22 +$(S) $(XX) -- mlockall(0x2) = ? +$(S) $(XX) -- mlockall(0x2) = 22 +$(S) $(XX) -- munlockall() = ? +$(S) $(XX) -- munlockall() = 22 +$(S) $(XX) -- rt_sigaction(2, 0x0000000000123000, 0x0000000000234000, 10) = ? +$(S) $(XX) -- rt_sigaction(2, 0x0000000000123000, 0x0000000000234000, 10) = 22 +$(S) $(XX) -- rt_sigprocmask(0x2, 0x0000000000123000, 0x0000000000234000, 10) = ? +$(S) $(XX) -- rt_sigprocmask(0x2, 0x0000000000123000, 0x0000000000234000, 10) = 22 +$(S) $(XX) -- ioctl(1, 0x4d, 0x0000000000234000) = ? +$(S) $(XX) -- ioctl(1, 0x4d, 0x0000000000234000) = 22 +$(S) $(XX) -- faccessat(AT_FDCWD, (null), F_OK) = ? +$(S) $(XX) -- faccessat(AT_FDCWD, (null), F_OK) = 22 +$(S) $(XX) -- faccessat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", X_OK) = ? +$(S) $(XX) -- faccessat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", X_OK) = 22 +$(S) $(XX) -- faccessat(AT_FDCWD, "", R_OK | W_OK) = ? +$(S) $(XX) -- faccessat(AT_FDCWD, "", R_OK | W_OK) = 22 +$(S) $(XX) -- faccessat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", R_OK | W_OK | X_OK) = ? +$(S) $(XX) -- faccessat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", R_OK | W_OK | X_OK) = 22 +$(S) $(XX) -- faccessat2(AT_FDCWD, (null), 00, $(XX)) = ? +$(S) $(XX) -- faccessat2(AT_FDCWD, (null), 00, $(XX)) = 22 +$(S) $(XX) -- faccessat2(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01, $(XX)) = ? +$(S) $(XX) -- faccessat2(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01, $(XX)) = 22 +$(S) $(XX) -- faccessat2(AT_FDCWD, "", 06, $(XX)) = ? +$(S) $(XX) -- faccessat2(AT_FDCWD, "", 06, $(XX)) = 22 +$(S) $(XX) -- faccessat2(9, "input_data\x01\x02\x03\n\r\t", 07, $(XX)) = ? +$(S) $(XX) -- faccessat2(9, "input_data\x01\x02\x03\n\r\t", 07, $(XX)) = 22 +$(S) $(XX) -- pipe2($(XX), $(N)) = ? +$(S) $(XX) -- pipe2([123, 234], $(N)) = 22 +$(S) $(XX) -- pipe2($(XX), 0) = ? +$(S) $(XX) -- pipe2([123, 234], 0) = 22 +$(S) $(XX) -- pselect6(0x2, 0x123000, 0x234000, 0x456000, $(XX), $(XX)) = ? +$(S) $(XX) -- pselect6(0x2, 0x123000, 0x234000, 0x456000, $(XX), $(XX)) = 22 +$(S) $(XX) -- pselect6(0x2, 0x123000, 0x234000, 0x123000, 0x234000, 0x123000) = ? +$(S) $(XX) -- pselect6(0x2, 0x123000, 0x234000, 0x123000, 0x234000, 0x123000) = 22 +$(S) $(XX) -- sched_yield() = ? +$(S) $(XX) -- sched_yield() = 22 +$(S) $(XX) -- shmget(0x3, 0x4, 0x5) = ? +$(S) $(XX) -- shmget(0x3, 0x4, 0x5) = 22 +$(S) $(XX) -- shmat(0x3, 0x123000, 0x5) = ? +$(S) $(XX) -- shmat(0x3, 0x123000, 0x5) = 0x16 +$(S) $(XX) -- shmctl(0x3, 0xe, 0x123000) = ? +$(S) $(XX) -- shmctl(0x3, 0xe, 0x123000) = 22 +$(S) $(XX) -- shmdt(0x123000) = ? +$(S) $(XX) -- shmdt(0x123000) = 22 +$(S) $(XX) -- dup(4) = ? +$(S) $(XX) -- dup(4) = 22 +$(S) $(XX) -- dup3(4, 5, 0x0) = ? +$(S) $(XX) -- dup3(4, 5, 0x0) = 22 +$(S) $(XX) -- dup3(4, 5, 0x0) = ? +$(S) $(XX) -- dup3(4, 5, 0x0) = 22 +$(S) $(XX) -- dup3(4, 5, 0x80000) = ? +$(S) $(XX) -- dup3(4, 5, 0x80000) = 22 +$(S) $(XX) -- ppoll((null), 0, 0x0, 0x0, $(N)) = ? +$(S) $(XX) -- ppoll((null), 0, 0x0, 0x0, $(N)) = 22 +$(S) $(XX) -- clock_nanosleep(0x0, 0x0, 0x123000, 0x234000) = ? +$(S) $(XX) -- clock_nanosleep(0x0, 0x0, 0x123000, 0x234000) = 22 +$(S) $(XX) -- getitimer(0x3, 0x123000) = ? +$(S) $(XX) -- getitimer(0x3, 0x123000) = 22 +$(S) $(XX) -- setitimer(0x0, $(XX), $(XX)) = ? +$(S) $(XX) -- setitimer(0x0, $(XX), $(XX)) = 22 +$(S) $(XX) -- setitimer(0x6, 0x123000, 0x234000) = ? +$(S) $(XX) -- setitimer(0x6, 0x123000, 0x234000) = 22 +$(S) $(XX) -- getpid() = ? +$(S) $(XX) -- getpid() = 22 +$(S) $(XX) -- sendfile(6, 7, 0x123000, 0x63) = ? +$(S) $(XX) -- sendfile(6, 7, 0x123000, 0x63) = 22 +$(S) $(XX) -- socket(0x2, 0x800, 0x0) = ? +$(S) $(XX) -- socket(0x2, 0x800, 0x0) = 22 +$(S) $(XX) -- connect(8, 0x123000, 0xc) = ? +$(S) $(XX) -- connect(8, 0x123000, 0xc) = 22 +$(S) $(XX) -- accept(4, 0x123000, 0x234000) = ? +$(S) $(XX) -- accept(4, 0x123000, 0x234000) = 22 +$(S) $(XX) -- accept4(4, 0x123000, 0x234000, 0x0, 0x0) = ? +$(S) $(XX) -- accept4(4, 0x123000, 0x234000, 0x0, 0x0) = 22 +$(S) $(XX) -- accept4(4, 0x123000, 0x234000, 0x80800, 0x123000) = ? +$(S) $(XX) -- accept4(4, 0x123000, 0x234000, 0x80800, 0x123000) = 22 +$(S) $(XX) -- sendto(5, 0x123000, 0xc, 0x4) = ? +$(S) $(XX) -- sendto(5, 0x123000, 0xc, 0x4) = 22 +$(S) $(XX) -- recvfrom(5, 0x123000, 0xc, 0x4, 0x234000, 0x234000) = ? +$(S) $(XX) -- recvfrom(5, 0x123000, 0xc, 0x4, 0x234000, 0x234000) = 22 +$(S) $(XX) -- recvmsg(2, 0x123000, 0x2) = ? +$(S) $(XX) -- recvmsg(2, 0x123000, 0x2) = 22 +$(S) $(XX) -- recvmmsg(2, 0x123000, 0xc, 0x10000, 0x234000) = ? +$(S) $(XX) -- recvmmsg(2, 0x123000, 0xc, 0x10000, 0x234000) = 22 +$(S) $(XX) -- sendmsg(2, 0x123000, 0x4000) = ? +$(S) $(XX) -- sendmsg(2, 0x123000, 0x4000) = 22 +$(S) $(XX) -- sendmmsg(2, 0x123000, 0xc, 0x4000) = ? +$(S) $(XX) -- sendmmsg(2, 0x123000, 0xc, 0x4000) = 22 +$(S) $(XX) -- shutdown(3, 0x0) = ? +$(S) $(XX) -- shutdown(3, 0x0) = 22 +$(S) $(XX) -- bind(6, 0x123000, 0x9) = ? +$(S) $(XX) -- bind(6, 0x123000, 0x9) = 22 +$(S) $(XX) -- listen(5, 0x3) = ? +$(S) $(XX) -- listen(5, 0x3) = 22 +$(S) $(XX) -- getsockname(4, 0x123000, 0x234000) = ? +$(S) $(XX) -- getsockname(4, 0x123000, 0x234000) = 22 +$(S) $(XX) -- getpeername(4, 0x123000, 0x234000) = ? +$(S) $(XX) -- getpeername(4, 0x123000, 0x234000) = 22 +$(S) $(XX) -- socketpair(0x4, 0x5, 0x6, 0x123000) = ? +$(S) $(XX) -- socketpair(0x4, 0x5, 0x6, 0x123000) = 22 +$(S) $(XX) -- setsockopt(4, 0x5, 0x6, 0x123000, 0x7) = ? +$(S) $(XX) -- setsockopt(4, 0x5, 0x6, 0x123000, 0x7) = 22 +$(S) $(XX) -- getsockopt(4, 0x5, 0x6, 0x123000, $(XX)) = ? +$(S) $(XX) -- getsockopt(4, 0x5, 0x6, 0x123000, $(XX)) = 22 +$(S) $(XX) -- wait4(7, 0x123000, 0x0, 0x234000) = ? +$(S) $(XX) -- wait4(7, 0x123000, 0x0, 0x234000) = 22 +$(S) $(XX) -- kill(0x4, 0x2) = ? +$(S) $(XX) -- kill(0x4, 0x2) = 22 +$(S) $(XX) -- uname($(XX)) = ? +$(S) $(XX) -- uname($(XX)) = 22 +$(S) $(XX) -- semget(0x4, 0x1, 0x200) = ? +$(S) $(XX) -- semget(0x4, 0x1, 0x200) = 22 +$(S) $(XX) -- semtimedop(0x4, 0x123000, 0x1, 0x0) = ? +$(S) $(XX) -- semtimedop(0x4, 0x123000, 0x1, 0x0) = 22 +$(S) $(XX) -- semtimedop(0x4, 0x123000, 0x1, 0x234000) = ? +$(S) $(XX) -- semtimedop(0x4, 0x123000, 0x1, 0x234000) = 22 +$(S) $(XX) -- semctl(0x1, 0x2, 0x3, $(XX), $(XX), $(XX)) = ? +$(S) $(XX) -- semctl(0x1, 0x2, 0x3, $(XX), $(XX), $(XX)) = 22 +$(S) $(XX) -- msgget(0x1, 0x200) = ? +$(S) $(XX) -- msgget(0x1, 0x200) = 22 +$(S) $(XX) -- msgsnd(0x1, 0x123000, 0x3, 0x3) = ? +$(S) $(XX) -- msgsnd(0x1, 0x123000, 0x3, 0x3) = 22 +$(S) $(XX) -- msgrcv(0x1, 0x123000, 0x1, 0x1, 0x1) = ? +$(S) $(XX) -- msgrcv(0x1, 0x123000, 0x1, 0x1, 0x1) = 22 +$(S) $(XX) -- msgctl(0x1, 0x2, 0x123000) = ? +$(S) $(XX) -- msgctl(0x1, 0x2, 0x123000) = 22 +$(S) $(XX) -- fcntl(1, 1030 (F_DUPFD_CLOEXEC), 0x3) = ? +$(S) $(XX) -- fcntl(1, 1030 (F_DUPFD_CLOEXEC), 0x3) = 22 +$(S) $(XX) -- fcntl(10, 4 (F_SETFL), 0x40000) = ? +$(S) $(XX) -- fcntl(10, 4 (F_SETFL), 0x40000) = 22 +$(S) $(XX) -- fcntl(11, 6 (F_SETLK), $(XX) ({.l_type = 1 (F_WRLCK), .l_whence = 2 (SEEK_END), .l_start = 123, .l_len = 456, .l_pid = 768})) = ? +$(S) $(XX) -- fcntl(11, 6 (F_SETLK), $(XX) ({.l_type = 1 (F_WRLCK), .l_whence = 2 (SEEK_END), .l_start = 123, .l_len = 456, .l_pid = 768})) = 22 +$(S) $(XX) -- flock(1, 0x2) = ? +$(S) $(XX) -- flock(1, 0x2) = 22 +$(S) $(XX) -- fsync(2) = ? +$(S) $(XX) -- fsync(2) = 22 +$(S) $(XX) -- fdatasync(2) = ? +$(S) $(XX) -- fdatasync(2) = 22 +$(S) $(XX) -- truncate("input_data\x01\x02\x03\n\r\t", 0x4) = ? +$(S) $(XX) -- truncate("input_data\x01\x02\x03\n\r\t", 0x4) = 22 +$(S) $(XX) -- ftruncate(3, 0x3) = ? +$(S) $(XX) -- ftruncate(3, 0x3) = 22 +$(S) $(XX) -- getdents64(4, 0x123000, 0x1) = ? +$(S) $(XX) -- getdents64(4, 0x123000, 0x1) = 22 +$(S) $(XX) -- getcwd($(XX), 0x9) = ? +$(S) $(XX) -- getcwd($(XX), 0x9) = 22 +$(S) $(XX) -- chdir("input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- chdir("input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- fchdir(6) = ? +$(S) $(XX) -- fchdir(6) = 22 +$(S) $(XX) -- renameat2(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", $(XX)) = ? +$(S) $(XX) -- renameat2(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", $(XX)) = 22 +$(S) $(XX) -- renameat2(1, "input_data\x01\x02\x03\n\r\t", 2, "other_input_data\x01\x02\x03\n\r\t", $(XX)) = ? +$(S) $(XX) -- renameat2(1, "input_data\x01\x02\x03\n\r\t", 2, "other_input_data\x01\x02\x03\n\r\t", $(XX)) = 22 +$(S) $(XX) -- renameat2(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 7, "other_input_data\x01\x02\x03\n\r\t", $(XX)) = ? +$(S) $(XX) -- renameat2(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 7, "other_input_data\x01\x02\x03\n\r\t", $(XX)) = 22 +$(S) $(XX) -- renameat2(9, "input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", $(XX)) = ? +$(S) $(XX) -- renameat2(9, "input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", $(XX)) = 22 +$(S) $(XX) -- mkdirat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0644) = ? +$(S) $(XX) -- mkdirat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0644) = 22 +$(S) $(XX) -- mkdirat(33, "input_data\x01\x02\x03\n\r\t", 0644) = ? +$(S) $(XX) -- mkdirat(33, "input_data\x01\x02\x03\n\r\t", 0644) = 22 +$(S) $(XX) -- mkdirat(33, (null), 0555) = ? +$(S) $(XX) -- mkdirat(33, (null), 0555) = 22 +$(S) $(XX) -- linkat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", 0x0) = ? +$(S) $(XX) -- linkat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", 0x0) = 22 +$(S) $(XX) -- linkat(1, "input_data\x01\x02\x03\n\r\t", 2, "other_input_data\x01\x02\x03\n\r\t", 0x0) = ? +$(S) $(XX) -- linkat(1, "input_data\x01\x02\x03\n\r\t", 2, "other_input_data\x01\x02\x03\n\r\t", 0x0) = 22 +$(S) $(XX) -- linkat(1, "input_data\x01\x02\x03\n\r\t", 2, "other_input_data\x01\x02\x03\n\r\t", 0x400) = ? +$(S) $(XX) -- linkat(1, "input_data\x01\x02\x03\n\r\t", 2, "other_input_data\x01\x02\x03\n\r\t", 0x400) = 22 +$(S) $(XX) -- linkat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 2, "other_input_data\x01\x02\x03\n\r\t", 0x400) = ? +$(S) $(XX) -- linkat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 2, "other_input_data\x01\x02\x03\n\r\t", 0x400) = 22 +$(S) $(XX) -- linkat(7, "input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", 0x0) = ? +$(S) $(XX) -- linkat(7, "input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", 0x0) = 22 +$(S) $(XX) -- unlinkat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x0) = ? +$(S) $(XX) -- unlinkat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x0) = 22 +$(S) $(XX) -- unlinkat(0, "input_data\x01\x02\x03\n\r\t", 0x0) = ? +$(S) $(XX) -- unlinkat(0, "input_data\x01\x02\x03\n\r\t", 0x0) = 22 +$(S) $(XX) -- unlinkat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x200) = ? +$(S) $(XX) -- unlinkat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x200) = 22 +$(S) $(XX) -- unlinkat(9, "other_input_data\x01\x02\x03\n\r\t", 0x200) = ? +$(S) $(XX) -- unlinkat(9, "other_input_data\x01\x02\x03\n\r\t", 0x200) = 22 +$(S) $(XX) -- symlinkat("input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- symlinkat("input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- symlinkat("input_data\x01\x02\x03\n\r\t", 7, "other_input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- symlinkat("input_data\x01\x02\x03\n\r\t", 7, "other_input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- symlinkat("input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- symlinkat("input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- symlinkat("input_data\x01\x02\x03\n\r\t", AT_FDCWD, (null)) = ? +$(S) $(XX) -- symlinkat("input_data\x01\x02\x03\n\r\t", AT_FDCWD, (null)) = 22 +$(S) $(XX) -- readlinkat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", $(XX), 16) = ? +$(S) $(XX) -- readlinkat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", "expected_output_data\x06\xff", 16) = 22 +$(S) $(XX) -- readlinkat(2, "input_data\x01\x02\x03\n\r\t", $(XX), 16) = ? +$(S) $(XX) -- readlinkat(2, "input_data\x01\x02\x03\n\r\t", "expected_output_data\x06\xff", 16) = 22 +$(S) $(XX) -- readlinkat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", $(XX), 16) = ? +$(S) $(XX) -- readlinkat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", "expected_output_data\x06\xff", 16) = 22 +$(S) $(XX) -- fchmodat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0644) = ? +$(S) $(XX) -- fchmodat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0644) = 22 +$(S) $(XX) -- fchmod(4, 0644) = ? +$(S) $(XX) -- fchmod(4, 0644) = 22 +$(S) $(XX) -- fchmodat(0, "input_data\x01\x02\x03\n\r\t", 0644) = ? +$(S) $(XX) -- fchmodat(0, "input_data\x01\x02\x03\n\r\t", 0644) = 22 +$(S) $(XX) -- fchmodat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0111) = ? +$(S) $(XX) -- fchmodat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0111) = 22 +$(S) $(XX) -- fchownat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x2, 0x3, 0x0) = ? +$(S) $(XX) -- fchownat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x2, 0x3, 0x0) = 22 +$(S) $(XX) -- fchown(4, 0x2, 0x3) = ? +$(S) $(XX) -- fchown(4, 0x2, 0x3) = 22 +$(S) $(XX) -- fchownat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x2, 0x3, 0x0) = ? +$(S) $(XX) -- fchownat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x2, 0x3, 0x0) = 22 +$(S) $(XX) -- fchownat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x2, 0x3, 0x100) = ? +$(S) $(XX) -- fchownat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x2, 0x3, 0x100) = 22 +$(S) $(XX) -- fchownat(99, "input_data\x01\x02\x03\n\r\t", 0x2, 0x3, 0x1000) = ? +$(S) $(XX) -- fchownat(99, "input_data\x01\x02\x03\n\r\t", 0x2, 0x3, 0x1000) = 22 +$(S) $(XX) -- fchownat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x2, 0x3, 0x100) = ? +$(S) $(XX) -- fchownat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x2, 0x3, 0x100) = 22 +$(S) $(XX) -- umask(0222) = ? +$(S) $(XX) -- umask(0222) = 026 +$(S) $(XX) -- gettimeofday(0x123000, 0x234000) = ? +$(S) $(XX) -- gettimeofday(0x123000, 0x234000) = 22 +$(S) $(XX) -- gettimeofday(0x0, 0x0) = ? +$(S) $(XX) -- gettimeofday(0x0, 0x0) = 22 +$(S) $(XX) -- settimeofday(0x123000, 0x234000) = ? +$(S) $(XX) -- settimeofday(0x123000, 0x234000) = 22 +$(S) $(XX) -- getrlimit(0x4, 0x234000) = ? +$(S) $(XX) -- getrlimit(0x4, 0x234000) = 22 +$(S) $(XX) -- getrlimit(0x1, 0x234000) = ? +$(S) $(XX) -- getrlimit(0x1, 0x234000) = 22 +$(S) $(XX) -- prlimit64(0x9, 0x4, 0x123000, 0x234000) = ? +$(S) $(XX) -- prlimit64(0x9, 0x4, 0x123000, 0x234000) = 22 +$(S) $(XX) -- prlimit64(0x8, 0x1, 0x123000, 0x234000) = ? +$(S) $(XX) -- prlimit64(0x8, 0x1, 0x123000, 0x234000) = 22 +$(S) $(XX) -- setrlimit(0x0, 0x123000) = ? +$(S) $(XX) -- setrlimit(0x0, 0x123000) = 22 +$(S) $(XX) -- getrusage(0x0, 0x123000) = ? +$(S) $(XX) -- getrusage(0x0, 0x123000) = 22 +$(S) $(XX) -- sysinfo(0x123000, 0x123000) = ? +$(S) $(XX) -- sysinfo(0x123000, 0x123000) = 22 +$(S) $(XX) -- times(0x0) = ? +$(S) $(XX) -- times(0x0) = 22 +$(S) $(XX) -- times(0x123000) = ? +$(S) $(XX) -- times(0x123000) = 22 +$(S) $(XX) -- getuid() = ? +$(S) $(XX) -- getuid() = 22 +$(S) $(XX) -- getgid() = ? +$(S) $(XX) -- getgid() = 22 +$(S) $(XX) -- setuid(0x7b) = ? +$(S) $(XX) -- setuid(0x7b) = 22 +$(S) $(XX) -- setgid(0x7b) = ? +$(S) $(XX) -- setgid(0x7b) = 22 +$(S) $(XX) -- geteuid() = ? +$(S) $(XX) -- geteuid() = 22 +$(S) $(XX) -- getegid() = ? +$(S) $(XX) -- getegid() = 22 +$(S) $(XX) -- setpgid() = ? +$(S) $(XX) -- setpgid() = 22 +$(S) $(XX) -- getppid() = ? +$(S) $(XX) -- getppid() = 22 +$(S) $(XX) -- getpgid(0x0) = ? +$(S) $(XX) -- getpgid(0x0) = 22 +$(S) $(XX) -- setsid() = ? +$(S) $(XX) -- setsid() = 22 +$(S) $(XX) -- setreuid(0x3, 0x4) = ? +$(S) $(XX) -- setreuid(0x3, 0x4) = 22 +$(S) $(XX) -- setregid(0x6, 0x7) = ? +$(S) $(XX) -- setregid(0x6, 0x7) = 22 +$(S) $(XX) -- getgroups(0x9, 0x123000) = ? +$(S) $(XX) -- getgroups(0x9, 0x123000) = 22 +$(S) $(XX) -- setgroups(0x9, 0x123000) = ? +$(S) $(XX) -- setgroups(0x9, 0x123000) = 22 +$(S) $(XX) -- setresuid(0x1, 0x2, 0x3) = ? +$(S) $(XX) -- setresuid(0x1, 0x2, 0x3) = 22 +$(S) $(XX) -- getresuid(0x123000, 0x234000, 0x234000) = ? +$(S) $(XX) -- getresuid(0x123000, 0x234000, 0x234000) = 22 +$(S) $(XX) -- setresgid(0x1, 0x2, 0x3) = ? +$(S) $(XX) -- setresgid(0x1, 0x2, 0x3) = 22 +$(S) $(XX) -- getresgid(0x123000, 0x234000, 0x234000) = ? +$(S) $(XX) -- getresgid(0x123000, 0x234000, 0x234000) = 22 +$(S) $(XX) -- getpgid(0x63) = ? +$(S) $(XX) -- getpgid(0x63) = 22 +$(S) $(XX) -- setfsuid(0x58) = ? +$(S) $(XX) -- setfsuid(0x58) = 22 +$(S) $(XX) -- setfsgid(0x4d) = ? +$(S) $(XX) -- setfsgid(0x4d) = 22 +$(S) $(XX) -- getsid(0x42) = ? +$(S) $(XX) -- getsid(0x42) = 22 +$(S) $(XX) -- syslog(0x5c, $(XX), 0x3) = ? +$(S) $(XX) -- syslog(0x5c, $(XX), 0x3) = 22 +$(S) $(XX) -- capget(0x123000, 0x234000) = ? +$(S) $(XX) -- capget(0x123000, 0x234000) = 22 +$(S) $(XX) -- capset(0x123000, 0x234000) = ? +$(S) $(XX) -- capset(0x123000, 0x234000) = 22 +$(S) $(XX) -- rt_sigpending(0x123000) = ? +$(S) $(XX) -- rt_sigpending(0x123000) = 22 +$(S) $(XX) -- rt_sigtimedwait(0x123000, 0x234000, 0x234000, 0x2) = ? +$(S) $(XX) -- rt_sigtimedwait(0x123000, 0x234000, 0x234000, 0x2) = 22 +$(S) $(XX) -- rt_sigqueueinfo(0x4d, 0x4, 0x123000) = ? +$(S) $(XX) -- rt_sigqueueinfo(0x4d, 0x4, 0x123000) = 22 +$(S) $(XX) -- rt_tgsigqueueinfo(0x4d, 0x58, 0xc, 0x123000) = ? +$(S) $(XX) -- rt_tgsigqueueinfo(0x4d, 0x58, 0xc, 0x123000) = 22 +$(S) $(XX) -- rt_sigsuspend(0x123000, 0x3) = ? +$(S) $(XX) -- rt_sigsuspend(0x123000, 0x3) = 22 +$(S) $(XX) -- sigaltstack(0x123000, 0x234000) = ? +$(S) $(XX) -- sigaltstack(0x123000, 0x234000) = 22 +$(S) $(XX) -- utimensat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", $(XX), $(XX)) = ? +$(S) $(XX) -- utimensat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", $(XX), $(XX)) = 22 +$(S) $(XX) -- utimensat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", $(XX), $(XX)) = ? +$(S) $(XX) -- utimensat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", $(XX), $(XX)) = 22 +$(S) $(XX) -- utimensat(4, "input_data\x01\x02\x03\n\r\t", $(XX), $(XX)) = ? +$(S) $(XX) -- utimensat(4, "input_data\x01\x02\x03\n\r\t", $(XX), $(XX)) = 22 +$(S) $(XX) -- mknodat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01, 0x2) = ? +$(S) $(XX) -- mknodat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01, 0x2) = 22 +$(S) $(XX) -- mknodat(1, "input_data\x01\x02\x03\n\r\t", 01, 0x2) = ? +$(S) $(XX) -- mknodat(1, "input_data\x01\x02\x03\n\r\t", 01, 0x2) = 22 +$(S) $(XX) -- mknodat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01, 0x2) = ? +$(S) $(XX) -- mknodat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01, 0x2) = 22 +$(S) $(XX) -- statfs("input_data\x01\x02\x03\n\r\t", 0x123000) = ? +$(S) $(XX) -- statfs("input_data\x01\x02\x03\n\r\t", 0x123000) = 22 +$(S) $(XX) -- fstatfs(4, 0x123000) = ? +$(S) $(XX) -- fstatfs(4, 0x123000) = 22 +$(S) $(XX) -- getpriority(0x1, 0x2) = ? +$(S) $(XX) -- getpriority(0x1, 0x2) = 22 +$(S) $(XX) -- setpriority(0x1, 0x2, 0x3) = ? +$(S) $(XX) -- setpriority(0x1, 0x2, 0x3) = 22 +$(S) $(XX) -- sched_setparam(0x1, 0x123000) = ? +$(S) $(XX) -- sched_setparam(0x1, 0x123000) = 22 +$(S) $(XX) -- sched_getparam(0x1, 0x123000) = ? +$(S) $(XX) -- sched_getparam(0x1, 0x123000) = 22 +$(S) $(XX) -- sched_setscheduler(0x1, 0x3, 0x123000) = ? +$(S) $(XX) -- sched_setscheduler(0x1, 0x3, 0x123000) = 22 +$(S) $(XX) -- sched_getscheduler(0x1) = ? +$(S) $(XX) -- sched_getscheduler(0x1) = 22 +$(S) $(XX) -- sched_get_priority_max(0x2) = ? +$(S) $(XX) -- sched_get_priority_max(0x2) = 22 +$(S) $(XX) -- sched_get_priority_min(0x2) = ? +$(S) $(XX) -- sched_get_priority_min(0x2) = 22 +$(S) $(XX) -- sched_rr_get_interval(0x1, 0x123000) = ? +$(S) $(XX) -- sched_rr_get_interval(0x1, 0x123000) = 22 +$(S) $(XX) -- sched_setaffinity(0x4d, 0x4, 0x123000) = ? +$(S) $(XX) -- sched_setaffinity(0x4d, 0x4, 0x123000) = 22 +$(S) $(XX) -- sched_getaffinity(0x4d, 0x4, 0x123000) = ? +$(S) $(XX) -- sched_getaffinity(0x4d, 0x4, 0x123000) = 22 +$(S) $(XX) -- vhangup() = ? +$(S) $(XX) -- vhangup() = 22 +$(S) $(XX) -- pivot_root("input_data\x01\x02\x03\n\r\t", $(XX)) = ? +$(S) $(XX) -- pivot_root("input_data\x01\x02\x03\n\r\t", $(XX)) = 22 +$(S) $(XX) -- prctl(0x18, 0x1, 0x2, 0x3, 0x4) = ? +$(S) $(XX) -- prctl(0x18, 0x1, 0x2, 0x3, 0x4) = 22 +$(S) $(XX) -- clock_adjtime(0x0, 0x123000) = ? +$(S) $(XX) -- clock_adjtime(0x0, 0x123000) = 22 +$(S) $(XX) -- chroot("input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- chroot("input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- sync() = ? +$(S) $(XX) -- sync() = 22 +$(S) $(XX) -- syncfs(3) = ? +$(S) $(XX) -- syncfs(3) = 22 +$(S) $(XX) -- acct("input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- acct("input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- mount("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", 0x123000, 0x80, 0x234000) = ? +$(S) $(XX) -- mount("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", 0x123000, 0x80, 0x234000) = 22 +$(S) $(XX) -- umount2("input_data\x01\x02\x03\n\r\t", 0x0) = ? +$(S) $(XX) -- umount2("input_data\x01\x02\x03\n\r\t", 0x0) = 22 +$(S) $(XX) -- umount2("input_data\x01\x02\x03\n\r\t", 0x2) = ? +$(S) $(XX) -- umount2("input_data\x01\x02\x03\n\r\t", 0x2) = 22 +$(S) $(XX) -- swapon("input_data\x01\x02\x03\n\r\t", 0x8000) = ? +$(S) $(XX) -- swapon("input_data\x01\x02\x03\n\r\t", 0x8000) = 22 +$(S) $(XX) -- swapoff("input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- swapoff("input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- sethostname($(XX), 0x10) = ? +$(S) $(XX) -- sethostname($(XX), 0x10) = 22 +$(S) $(XX) -- setdomainname($(XX), 0x10) = ? +$(S) $(XX) -- setdomainname($(XX), 0x10) = 22 +$(S) $(XX) -- init_module($(XX), 16, $(XX)) = ? +$(S) $(XX) -- init_module($(XX), 16, $(XX)) = 22 +$(S) $(XX) -- finit_module(3, 0x123000, 0x0) = ? +$(S) $(XX) -- finit_module(3, 0x123000, 0x0) = 22 +$(S) $(XX) -- delete_module($(S), $(XX)) = ? +$(S) $(XX) -- delete_module($(S), $(XX)) = 22 +$(S) $(XX) -- quotactl($(N), $(XX), $(N), $(XX)) = ? +$(S) $(XX) -- quotactl($(N), $(XX), $(N), $(XX)) = 22 +$(S) $(XX) -- gettid() = ? +$(S) $(XX) -- gettid() = 22 +$(S) $(XX) -- readahead(4, 17185, 123) = ? +$(S) $(XX) -- readahead(4, 17185, 123) = 22 +$(S) $(XX) -- setxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x1) = ? +$(S) $(XX) -- setxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x1) = 22 +$(S) $(XX) -- setxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x2) = ? +$(S) $(XX) -- setxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x2) = 22 +$(S) $(XX) -- lsetxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x1) = ? +$(S) $(XX) -- lsetxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x1) = 22 +$(S) $(XX) -- lsetxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x2) = ? +$(S) $(XX) -- lsetxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x2) = 22 +$(S) $(XX) -- fsetxattr(4, "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x2) = ? +$(S) $(XX) -- fsetxattr(4, "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x2) = 22 +$(S) $(XX) -- getxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = ? +$(S) $(XX) -- getxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = 22 +$(S) $(XX) -- getxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = ? +$(S) $(XX) -- getxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = 22 +$(S) $(XX) -- lgetxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = ? +$(S) $(XX) -- lgetxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = 22 +$(S) $(XX) -- lgetxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = ? +$(S) $(XX) -- lgetxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = 22 +$(S) $(XX) -- fgetxattr(4, "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = ? +$(S) $(XX) -- fgetxattr(4, "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = 22 +$(S) $(XX) -- listxattr("input_data\x01\x02\x03\n\r\t", 0x0000000000123000, 4) = ? +$(S) $(XX) -- listxattr("input_data\x01\x02\x03\n\r\t", 0x0000000000123000, 4) = 22 +$(S) $(XX) -- llistxattr("input_data\x01\x02\x03\n\r\t", 0x0000000000123000, 4) = ? +$(S) $(XX) -- llistxattr("input_data\x01\x02\x03\n\r\t", 0x0000000000123000, 4) = 22 +$(S) $(XX) -- flistxattr(5, 0x0000000000123000, 4) = ? +$(S) $(XX) -- flistxattr(5, 0x0000000000123000, 4) = 22 +$(S) $(XX) -- flistxattr(-100, 0x0000000000123000, 4) = ? +$(S) $(XX) -- flistxattr(-100, 0x0000000000123000, 4) = 22 +$(S) $(XX) -- removexattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- removexattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- lremovexattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- lremovexattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- fremovexattr(7, "other_input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- fremovexattr(7, "other_input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- tkill(0x2c, 0x13) = ? +$(S) $(XX) -- tkill(0x2c, 0x13) = 22 +$(S) $(XX) -- tgkill(0x2c, 0x37, 0x13) = ? +$(S) $(XX) -- tgkill(0x2c, 0x37, 0x13) = 22 +$(S) $(XX) -- futex(0x123000, 0x1, 0x7, 0x123000, 0x234000, 0x1) = ? +$(S) $(XX) -- futex(0x123000, 0x1, 0x7, 0x123000, 0x234000, 0x1) = 22 +$(S) $(XX) -- io_setup(0x1, 0x123000) = ? +$(S) $(XX) -- io_setup(0x1, 0x123000) = 22 +$(S) $(XX) -- io_destroy(0x4d) = ? +$(S) $(XX) -- io_destroy(0x4d) = 22 +$(S) $(XX) -- io_getevents(0x1, 0x2, 0x3, 0x123000, 0x234000) = ? +$(S) $(XX) -- io_getevents(0x1, 0x2, 0x3, 0x123000, 0x234000) = 22 +$(S) $(XX) -- io_submit(0x1, 0x2, 0x123000) = ? +$(S) $(XX) -- io_submit(0x1, 0x2, 0x123000) = 22 +$(S) $(XX) -- io_cancel(0x1, 0x123000, 0x234000) = ? +$(S) $(XX) -- io_cancel(0x1, 0x123000, 0x234000) = 22 +$(S) $(XX) -- lookup_dcookie(0x7b, 0x123000, 0xc) = ? +$(S) $(XX) -- lookup_dcookie(0x7b, 0x123000, 0xc) = 22 +$(S) $(XX) -- epoll_create1(0x0) = ? +$(S) $(XX) -- epoll_create1(0x0) = 22 +$(S) $(XX) -- epoll_create1(0x0) = ? +$(S) $(XX) -- epoll_create1(0x0) = 22 +$(S) $(XX) -- epoll_create1(0x80000) = ? +$(S) $(XX) -- epoll_create1(0x80000) = 22 +$(S) $(XX) -- epoll_pwait(2, 0x123000, 0x4, 0x5, 0x234000, 0x6) = ? +$(S) $(XX) -- epoll_pwait(2, 0x123000, 0x4, 0x5, 0x234000, 0x6) = 22 +$(S) $(XX) -- epoll_ctl(2, 0x3, 4, 0x123000) = ? +$(S) $(XX) -- epoll_ctl(2, 0x3, 4, 0x123000) = 22 +$(S) $(XX) -- set_tid_address(0x123000) = ? +$(S) $(XX) -- set_tid_address(0x123000) = 22 +$(S) $(XX) -- fadvise64(3, 0x64, 0x63, 0x2) = ? +$(S) $(XX) -- fadvise64(3, 0x64, 0x63, 0x2) = 22 +$(S) $(XX) -- timer_create(0x3, 0x123000, 0x234000) = ? +$(S) $(XX) -- timer_create(0x3, 0x123000, 0x234000) = 22 +$(S) $(XX) -- timer_settime(0x4, 0x0, 0x123000, 0x234000) = ? +$(S) $(XX) -- timer_settime(0x4, 0x0, 0x123000, 0x234000) = 22 +$(S) $(XX) -- timer_settime(0x4, 0x1, 0x123000, 0x234000) = ? +$(S) $(XX) -- timer_settime(0x4, 0x1, 0x123000, 0x234000) = 22 +$(S) $(XX) -- timer_gettime(0x3, 0x123000) = ? +$(S) $(XX) -- timer_gettime(0x3, 0x123000) = 22 +$(S) $(XX) -- timer_getoverrun(0x3) = ? +$(S) $(XX) -- timer_getoverrun(0x3) = 22 +$(S) $(XX) -- timer_delete(0x3) = ? +$(S) $(XX) -- timer_delete(0x3) = 22 +$(S) $(XX) -- clock_settime(0x7, 0x123000) = ? +$(S) $(XX) -- clock_settime(0x7, 0x123000) = 22 +$(S) $(XX) -- clock_gettime(0x7, 0x123000) = ? +$(S) $(XX) -- clock_gettime(0x7, 0x123000) = 22 +$(S) $(XX) -- clock_getres(0x3, 0x123000) = ? +$(S) $(XX) -- clock_getres(0x3, 0x123000) = 22 +$(S) $(XX) -- clock_nanosleep(0x1, 0x1, 0x123000, 0x234000) = ? +$(S) $(XX) -- clock_nanosleep(0x1, 0x1, 0x123000, 0x234000) = 22 +$(S) $(XX) -- mbind(0x123000, 0x0, 0x8002, 0x234000, 0x4) = ? +$(S) $(XX) -- mbind(0x123000, 0x0, 0x8002, 0x234000, 0x4) = 22 +$(S) $(XX) -- set_mempolicy(0x8000, 0x123000, 0x5) = ? +$(S) $(XX) -- set_mempolicy(0x8000, 0x123000, 0x5) = 22 +$(S) $(XX) -- get_mempolicy(0x123000, 0x234000, 0x6, 0x123000, 0x0) = ? +$(S) $(XX) -- get_mempolicy(0x123000, 0x234000, 0x6, 0x123000, 0x0) = 22 +$(S) $(XX) -- mq_open("input_data\x01\x02\x03\n\r\t", 0x42, 0x1ff, 0x123000, $(XX)) = ? +$(S) $(XX) -- mq_open("input_data\x01\x02\x03\n\r\t", 0x42, 0x1ff, 0x123000, $(XX)) = 22 +$(S) $(XX) -- mq_unlink("input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- mq_unlink("input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- mq_timedsend(0x1, $(XX), 0x10, 0x3, 0x123000) = ? +$(S) $(XX) -- mq_timedsend(0x1, $(XX), 0x10, 0x3, 0x123000) = 22 +$(S) $(XX) -- mq_timedreceive(0x1, $(XX), 0x10, 0x3, 0x123000) = ? +$(S) $(XX) -- mq_timedreceive(0x1, $(XX), 0x10, 0x3, 0x123000) = 22 +$(S) $(XX) -- mq_notify(0x1, 0x123000) = ? +$(S) $(XX) -- mq_notify(0x1, 0x123000) = 22 +$(S) $(XX) -- mq_getsetattr(0x1, 0x123000, 0x234000) = ? +$(S) $(XX) -- mq_getsetattr(0x1, 0x123000, 0x234000) = 22 +$(S) $(XX) -- kexec_load(0x1, 0x2, 0x123000, 0x2) = ? +$(S) $(XX) -- kexec_load(0x1, 0x2, 0x123000, 0x2) = 22 +$(S) $(XX) -- kexec_file_load(0x1, 0x2, 0x3, $(XX), 0x2) = ? +$(S) $(XX) -- kexec_file_load(0x1, 0x2, 0x3, $(XX), 0x2) = 22 +$(S) $(XX) -- waitid(0x1, 0x2, 0x123000, 0x4) = ? +$(S) $(XX) -- waitid(0x1, 0x2, 0x123000, 0x4) = 22 +$(S) $(XX) -- add_key(0x123000, 0x234000, 0x123000, 0x234000, 0x1) = ? +$(S) $(XX) -- add_key(0x123000, 0x234000, 0x123000, 0x234000, 0x1) = 22 +$(S) $(XX) -- request_key(0x123000, 0x234000, 0x123000, 0x1) = ? +$(S) $(XX) -- request_key(0x123000, 0x234000, 0x123000, 0x1) = 22 +$(S) $(XX) -- keyctl(0x0, 0x1, 0x2, 0x3, 0x4) = ? +$(S) $(XX) -- keyctl(0x0, 0x1, 0x2, 0x3, 0x4) = 22 +$(S) $(XX) -- ioprio_set(0x1, 0x3, 0x7b) = ? +$(S) $(XX) -- ioprio_set(0x1, 0x3, 0x7b) = 22 +$(S) $(XX) -- ioprio_get(0x1, 0x3) = ? +$(S) $(XX) -- ioprio_get(0x1, 0x3) = 22 +$(S) $(XX) -- inotify_init1(0x0) = ? +$(S) $(XX) -- inotify_init1(0x0) = 22 +$(S) $(XX) -- inotify_init1(0x800) = ? +$(S) $(XX) -- inotify_init1(0x800) = 22 +$(S) $(XX) -- inotify_init1(0x80000) = ? +$(S) $(XX) -- inotify_init1(0x80000) = 22 +$(S) $(XX) -- inotify_add_watch(7, "input_data\x01\x02\x03\n\r\t", 0x7b) = ? +$(S) $(XX) -- inotify_add_watch(7, "input_data\x01\x02\x03\n\r\t", 0x7b) = 22 +$(S) $(XX) -- inotify_rm_watch(7, 0x8) = ? +$(S) $(XX) -- inotify_rm_watch(7, 0x8) = 22 +$(S) $(XX) -- migrate_pages(0x1, 0x2, 0x123000, 0x234000) = ? +$(S) $(XX) -- migrate_pages(0x1, 0x2, 0x123000, 0x234000) = 22 +$(S) $(XX) -- unshare(0x20400) = ? +$(S) $(XX) -- unshare(0x20400) = 22 +$(S) $(XX) -- set_robust_list(0x123000, 33) = ? +$(S) $(XX) -- set_robust_list(0x123000, 33) = 22 +$(S) $(XX) -- get_robust_list(0x2c, 0x123000, 0x234000) = ? +$(S) $(XX) -- get_robust_list(0x2c, 0x123000, 0x234000) = 22 +$(S) $(XX) -- splice(2, 0x123000, 3, 0x234000, 0x7b, 0x1) = ? +$(S) $(XX) -- splice(2, 0x123000, 3, 0x234000, 0x7b, 0x1) = 22 +$(S) $(XX) -- splice(2, 0x123000, 3, 0x234000, 0x0, 0x4) = ? +$(S) $(XX) -- splice(2, 0x123000, 3, 0x234000, 0x0, 0x4) = 22 +$(S) $(XX) -- vmsplice(1, 0x123000, 0x2, 0x3) = ? +$(S) $(XX) -- vmsplice(1, 0x123000, 0x2, 0x3) = 22 +$(S) $(XX) -- tee(1, 2, 0x3, 0x0) = ? +$(S) $(XX) -- tee(1, 2, 0x3, 0x0) = 22 +$(S) $(XX) -- tee(1, 2, 0x3, 0x1) = ? +$(S) $(XX) -- tee(1, 2, 0x3, 0x1) = 22 +$(S) $(XX) -- tee(1, 2, 0x3, 0x2) = ? +$(S) $(XX) -- tee(1, 2, 0x3, 0x2) = 22 +$(S) $(XX) -- sync_file_range(2, 0x3, 0x4, 0x0) = ? +$(S) $(XX) -- sync_file_range(2, 0x3, 0x4, 0x0) = 22 +$(S) $(XX) -- sync_file_range(2, 0x3, 0x4, 0x1) = ? +$(S) $(XX) -- sync_file_range(2, 0x3, 0x4, 0x1) = 22 +$(S) $(XX) -- signalfd4(1, 0x123000, 0xd, 0x800, $(XX)) = ? +$(S) $(XX) -- signalfd4(1, 0x123000, 0xd, 0x800, $(XX)) = 22 +$(S) $(XX) -- timerfd_create(0x0, 0x80000) = ? +$(S) $(XX) -- timerfd_create(0x0, 0x80000) = 22 +$(S) $(XX) -- timerfd_settime(1, 0x1, 0x123000, 0x234000) = ? +$(S) $(XX) -- timerfd_settime(1, 0x1, 0x123000, 0x234000) = 22 +$(S) $(XX) -- timerfd_gettime(2, 0x123000) = ? +$(S) $(XX) -- timerfd_gettime(2, 0x123000) = 22 +$(S) $(XX) -- eventfd2(0x2f, 0x1) = ? +$(S) $(XX) -- eventfd2(0x2f, 0x1) = 22 +$(S) $(XX) -- fallocate(1, 0x2, 0x3, 0x4) = ? +$(S) $(XX) -- fallocate(1, 0x2, 0x3, 0x4) = 22 +$(S) $(XX) -- perf_event_open(0x123000, 0x1, 0x2, 0x3, 0x4) = ? +$(S) $(XX) -- perf_event_open(0x123000, 0x1, 0x2, 0x3, 0x4) = 22 +$(S) $(XX) -- fanotify_init(0x9, 0x2) = ? +$(S) $(XX) -- fanotify_init(0x9, 0x2) = 22 +$(S) $(XX) -- fanotify_mark(0x2, 0x2, 0x4000, 0x3, $(XX)) = ? +$(S) $(XX) -- fanotify_mark(0x2, 0x2, 0x4000, 0x3, $(XX)) = 22 +$(S) $(XX) -- name_to_handle_at(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x123000, 0x234000, 0x0) = ? +$(S) $(XX) -- name_to_handle_at(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x123000, 0x234000, 0x0) = 22 +$(S) $(XX) -- open_by_handle_at(3, 0x0000000000123000, 0) = ? +$(S) $(XX) -- open_by_handle_at(3, 0x0000000000123000, 0) = 22 +$(S) $(XX) -- setns(2, 0x0) = ? +$(S) $(XX) -- setns(2, 0x0) = 22 +$(S) $(XX) -- getcpu(0x123000, 0x123000, 0x234000) = ? +$(S) $(XX) -- getcpu(0x123000, 0x123000, 0x234000) = 22 +$(S) $(XX) -- process_vm_readv(0x1, 0x2, 0x3, 0x4, 0x5, 0x6) = ? +$(S) $(XX) -- process_vm_readv(0x1, 0x2, 0x3, 0x4, 0x5, 0x6) = 22 +$(S) $(XX) -- process_vm_writev(0x1, 0x2, 0x3, 0x4, 0x5, 0x6) = ? +$(S) $(XX) -- process_vm_writev(0x1, 0x2, 0x3, 0x4, 0x5, 0x6) = 22 +$(S) $(XX) -- kcmp(0x1, 0x2, 0x3, 0x4, 0x5) = ? +$(S) $(XX) -- kcmp(0x1, 0x2, 0x3, 0x4, 0x5) = 22 diff --git a/test/arch/x86_64/CMakeLists.txt b/test/arch/x86_64/CMakeLists.txt new file mode 100644 index 0000000..3eb8b8e --- /dev/null +++ b/test/arch/x86_64/CMakeLists.txt @@ -0,0 +1,201 @@ +# +# Copyright 2017-2020, Intel Corporation +# Copyright 2025, University of Turin +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# * Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# See: https://cmake.org/Wiki/CMake/Testing_With_CTest + +set(CHECK_LOG_COMMON_ARGS_VFORK + -DMATCH_SCRIPT=${PROJECT_SOURCE_DIR}/utils/match.pl + -DEXPECT_SPURIOUS_SYSCALLS=${EXPECT_SPURIOUS_SYSCALLS} + -P ${CMAKE_CURRENT_SOURCE_DIR}/check_log.cmake) + +set(CMAKE_ASM_CREATE_SHARED_LIBRARY ${CMAKE_C_CREATE_SHARED_LIBRARY}) + +add_executable(asm_pattern asm_pattern.c + $ + $) +target_link_libraries(asm_pattern PUBLIC ${CAPSTONE_LIB_FOLDER}/libcapstone.so) + +target_link_libraries(asm_pattern + PRIVATE ${CMAKE_DL_LIBS} ${capstone_LDFLAGS}) + +set(asm_patterns + nosyscall + pattern1 + pattern2 + pattern3 + pattern4 + pattern_loop + pattern_loop2 + pattern_symbol_boundary0 + pattern_symbol_boundary1 + pattern_symbol_boundary2 + pattern_symbol_boundary3 + pattern_nop_padding0 + pattern_nop_padding1 + pattern_nop_padding2 + pattern_nop_padding3 + pattern_nop_padding4 + pattern_nop_padding5 + pattern_nop_padding6 + pattern_nop_padding7 + pattern_nop_padding8 + pattern_nop_padding9 + pattern_lea_rip_rdi + pattern_lea_rip_r12) + +try_compile(ASSEMBLER_SUPPORTS_ENDBR64 ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/pattern_endbr64.in.S + CMAKE_FLAGS "-DCMAKE_ASM_LINK_EXECUTABLE='echo skip linking'") +if(ASSEMBLER_SUPPORTS_ENDBR64) + list(APPEND asm_patterns pattern_endbr64) +endif() + +set(asm_patterns_failing + pattern_double_syscall + pattern_rets + pattern_jmps) + +macro(add_asm_test test_name failing) + add_library(${test_name}.in SHARED ${test_name}.in.S) + add_library(${test_name}.out SHARED ${test_name}.out.S) + if(LINKER_HAS_NOSTDLIB) + set_target_properties(${test_name}.in + PROPERTIES LINK_FLAGS "-nostdlib") + set_target_properties(${test_name}.out + PROPERTIES LINK_FLAGS "-nostdlib") + endif() + if(HAS_NOUNUSEDARG) + target_compile_options(${test_name}.in BEFORE + PRIVATE "-Wno-unused-command-line-argument") + target_compile_options(${test_name}.out BEFORE + PRIVATE "-Wno-unused-command-line-argument") + + endif() + add_test(NAME "asm_pattern_${test_name}" + COMMAND $ + $ + $) + if(${failing}) + set_tests_properties("asm_pattern_${test_name}" + PROPERTIES WILL_FAIL ON + PASS_REGULAR_EXPRESSION "Invalid patch") + endif() +endmacro() + +foreach(name ${asm_patterns}) + add_asm_test(${name} FALSE) +endforeach() + +foreach(name ${asm_patterns_failing}) + add_asm_test(${name} TRUE) +endforeach() + +add_executable(executable_with_syscall_pie executable_with_syscall.S) +if(HAS_NOUNUSEDARG) + target_compile_options(executable_with_syscall_pie BEFORE + PRIVATE "-Wno-unused-command-line-argument") +endif() +set_target_properties(executable_with_syscall_pie + PROPERTIES POSITION_INDEPENDENT_CODE True) +if(HAS_ARG_PIE) + target_compile_options(executable_with_syscall_pie PRIVATE "-pie") + target_link_libraries(executable_with_syscall_pie PRIVATE "-pie") +endif() + +add_executable(executable_with_syscall_no_pie executable_with_syscall.S) +if(HAS_NOUNUSEDARG) + target_compile_options(executable_with_syscall_no_pie BEFORE + PRIVATE "-Wno-unused-command-line-argument") +endif() +set_target_properties(executable_with_syscall_no_pie + PROPERTIES POSITION_INDEPENDENT_CODE False) +if(HAS_ARG_NOPIE) + target_compile_options(executable_with_syscall_no_pie PRIVATE "-nopie") + target_link_libraries(executable_with_syscall_no_pie PRIVATE "-nopie") +elseif(HAS_ARG_NO_PIE) + target_compile_options(executable_with_syscall_no_pie PRIVATE "-no-pie") + target_link_libraries(executable_with_syscall_no_pie PRIVATE "-no-pie") +endif() + +add_test(NAME "prog_pie_intercept_libc_only" + COMMAND ${CMAKE_COMMAND} + -DTEST_EXTRA_PRELOAD=${TEST_EXTRA_PRELOAD} + -DTEST_PROG=$ + -DLIB_FILE=$ + -DTEST_PROG_ARGS=original_syscall + -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake) +set_tests_properties("prog_pie_intercept_libc_only" + PROPERTIES PASS_REGULAR_EXPRESSION "original_syscall") + +add_test(NAME "prog_no_pie_intercept_libc_only" + COMMAND ${CMAKE_COMMAND} + -DTEST_EXTRA_PRELOAD=${TEST_EXTRA_PRELOAD} + -DTEST_PROG=$ + -DLIB_FILE=$ + -DTEST_PROG_ARGS=original_syscall + -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake) +set_tests_properties("prog_no_pie_intercept_libc_only" + PROPERTIES PASS_REGULAR_EXPRESSION "original_syscall") + +add_test(NAME "prog_pie_intercept_all" + COMMAND ${CMAKE_COMMAND} + -DTEST_EXTRA_PRELOAD=${TEST_EXTRA_PRELOAD} + -DINTERCEPT_ALL=1 + -DTEST_PROG=$ + -DLIB_FILE=$ + -DTEST_PROG_ARGS=original_syscall + -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake) +set_tests_properties("prog_pie_intercept_all" + PROPERTIES PASS_REGULAR_EXPRESSION "intercepted_call") + +add_test(NAME "prog_no_pie_intercept_all" + COMMAND ${CMAKE_COMMAND} + -DTEST_EXTRA_PRELOAD=${TEST_EXTRA_PRELOAD} + -DINTERCEPT_ALL=1 + -DTEST_PROG=$ + -DLIB_FILE=$ + -DTEST_PROG_ARGS=original_syscall + -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake) +set_tests_properties("prog_no_pie_intercept_all" + PROPERTIES PASS_REGULAR_EXPRESSION "intercepted_call") + +add_executable(vfork_logging vfork_logging.c) +add_test(NAME "vfork_logging" + COMMAND ${CMAKE_COMMAND} + -DTEST_EXTRA_PRELOAD=${TEST_EXTRA_PRELOAD} + -DTEST_PROG=$ + -DLIB_FILE=$ + -DMATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/libcintercept2.log.match + -DTEST_NAME=vfork_logging + ${CHECK_LOG_COMMON_ARGS_VFORK}) +set_tests_properties("vfork_logging" + PROPERTIES PASS_REGULAR_EXPRESSION "in_child_created_using_vfork") \ No newline at end of file diff --git a/test/asm_pattern.c b/test/arch/x86_64/asm_pattern.c similarity index 100% rename from test/asm_pattern.c rename to test/arch/x86_64/asm_pattern.c diff --git a/test/arch/x86_64/check.cmake b/test/arch/x86_64/check.cmake new file mode 100644 index 0000000..31823f3 --- /dev/null +++ b/test/arch/x86_64/check.cmake @@ -0,0 +1,62 @@ +# +# Copyright 2017, Intel Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# * Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +if(FILTER_PLUS_ONECHAR) + string(SUBSTRING "${FILTER_PLUS_ONECHAR}" 1 -1 FILTER) +endif() + +if(FILTER) + set(ENV{INTERCEPT_HOOK_CMDLINE_FILTER} ${FILTER}) + message("FILTER: ${FILTER}") +endif() + +if(LIB_FILE) +if(TEST_EXTRA_PRELOAD) + set(ENV{LD_PRELOAD} ${TEST_EXTRA_PRELOAD}:${LIB_FILE}) +else() + set(ENV{LD_PRELOAD} ${LIB_FILE}) +endif() +endif() + +if(INTERCEPT_ALL) + set(ENV{INTERCEPT_ALL_OBJS} 1) +else() + unset(ENV{INTERCEPT_ALL_OBJS}) +endif() + +execute_process(COMMAND ${TEST_PROG} ${TEST_PROG_ARGS} RESULT_VARIABLE HAD_ERROR) + +unset(ENV{LD_PRELOAD}) + +if(HAD_ERROR) + message(FATAL_ERROR "Error: ${HAD_ERROR}") +endif() diff --git a/test/arch/x86_64/check_log.cmake b/test/arch/x86_64/check_log.cmake new file mode 100644 index 0000000..56c89ab --- /dev/null +++ b/test/arch/x86_64/check_log.cmake @@ -0,0 +1,93 @@ +# +# Copyright 2017, Intel Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# * Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +# XXX ask for a unique tempfile from cmake for LOG_OUTPUT +set(LOG_OUTPUT .log.${TEST_NAME}) + +execute_process(COMMAND ${CMAKE_COMMAND} -E remove -f ${LOG_OUTPUT}) + +set(ENV{INTERCEPT_ALL_OBJS} 1) + +if(HAS_SECOND_LOG) + set(SECOND_LOG_OUTPUT .log.2.${TEST_NAME}) + execute_process(COMMAND ${CMAKE_COMMAND} -E remove -f ${SECOND_LOG_OUTPUT}) +endif() + +if(HAS_SECOND_LOG) + message("Executing: LD_PRELOAD=${LIB_FILE} + INTERCEPT_ALL_OBJS=1 + ${TEST_PROG} ${TEST_PROG_ARG} ${LOG_OUTPUT} ${SECOND_LOG_OUTPUT}") + if(TEST_EXTRA_PRELOAD) + set(ENV{LD_PRELOAD} ${TEST_EXTRA_PRELOAD}:${LIB_FILE}) + else() + set(ENV{LD_PRELOAD} ${LIB_FILE}) + endif() + execute_process(COMMAND ${TEST_PROG} + ${TEST_PROG_ARG} ${LOG_OUTPUT} ${SECOND_LOG_OUTPUT} + RESULT_VARIABLE HAD_ERROR) + unset(ENV{LD_PRELOAD}) +else() + message("Executing: LD_PRELOAD=${LIB_FILE} + INTERCEPT_ALL_OBJS=1 + ${TEST_PROG} ${TEST_PROG_ARG} ${LOG_OUTPUT}") + if(TEST_EXTRA_PRELOAD) + set(ENV{LD_PRELOAD} ${TEST_EXTRA_PRELOAD}:${LIB_FILE}) + else() + set(ENV{LD_PRELOAD} ${LIB_FILE}) + endif() + execute_process(COMMAND ${TEST_PROG} ${TEST_PROG_ARG} ${LOG_OUTPUT} + RESULT_VARIABLE HAD_ERROR) + unset(ENV{LD_PRELOAD}) +endif() + +if(HAD_ERROR) + message(FATAL_ERROR "Test failed: ${HAD_ERROR}") +endif() + +if(NOT EXPECT_SPURIOUS_SYSCALLS) + execute_process(COMMAND + ${MATCH_SCRIPT} -o ${LOG_OUTPUT} ${MATCH_FILE} + RESULT_VARIABLE MATCH_ERROR) + + if(MATCH_ERROR) + message(FATAL_ERROR "Log does not match! ${MATCH_ERROR}") + endif() + + if(HAS_SECOND_LOG) + execute_process(COMMAND + ${MATCH_SCRIPT} -o ${SECOND_LOG_OUTPUT} ${SECOND_MATCH_FILE} + RESULT_VARIABLE MATCH_ERROR) + if(MATCH_ERROR) + message(FATAL_ERROR "Second log does not match! ${MATCH_ERROR}") + endif() + endif() +endif() diff --git a/test/executable_with_syscall.S b/test/arch/x86_64/executable_with_syscall.S similarity index 100% rename from test/executable_with_syscall.S rename to test/arch/x86_64/executable_with_syscall.S diff --git a/test/libcintercept2.log.match b/test/arch/x86_64/libcintercept2.log.match similarity index 100% rename from test/libcintercept2.log.match rename to test/arch/x86_64/libcintercept2.log.match diff --git a/test/mock_trampoline_table.S b/test/arch/x86_64/mock_trampoline_table.S similarity index 100% rename from test/mock_trampoline_table.S rename to test/arch/x86_64/mock_trampoline_table.S diff --git a/test/nosyscall.in.S b/test/arch/x86_64/nosyscall.in.S similarity index 100% rename from test/nosyscall.in.S rename to test/arch/x86_64/nosyscall.in.S diff --git a/test/nosyscall.out.S b/test/arch/x86_64/nosyscall.out.S similarity index 100% rename from test/nosyscall.out.S rename to test/arch/x86_64/nosyscall.out.S diff --git a/test/pattern1.in.S b/test/arch/x86_64/pattern1.in.S similarity index 100% rename from test/pattern1.in.S rename to test/arch/x86_64/pattern1.in.S diff --git a/test/pattern1.out.S b/test/arch/x86_64/pattern1.out.S similarity index 100% rename from test/pattern1.out.S rename to test/arch/x86_64/pattern1.out.S diff --git a/test/pattern2.in.S b/test/arch/x86_64/pattern2.in.S similarity index 100% rename from test/pattern2.in.S rename to test/arch/x86_64/pattern2.in.S diff --git a/test/pattern2.out.S b/test/arch/x86_64/pattern2.out.S similarity index 100% rename from test/pattern2.out.S rename to test/arch/x86_64/pattern2.out.S diff --git a/test/pattern3.in.S b/test/arch/x86_64/pattern3.in.S similarity index 100% rename from test/pattern3.in.S rename to test/arch/x86_64/pattern3.in.S diff --git a/test/pattern3.out.S b/test/arch/x86_64/pattern3.out.S similarity index 100% rename from test/pattern3.out.S rename to test/arch/x86_64/pattern3.out.S diff --git a/test/pattern4.in.S b/test/arch/x86_64/pattern4.in.S similarity index 100% rename from test/pattern4.in.S rename to test/arch/x86_64/pattern4.in.S diff --git a/test/pattern4.out.S b/test/arch/x86_64/pattern4.out.S similarity index 100% rename from test/pattern4.out.S rename to test/arch/x86_64/pattern4.out.S diff --git a/test/pattern_double_syscall.in.S b/test/arch/x86_64/pattern_double_syscall.in.S similarity index 100% rename from test/pattern_double_syscall.in.S rename to test/arch/x86_64/pattern_double_syscall.in.S diff --git a/test/pattern_double_syscall.out.S b/test/arch/x86_64/pattern_double_syscall.out.S similarity index 100% rename from test/pattern_double_syscall.out.S rename to test/arch/x86_64/pattern_double_syscall.out.S diff --git a/test/pattern_endbr64.in.S b/test/arch/x86_64/pattern_endbr64.in.S similarity index 100% rename from test/pattern_endbr64.in.S rename to test/arch/x86_64/pattern_endbr64.in.S diff --git a/test/pattern_endbr64.out.S b/test/arch/x86_64/pattern_endbr64.out.S similarity index 100% rename from test/pattern_endbr64.out.S rename to test/arch/x86_64/pattern_endbr64.out.S diff --git a/test/pattern_jmps.in.S b/test/arch/x86_64/pattern_jmps.in.S similarity index 100% rename from test/pattern_jmps.in.S rename to test/arch/x86_64/pattern_jmps.in.S diff --git a/test/pattern_jmps.out.S b/test/arch/x86_64/pattern_jmps.out.S similarity index 100% rename from test/pattern_jmps.out.S rename to test/arch/x86_64/pattern_jmps.out.S diff --git a/test/pattern_lea_rip_r12.in.S b/test/arch/x86_64/pattern_lea_rip_r12.in.S similarity index 100% rename from test/pattern_lea_rip_r12.in.S rename to test/arch/x86_64/pattern_lea_rip_r12.in.S diff --git a/test/pattern_lea_rip_r12.out.S b/test/arch/x86_64/pattern_lea_rip_r12.out.S similarity index 100% rename from test/pattern_lea_rip_r12.out.S rename to test/arch/x86_64/pattern_lea_rip_r12.out.S diff --git a/test/pattern_lea_rip_rdi.in.S b/test/arch/x86_64/pattern_lea_rip_rdi.in.S similarity index 100% rename from test/pattern_lea_rip_rdi.in.S rename to test/arch/x86_64/pattern_lea_rip_rdi.in.S diff --git a/test/pattern_lea_rip_rdi.out.S b/test/arch/x86_64/pattern_lea_rip_rdi.out.S similarity index 100% rename from test/pattern_lea_rip_rdi.out.S rename to test/arch/x86_64/pattern_lea_rip_rdi.out.S diff --git a/test/pattern_loop.in.S b/test/arch/x86_64/pattern_loop.in.S similarity index 100% rename from test/pattern_loop.in.S rename to test/arch/x86_64/pattern_loop.in.S diff --git a/test/pattern_loop.out.S b/test/arch/x86_64/pattern_loop.out.S similarity index 100% rename from test/pattern_loop.out.S rename to test/arch/x86_64/pattern_loop.out.S diff --git a/test/pattern_loop2.in.S b/test/arch/x86_64/pattern_loop2.in.S similarity index 100% rename from test/pattern_loop2.in.S rename to test/arch/x86_64/pattern_loop2.in.S diff --git a/test/pattern_loop2.out.S b/test/arch/x86_64/pattern_loop2.out.S similarity index 100% rename from test/pattern_loop2.out.S rename to test/arch/x86_64/pattern_loop2.out.S diff --git a/test/pattern_nop_padding0.in.S b/test/arch/x86_64/pattern_nop_padding0.in.S similarity index 100% rename from test/pattern_nop_padding0.in.S rename to test/arch/x86_64/pattern_nop_padding0.in.S diff --git a/test/pattern_nop_padding0.out.S b/test/arch/x86_64/pattern_nop_padding0.out.S similarity index 100% rename from test/pattern_nop_padding0.out.S rename to test/arch/x86_64/pattern_nop_padding0.out.S diff --git a/test/pattern_nop_padding1.in.S b/test/arch/x86_64/pattern_nop_padding1.in.S similarity index 100% rename from test/pattern_nop_padding1.in.S rename to test/arch/x86_64/pattern_nop_padding1.in.S diff --git a/test/pattern_nop_padding1.out.S b/test/arch/x86_64/pattern_nop_padding1.out.S similarity index 100% rename from test/pattern_nop_padding1.out.S rename to test/arch/x86_64/pattern_nop_padding1.out.S diff --git a/test/pattern_nop_padding2.in.S b/test/arch/x86_64/pattern_nop_padding2.in.S similarity index 100% rename from test/pattern_nop_padding2.in.S rename to test/arch/x86_64/pattern_nop_padding2.in.S diff --git a/test/pattern_nop_padding2.out.S b/test/arch/x86_64/pattern_nop_padding2.out.S similarity index 100% rename from test/pattern_nop_padding2.out.S rename to test/arch/x86_64/pattern_nop_padding2.out.S diff --git a/test/pattern_nop_padding3.in.S b/test/arch/x86_64/pattern_nop_padding3.in.S similarity index 100% rename from test/pattern_nop_padding3.in.S rename to test/arch/x86_64/pattern_nop_padding3.in.S diff --git a/test/pattern_nop_padding3.out.S b/test/arch/x86_64/pattern_nop_padding3.out.S similarity index 100% rename from test/pattern_nop_padding3.out.S rename to test/arch/x86_64/pattern_nop_padding3.out.S diff --git a/test/pattern_nop_padding4.in.S b/test/arch/x86_64/pattern_nop_padding4.in.S similarity index 100% rename from test/pattern_nop_padding4.in.S rename to test/arch/x86_64/pattern_nop_padding4.in.S diff --git a/test/pattern_nop_padding4.out.S b/test/arch/x86_64/pattern_nop_padding4.out.S similarity index 100% rename from test/pattern_nop_padding4.out.S rename to test/arch/x86_64/pattern_nop_padding4.out.S diff --git a/test/pattern_nop_padding5.in.S b/test/arch/x86_64/pattern_nop_padding5.in.S similarity index 100% rename from test/pattern_nop_padding5.in.S rename to test/arch/x86_64/pattern_nop_padding5.in.S diff --git a/test/pattern_nop_padding5.out.S b/test/arch/x86_64/pattern_nop_padding5.out.S similarity index 100% rename from test/pattern_nop_padding5.out.S rename to test/arch/x86_64/pattern_nop_padding5.out.S diff --git a/test/pattern_nop_padding6.in.S b/test/arch/x86_64/pattern_nop_padding6.in.S similarity index 100% rename from test/pattern_nop_padding6.in.S rename to test/arch/x86_64/pattern_nop_padding6.in.S diff --git a/test/pattern_nop_padding6.out.S b/test/arch/x86_64/pattern_nop_padding6.out.S similarity index 100% rename from test/pattern_nop_padding6.out.S rename to test/arch/x86_64/pattern_nop_padding6.out.S diff --git a/test/pattern_nop_padding7.in.S b/test/arch/x86_64/pattern_nop_padding7.in.S similarity index 100% rename from test/pattern_nop_padding7.in.S rename to test/arch/x86_64/pattern_nop_padding7.in.S diff --git a/test/pattern_nop_padding7.out.S b/test/arch/x86_64/pattern_nop_padding7.out.S similarity index 100% rename from test/pattern_nop_padding7.out.S rename to test/arch/x86_64/pattern_nop_padding7.out.S diff --git a/test/pattern_nop_padding8.in.S b/test/arch/x86_64/pattern_nop_padding8.in.S similarity index 100% rename from test/pattern_nop_padding8.in.S rename to test/arch/x86_64/pattern_nop_padding8.in.S diff --git a/test/pattern_nop_padding8.out.S b/test/arch/x86_64/pattern_nop_padding8.out.S similarity index 100% rename from test/pattern_nop_padding8.out.S rename to test/arch/x86_64/pattern_nop_padding8.out.S diff --git a/test/pattern_nop_padding9.in.S b/test/arch/x86_64/pattern_nop_padding9.in.S similarity index 100% rename from test/pattern_nop_padding9.in.S rename to test/arch/x86_64/pattern_nop_padding9.in.S diff --git a/test/pattern_nop_padding9.out.S b/test/arch/x86_64/pattern_nop_padding9.out.S similarity index 100% rename from test/pattern_nop_padding9.out.S rename to test/arch/x86_64/pattern_nop_padding9.out.S diff --git a/test/pattern_rets.in.S b/test/arch/x86_64/pattern_rets.in.S similarity index 100% rename from test/pattern_rets.in.S rename to test/arch/x86_64/pattern_rets.in.S diff --git a/test/pattern_rets.out.S b/test/arch/x86_64/pattern_rets.out.S similarity index 100% rename from test/pattern_rets.out.S rename to test/arch/x86_64/pattern_rets.out.S diff --git a/test/pattern_symbol_boundary0.in.S b/test/arch/x86_64/pattern_symbol_boundary0.in.S similarity index 100% rename from test/pattern_symbol_boundary0.in.S rename to test/arch/x86_64/pattern_symbol_boundary0.in.S diff --git a/test/pattern_symbol_boundary0.out.S b/test/arch/x86_64/pattern_symbol_boundary0.out.S similarity index 100% rename from test/pattern_symbol_boundary0.out.S rename to test/arch/x86_64/pattern_symbol_boundary0.out.S diff --git a/test/pattern_symbol_boundary1.in.S b/test/arch/x86_64/pattern_symbol_boundary1.in.S similarity index 100% rename from test/pattern_symbol_boundary1.in.S rename to test/arch/x86_64/pattern_symbol_boundary1.in.S diff --git a/test/pattern_symbol_boundary1.out.S b/test/arch/x86_64/pattern_symbol_boundary1.out.S similarity index 100% rename from test/pattern_symbol_boundary1.out.S rename to test/arch/x86_64/pattern_symbol_boundary1.out.S diff --git a/test/pattern_symbol_boundary2.in.S b/test/arch/x86_64/pattern_symbol_boundary2.in.S similarity index 100% rename from test/pattern_symbol_boundary2.in.S rename to test/arch/x86_64/pattern_symbol_boundary2.in.S diff --git a/test/pattern_symbol_boundary2.out.S b/test/arch/x86_64/pattern_symbol_boundary2.out.S similarity index 100% rename from test/pattern_symbol_boundary2.out.S rename to test/arch/x86_64/pattern_symbol_boundary2.out.S diff --git a/test/pattern_symbol_boundary3.in.S b/test/arch/x86_64/pattern_symbol_boundary3.in.S similarity index 100% rename from test/pattern_symbol_boundary3.in.S rename to test/arch/x86_64/pattern_symbol_boundary3.in.S diff --git a/test/pattern_symbol_boundary3.out.S b/test/arch/x86_64/pattern_symbol_boundary3.out.S similarity index 100% rename from test/pattern_symbol_boundary3.out.S rename to test/arch/x86_64/pattern_symbol_boundary3.out.S diff --git a/test/arch/x86_64/syscall_format.log.match b/test/arch/x86_64/syscall_format.log.match new file mode 100644 index 0000000..716037b --- /dev/null +++ b/test/arch/x86_64/syscall_format.log.match @@ -0,0 +1,782 @@ +$(S) $(XX) -- read(9, (null), 44) = ? +$(S) $(XX) -- read(9, (null), 44) = 22 +$(S) $(XX) -- read(7, $(XX), 19) = ? +$(S) $(XX) -- read(7, "expected_output_data\x06\xff", 19) = 22 +$(S) $(XX) -- write(7, "input_data\x01\x02\x03\n\r\t\0\0\0\0", 20) = ? +$(S) $(XX) -- write(7, "input_data\x01\x02\x03\n\r\t\0\0\0\0", 20) = 22 +$(S) $(XX) -- pread64(7, $(XX), 19, 4294967311) = ? +$(S) $(XX) -- pread64(7, "expected_output_data\x06\xff", 19, 4294967311) = 22 +$(S) $(XX) -- pread64(-99, $(XX), 18, 0) = ? +$(S) $(XX) -- pread64(-99, "expected_output_data\x06\xff", 18, 0) = 22 +$(S) $(XX) -- pread64(8, (null), 18, 0) = ? +$(S) $(XX) -- pread64(8, (null), 18, 0) = 22 +$(S) $(XX) -- pwrite64(7, "input_data\x01\x02\x03\n\r\t\0\0\0", 19, 4294967311) = ? +$(S) $(XX) -- pwrite64(7, "input_data\x01\x02\x03\n\r\t\0\0\0", 19, 4294967311) = 22 +$(S) $(XX) -- pwrite64(-99, "input_data\x01\x02\x03\n\r\t\0\0", 18, 0) = ? +$(S) $(XX) -- pwrite64(-99, "input_data\x01\x02\x03\n\r\t\0\0", 18, 0) = 22 +$(S) $(XX) -- pwrite64(-100, (null), 18, -1) = ? +$(S) $(XX) -- pwrite64(-100, (null), 18, -1) = 22 +$(S) $(XX) -- readv(1, 0x0000000000123000, 4) = ? +$(S) $(XX) -- readv(1, 0x0000000000123000, 4) = 22 +$(S) $(XX) -- readv(1, (null), 4) = ? +$(S) $(XX) -- readv(1, (null), 4) = 22 +$(S) $(XX) -- writev(1, 0x0000000000123000, 4) = ? +$(S) $(XX) -- writev(1, 0x0000000000123000, 4) = 22 +$(S) $(XX) -- writev(1, (null), 4) = ? +$(S) $(XX) -- writev(1, (null), 4) = 22 +$(S) $(XX) -- preadv(1, 0x123000, 0x4, 0x1000) = ? +$(S) $(XX) -- preadv(1, 0x123000, 0x4, 0x1000) = 22 +$(S) $(XX) -- preadv(1, 0x0, 0x4, 0x1000) = ? +$(S) $(XX) -- preadv(1, 0x0, 0x4, 0x1000) = 22 +$(S) $(XX) -- pwritev(1, 0x123000, 0x4, 0x1000) = ? +$(S) $(XX) -- pwritev(1, 0x123000, 0x4, 0x1000) = 22 +$(S) $(XX) -- pwritev(1, 0x0, 0x4, 0x1000) = ? +$(S) $(XX) -- pwritev(1, 0x0, 0x4, 0x1000) = 22 +$(S) $(XX) -- open("input_data\x01\x02\x03\n\r\t", O_RDWR | O_CREAT | O_DSYNC | O_RSYNC, 0321) = ? +$(S) $(XX) -- open("input_data\x01\x02\x03\n\r\t", O_RDWR | O_CREAT | O_DSYNC | O_RSYNC, 0321) = 22 +$(S) $(XX) -- open("input_data\x01\x02\x03\n\r\t", O_RDONLY) = ? +$(S) $(XX) -- open("input_data\x01\x02\x03\n\r\t", O_RDONLY) = 22 +$(S) $(XX) -- open((null), O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = ? +$(S) $(XX) -- open((null), O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = 22 +$(S) $(XX) -- open("input_data\x01\x02\x03\n\r\t", O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = ? +$(S) $(XX) -- open("input_data\x01\x02\x03\n\r\t", O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = 22 +$(S) $(XX) -- open("other_input_data\x01\x02\x03\n\r\t", O_RDWR | O_NONBLOCK) = ? +$(S) $(XX) -- open("other_input_data\x01\x02\x03\n\r\t", O_RDWR | O_NONBLOCK) = 22 +$(S) $(XX) -- open("other_input_data\x01\x02\x03\n\r\t", O_RDONLY) = ? +$(S) $(XX) -- open("other_input_data\x01\x02\x03\n\r\t", O_RDONLY) = 22 +$(S) $(XX) -- open((null), O_RDONLY) = ? +$(S) $(XX) -- open((null), O_RDONLY) = 22 +$(S) $(XX) -- openat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", O_RDWR | O_CREAT | O_DSYNC | O_RSYNC, 0321) = ? +$(S) $(XX) -- openat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", O_RDWR | O_CREAT | O_DSYNC | O_RSYNC, 0321) = 22 +$(S) $(XX) -- openat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", O_RDONLY) = ? +$(S) $(XX) -- openat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", O_RDONLY) = 22 +$(S) $(XX) -- openat(AT_FDCWD, (null), O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = ? +$(S) $(XX) -- openat(AT_FDCWD, (null), O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = 22 +$(S) $(XX) -- openat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = ? +$(S) $(XX) -- openat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = 22 +$(S) $(XX) -- openat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", O_RDWR | O_NONBLOCK) = ? +$(S) $(XX) -- openat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", O_RDWR | O_NONBLOCK) = 22 +$(S) $(XX) -- openat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", O_RDONLY) = ? +$(S) $(XX) -- openat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", O_RDONLY) = 22 +$(S) $(XX) -- openat(AT_FDCWD, (null), O_RDONLY) = ? +$(S) $(XX) -- openat(AT_FDCWD, (null), O_RDONLY) = 22 +$(S) $(XX) -- openat(99, "input_data\x01\x02\x03\n\r\t", O_RDONLY | O_CREAT, 0777) = ? +$(S) $(XX) -- openat(99, "input_data\x01\x02\x03\n\r\t", O_RDONLY | O_CREAT, 0777) = 22 +$(S) $(XX) -- openat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", O_RDWR | O_TMPFILE, 0333) = ? +$(S) $(XX) -- openat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", O_RDWR | O_TMPFILE, 0333) = 22 +$(S) $(XX) -- close(9) = ? +$(S) $(XX) -- close(9) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), (null), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), (null), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", (null), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", (null), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), $(XX), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), $(XX), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", $(XX), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", $(XX), $(XX)) = 22 +$(S) $(XX) -- $(*)fstat$(*)(0, $(*)(null)$(*)) = ? +$(S) $(XX) -- $(*)fstat$(*)(0, $(*)(null)$(*)) = 22 +$(OPT)$(S) $(XX) -- $(*)fstat$(*)(-1, $(*)(null)$(*)) = ? +$(OPT)$(S) $(XX) -- $(*)fstat$(*)(-1, $(*)(null)$(*)) = 22 +$(OPT)$(S) $(XX) -- $(*)fstat$(*)(AT_FDCWD, $(*)$(XX)$(*)) = ? +$(OPT)$(S) $(XX) -- $(*)fstat$(*)(AT_FDCWD, $(*)$(XX)$(*)) = 22 +$(S) $(XX) -- $(*)fstat$(*)(2, $(*)$(XX)$(*)) = ? +$(S) $(XX) -- $(*)fstat$(*)(2, $(*)$(XX)$(*)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), (null), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), (null), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", (null), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", (null), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), $(XX), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), $(XX), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", $(XX), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", $(XX), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", (null), 0x0) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", (null), 0x0) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), (null), 0x0) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), (null), 0x0) = 22 +$(S) $(XX) -- newfstatat(-1000, "", $(XX), 0x0) = ? +$(S) $(XX) -- newfstatat(-1000, "", $(XX), 0x0) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", $(XX), 0x100) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", $(XX), 0x100) = 22 +$(S) $(XX) -- poll((null), 0, 7) = ? +$(S) $(XX) -- poll((null), 0, 7) = 22 +$(S) $(XX) -- poll($(XX), 3, 7) = ? +$(S) $(XX) -- poll($(XX), 3, 7) = 22 +$(S) $(XX) -- ppoll($(XX), 2, 0x123000, 0x234000, 2) = ? +$(S) $(XX) -- ppoll($(XX), 2, 0x123000, 0x234000, 2) = 22 +$(S) $(XX) -- lseek(0, 0, SEEK_SET) = ? +$(S) $(XX) -- lseek(0, 0, SEEK_SET) = 22 +$(S) $(XX) -- lseek(0, 0, SEEK_CUR) = ? +$(S) $(XX) -- lseek(0, 0, SEEK_CUR) = 22 +$(S) $(XX) -- lseek(0, 0, SEEK_END) = ? +$(S) $(XX) -- lseek(0, 0, SEEK_END) = 22 +$(S) $(XX) -- lseek(0, 0, SEEK_HOLE) = ? +$(S) $(XX) -- lseek(0, 0, SEEK_HOLE) = 22 +$(S) $(XX) -- lseek(0, 0, SEEK_DATA) = ? +$(S) $(XX) -- lseek(0, 0, SEEK_DATA) = 22 +$(S) $(XX) -- lseek(2, -1, SEEK_SET) = ? +$(S) $(XX) -- lseek(2, -1, SEEK_SET) = 22 +$(S) $(XX) -- lseek(2, -1, SEEK_CUR) = ? +$(S) $(XX) -- lseek(2, -1, SEEK_CUR) = 22 +$(S) $(XX) -- lseek(2, -1, SEEK_END) = ? +$(S) $(XX) -- lseek(2, -1, SEEK_END) = 22 +$(S) $(XX) -- lseek(2, -1, SEEK_HOLE) = ? +$(S) $(XX) -- lseek(2, -1, SEEK_HOLE) = 22 +$(S) $(XX) -- lseek(2, -1, SEEK_DATA) = ? +$(S) $(XX) -- lseek(2, -1, SEEK_DATA) = 22 +$(S) $(XX) -- lseek(-100, 99999, SEEK_SET) = ? +$(S) $(XX) -- lseek(-100, 99999, SEEK_SET) = 22 +$(S) $(XX) -- lseek(-100, 99999, SEEK_CUR) = ? +$(S) $(XX) -- lseek(-100, 99999, SEEK_CUR) = 22 +$(S) $(XX) -- lseek(-100, 99999, SEEK_END) = ? +$(S) $(XX) -- lseek(-100, 99999, SEEK_END) = 22 +$(S) $(XX) -- lseek(-100, 99999, SEEK_HOLE) = ? +$(S) $(XX) -- lseek(-100, 99999, SEEK_HOLE) = 22 +$(S) $(XX) -- lseek(-100, 99999, SEEK_DATA) = ? +$(S) $(XX) -- lseek(-100, 99999, SEEK_DATA) = 22 +$(S) $(XX) -- mmap((null), 0x0, 0x0, 0x0, 0, 0x0) = ? +$(S) $(XX) -- mmap((null), 0x0, 0x0, 0x0, 0, 0x0) = -22 EINVAL (Invalid argument) +$(S) $(XX) -- mmap(0x0000000000123000, 0x8000, 0x4, 0x1, 99, 0x1000) = ? +$(S) $(XX) -- mmap(0x0000000000123000, 0x8000, 0x4, 0x1, 99, 0x1000) = 0x0000000000000016 +$(S) $(XX) -- mprotect(0x0000000000123000, 0x4000, 0x1) = ? +$(S) $(XX) -- mprotect(0x0000000000123000, 0x4000, 0x1) = 22 +$(S) $(XX) -- mprotect((null), 0x4000, 0x2) = ? +$(S) $(XX) -- mprotect((null), 0x4000, 0x2) = 22 +$(S) $(XX) -- munmap(0x0000000000123000, 0x4000) = ? +$(S) $(XX) -- munmap(0x0000000000123000, 0x4000) = 22 +$(S) $(XX) -- munmap((null), 0x4000) = ? +$(S) $(XX) -- munmap((null), 0x4000) = 22 +$(S) $(XX) -- brk($(N)) = ? +$(S) $(XX) -- brk($(N)) = 22 +$(S) $(XX) -- brk(0) = ? +$(S) $(XX) -- brk(0) = 22 +$(S) $(XX) -- mremap(0x0000000000123000, 4294967302, 4294967372, 1, $(XX)) = ? +$(S) $(XX) -- mremap(0x0000000000123000, 4294967302, 4294967372, 1, $(XX)) = 0x0000000000000016 +$(S) $(XX) -- msync(0x0000000000123000, 0, 1) = ? +$(S) $(XX) -- msync(0x0000000000123000, 0, 1) = 22 +$(S) $(XX) -- msync((null), 888, 2) = ? +$(S) $(XX) -- msync((null), 888, 2) = 22 +$(S) $(XX) -- mincore(0x0000000000123000, 99, 0x0000000000234000) = ? +$(S) $(XX) -- mincore(0x0000000000123000, 99, 0x0000000000234000) = 22 +$(S) $(XX) -- mincore(0x0000000000234000, 1234, (null)) = ? +$(S) $(XX) -- mincore(0x0000000000234000, 1234, (null)) = 22 +$(S) $(XX) -- mincore((null), 0, 0x0000000000123000) = ? +$(S) $(XX) -- mincore((null), 0, 0x0000000000123000) = 22 +$(S) $(XX) -- madvise(0x0000000000123000, 99, 0) = ? +$(S) $(XX) -- madvise(0x0000000000123000, 99, 0) = 22 +$(S) $(XX) -- madvise(0x0000000000234000, 1234, 4) = ? +$(S) $(XX) -- madvise(0x0000000000234000, 1234, 4) = 22 +$(S) $(XX) -- madvise((null), 0, 2) = ? +$(S) $(XX) -- madvise((null), 0, 2) = 22 +$(S) $(XX) -- mlock(0x123000, 0x3000) = ? +$(S) $(XX) -- mlock(0x123000, 0x3000) = 22 +$(OPT)$(S) $(XX) -- mlock2(0x123000, 0x3000, 0x0) = ? +$(OPT)$(S) $(XX) -- mlock2(0x123000, 0x3000, 0x0) = 22 +$(S) $(XX) -- munlock(0x123000, 0x3000) = ? +$(S) $(XX) -- munlock(0x123000, 0x3000) = 22 +$(S) $(XX) -- mlockall(0x1) = ? +$(S) $(XX) -- mlockall(0x1) = 22 +$(S) $(XX) -- mlockall(0x2) = ? +$(S) $(XX) -- mlockall(0x2) = 22 +$(S) $(XX) -- munlockall() = ? +$(S) $(XX) -- munlockall() = 22 +$(S) $(XX) -- rt_sigaction(2, 0x0000000000123000, 0x0000000000234000, 10) = ? +$(S) $(XX) -- rt_sigaction(2, 0x0000000000123000, 0x0000000000234000, 10) = 22 +$(S) $(XX) -- rt_sigprocmask(0x2, 0x0000000000123000, 0x0000000000234000, 10) = ? +$(S) $(XX) -- rt_sigprocmask(0x2, 0x0000000000123000, 0x0000000000234000, 10) = 22 +$(S) $(XX) -- ioctl(1, 0x4d, 0x0000000000234000) = ? +$(S) $(XX) -- ioctl(1, 0x4d, 0x0000000000234000) = 22 +$(S) $(XX) -- access((null), F_OK) = ? +$(S) $(XX) -- access((null), F_OK) = 22 +$(S) $(XX) -- access("input_data\x01\x02\x03\n\r\t", X_OK) = ? +$(S) $(XX) -- access("input_data\x01\x02\x03\n\r\t", X_OK) = 22 +$(S) $(XX) -- access("", R_OK | W_OK) = ? +$(S) $(XX) -- access("", R_OK | W_OK) = 22 +$(S) $(XX) -- access("input_data\x01\x02\x03\n\r\t", R_OK | W_OK | X_OK) = ? +$(S) $(XX) -- access("input_data\x01\x02\x03\n\r\t", R_OK | W_OK | X_OK) = 22 +$(S) $(XX) -- faccessat2(AT_FDCWD, (null), 00, $(XX)) = ? +$(S) $(XX) -- faccessat2(AT_FDCWD, (null), 00, $(XX)) = 22 +$(S) $(XX) -- faccessat2(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01, $(XX)) = ? +$(S) $(XX) -- faccessat2(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01, $(XX)) = 22 +$(S) $(XX) -- faccessat2(AT_FDCWD, "", 06, $(XX)) = ? +$(S) $(XX) -- faccessat2(AT_FDCWD, "", 06, $(XX)) = 22 +$(S) $(XX) -- faccessat2(9, "input_data\x01\x02\x03\n\r\t", 07, $(XX)) = ? +$(S) $(XX) -- faccessat2(9, "input_data\x01\x02\x03\n\r\t", 07, $(XX)) = 22 +$(S) $(XX) -- pipe2($(XX), $(N)) = ? +$(S) $(XX) -- pipe2([123, 234], $(N)) = 22 +$(S) $(XX) -- pipe2($(XX), 0) = ? +$(S) $(XX) -- pipe2([123, 234], 0) = 22 +$(S) $(XX) -- pselect6(0x2, 0x123000, 0x234000, 0x456000, $(XX), $(XX)) = ? +$(S) $(XX) -- pselect6(0x2, 0x123000, 0x234000, 0x456000, $(XX), $(XX)) = 22 +$(S) $(XX) -- pselect6(0x2, 0x123000, 0x234000, 0x123000, 0x234000, 0x123000) = ? +$(S) $(XX) -- pselect6(0x2, 0x123000, 0x234000, 0x123000, 0x234000, 0x123000) = 22 +$(S) $(XX) -- sched_yield() = ? +$(S) $(XX) -- sched_yield() = 22 +$(S) $(XX) -- shmget(0x3, 0x4, 0x5) = ? +$(S) $(XX) -- shmget(0x3, 0x4, 0x5) = 22 +$(S) $(XX) -- shmat(0x3, 0x123000, 0x5) = ? +$(S) $(XX) -- shmat(0x3, 0x123000, 0x5) = 0x16 +$(S) $(XX) -- shmctl(0x3, 0xe, 0x123000) = ? +$(S) $(XX) -- shmctl(0x3, 0xe, 0x123000) = 22 +$(S) $(XX) -- shmdt(0x123000) = ? +$(S) $(XX) -- shmdt(0x123000) = 22 +$(S) $(XX) -- dup(4) = ? +$(S) $(XX) -- dup(4) = 22 +$(S) $(XX) -- dup2(4, 5) = ? +$(S) $(XX) -- dup2(4, 5) = 22 +$(S) $(XX) -- dup3(4, 5, 0x0) = ? +$(S) $(XX) -- dup3(4, 5, 0x0) = 22 +$(S) $(XX) -- dup3(4, 5, 0x80000) = ? +$(S) $(XX) -- dup3(4, 5, 0x80000) = 22 +$(S) $(XX) -- pause() = ? +$(S) $(XX) -- pause() = 22 +$(S) $(XX) -- clock_nanosleep(0x0, 0x0, 0x123000, 0x234000) = ? +$(S) $(XX) -- clock_nanosleep(0x0, 0x0, 0x123000, 0x234000) = 22 +$(S) $(XX) -- getitimer(0x3, 0x123000) = ? +$(S) $(XX) -- getitimer(0x3, 0x123000) = 22 +$(S) $(XX) -- alarm(0x4) = ? +$(S) $(XX) -- alarm(0x4) = 22 +$(S) $(XX) -- setitimer(0x6, 0x123000, 0x234000) = ? +$(S) $(XX) -- setitimer(0x6, 0x123000, 0x234000) = 22 +$(S) $(XX) -- getpid() = ? +$(S) $(XX) -- getpid() = 22 +$(S) $(XX) -- sendfile(6, 7, 0x123000, 0x63) = ? +$(S) $(XX) -- sendfile(6, 7, 0x123000, 0x63) = 22 +$(S) $(XX) -- socket(0x2, 0x800, 0x0) = ? +$(S) $(XX) -- socket(0x2, 0x800, 0x0) = 22 +$(S) $(XX) -- connect(8, 0x123000, 0xc) = ? +$(S) $(XX) -- connect(8, 0x123000, 0xc) = 22 +$(S) $(XX) -- accept(4, 0x123000, 0x234000) = ? +$(S) $(XX) -- accept(4, 0x123000, 0x234000) = 22 +$(S) $(XX) -- accept4(4, 0x123000, 0x234000, 0x0, 0x234000) = ? +$(S) $(XX) -- accept4(4, 0x123000, 0x234000, 0x0, 0x234000) = 22 +$(S) $(XX) -- accept4(4, 0x123000, 0x234000, 0x80800, 0x234000) = ? +$(S) $(XX) -- accept4(4, 0x123000, 0x234000, 0x80800, 0x234000) = 22 +$(S) $(XX) -- sendto(5, 0x123000, 0xc, 0x4) = ? +$(S) $(XX) -- sendto(5, 0x123000, 0xc, 0x4) = 22 +$(S) $(XX) -- recvfrom(5, 0x123000, 0xc, 0x4, 0x234000, 0x234000) = ? +$(S) $(XX) -- recvfrom(5, 0x123000, 0xc, 0x4, 0x234000, 0x234000) = 22 +$(S) $(XX) -- recvmsg(2, 0x123000, 0x2) = ? +$(S) $(XX) -- recvmsg(2, 0x123000, 0x2) = 22 +$(S) $(XX) -- recvmmsg(2, 0x123000, 0xc, 0x10000, 0x234000) = ? +$(S) $(XX) -- recvmmsg(2, 0x123000, 0xc, 0x10000, 0x234000) = 22 +$(S) $(XX) -- sendmsg(2, 0x123000, 0x4000) = ? +$(S) $(XX) -- sendmsg(2, 0x123000, 0x4000) = 22 +$(S) $(XX) -- sendmmsg(2, 0x123000, 0xc, 0x4000) = ? +$(S) $(XX) -- sendmmsg(2, 0x123000, 0xc, 0x4000) = 22 +$(S) $(XX) -- shutdown(3, 0x0) = ? +$(S) $(XX) -- shutdown(3, 0x0) = 22 +$(S) $(XX) -- bind(6, 0x123000, 0x9) = ? +$(S) $(XX) -- bind(6, 0x123000, 0x9) = 22 +$(S) $(XX) -- listen(5, 0x3) = ? +$(S) $(XX) -- listen(5, 0x3) = 22 +$(S) $(XX) -- getsockname(4, 0x123000, 0x234000) = ? +$(S) $(XX) -- getsockname(4, 0x123000, 0x234000) = 22 +$(S) $(XX) -- getpeername(4, 0x123000, 0x234000) = ? +$(S) $(XX) -- getpeername(4, 0x123000, 0x234000) = 22 +$(S) $(XX) -- socketpair(0x4, 0x5, 0x6, 0x123000) = ? +$(S) $(XX) -- socketpair(0x4, 0x5, 0x6, 0x123000) = 22 +$(S) $(XX) -- setsockopt(4, 0x5, 0x6, 0x123000, 0x7) = ? +$(S) $(XX) -- setsockopt(4, 0x5, 0x6, 0x123000, 0x7) = 22 +$(S) $(XX) -- getsockopt(4, 0x5, 0x6, 0x123000, $(XX)) = ? +$(S) $(XX) -- getsockopt(4, 0x5, 0x6, 0x123000, $(XX)) = 22 +$(S) $(XX) -- wait4(7, 0x123000, 0x0, 0x234000) = ? +$(S) $(XX) -- wait4(7, 0x123000, 0x0, 0x234000) = 22 +$(S) $(XX) -- kill(0x4, 0x2) = ? +$(S) $(XX) -- kill(0x4, 0x2) = 22 +$(S) $(XX) -- uname($(XX)) = ? +$(S) $(XX) -- uname($(XX)) = 22 +$(S) $(XX) -- semget(0x4, 0x1, 0x200) = ? +$(S) $(XX) -- semget(0x4, 0x1, 0x200) = 22 +$(S) $(XX) -- semtimedop(0x4, 0x123000, 0x1, 0x0) = ? +$(S) $(XX) -- semtimedop(0x4, 0x123000, 0x1, 0x0) = 22 +$(S) $(XX) -- semtimedop(0x4, 0x123000, 0x1, 0x234000) = ? +$(S) $(XX) -- semtimedop(0x4, 0x123000, 0x1, 0x234000) = 22 +$(S) $(XX) -- semctl(0x1, 0x2, 0x3, $(XX), $(XX), 0x234000) = ? +$(S) $(XX) -- semctl(0x1, 0x2, 0x3, $(XX), $(XX), 0x234000) = 22 +$(S) $(XX) -- msgget(0x1, 0x200) = ? +$(S) $(XX) -- msgget(0x1, 0x200) = 22 +$(S) $(XX) -- msgsnd(0x1, 0x123000, 0x3, 0x3) = ? +$(S) $(XX) -- msgsnd(0x1, 0x123000, 0x3, 0x3) = 22 +$(S) $(XX) -- msgrcv(0x1, 0x123000, 0x1, 0x1, 0x1) = ? +$(S) $(XX) -- msgrcv(0x1, 0x123000, 0x1, 0x1, 0x1) = 22 +$(S) $(XX) -- msgctl(0x1, 0x2, 0x123000) = ? +$(S) $(XX) -- msgctl(0x1, 0x2, 0x123000) = 22 +$(S) $(XX) -- fcntl(1, 1030 (F_DUPFD_CLOEXEC), 0x3) = ? +$(S) $(XX) -- fcntl(1, 1030 (F_DUPFD_CLOEXEC), 0x3) = 22 +$(S) $(XX) -- fcntl(10, 4 (F_SETFL), 0x40000) = ? +$(S) $(XX) -- fcntl(10, 4 (F_SETFL), 0x40000) = 22 +$(S) $(XX) -- fcntl(11, 6 (F_SETLK), $(XX) ({.l_type = 1 (F_WRLCK), .l_whence = 2 (SEEK_END), .l_start = 123, .l_len = 456, .l_pid = 768})) = ? +$(S) $(XX) -- fcntl(11, 6 (F_SETLK), $(XX) ({.l_type = 1 (F_WRLCK), .l_whence = 2 (SEEK_END), .l_start = 123, .l_len = 456, .l_pid = 768})) = 22 +$(S) $(XX) -- flock(1, 0x2) = ? +$(S) $(XX) -- flock(1, 0x2) = 22 +$(S) $(XX) -- fsync(2) = ? +$(S) $(XX) -- fsync(2) = 22 +$(S) $(XX) -- fdatasync(2) = ? +$(S) $(XX) -- fdatasync(2) = 22 +$(S) $(XX) -- truncate("input_data\x01\x02\x03\n\r\t", 0x4) = ? +$(S) $(XX) -- truncate("input_data\x01\x02\x03\n\r\t", 0x4) = 22 +$(S) $(XX) -- ftruncate(3, 0x3) = ? +$(S) $(XX) -- ftruncate(3, 0x3) = 22 +$(S) $(XX) -- getdents(4, 0x123000, 0x1) = ? +$(S) $(XX) -- getdents(4, 0x123000, 0x1) = 22 +$(S) $(XX) -- getdents64(4, 0x123000, 0x1) = ? +$(S) $(XX) -- getdents64(4, 0x123000, 0x1) = 22 +$(S) $(XX) -- getcwd($(XX), 0x9) = ? +$(S) $(XX) -- getcwd($(XX), 0x9) = 22 +$(S) $(XX) -- chdir("input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- chdir("input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- fchdir(6) = ? +$(S) $(XX) -- fchdir(6) = 22 +$(S) $(XX) -- rename("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- rename("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- renameat(1, "input_data\x01\x02\x03\n\r\t", 2, "other_input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- renameat(1, "input_data\x01\x02\x03\n\r\t", 2, "other_input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- renameat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 7, "other_input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- renameat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 7, "other_input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- renameat(9, "input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- renameat(9, "input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- mkdir("input_data\x01\x02\x03\n\r\t", 0644) = ? +$(S) $(XX) -- mkdir("input_data\x01\x02\x03\n\r\t", 0644) = 22 +$(S) $(XX) -- mkdirat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0644) = ? +$(S) $(XX) -- mkdirat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0644) = 22 +$(S) $(XX) -- mkdirat(33, "input_data\x01\x02\x03\n\r\t", 0644) = ? +$(S) $(XX) -- mkdirat(33, "input_data\x01\x02\x03\n\r\t", 0644) = 22 +$(S) $(XX) -- mkdirat(33, (null), 0555) = ? +$(S) $(XX) -- mkdirat(33, (null), 0555) = 22 +$(S) $(XX) -- rmdir("input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- rmdir("input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- rmdir((null)) = ? +$(S) $(XX) -- rmdir((null)) = 22 +$(S) $(XX) -- creat("input_data\x01\x02\x03\n\r\t", 0644) = ? +$(S) $(XX) -- creat("input_data\x01\x02\x03\n\r\t", 0644) = 22 +$(S) $(XX) -- link("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- link("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- linkat(1, "input_data\x01\x02\x03\n\r\t", 2, "other_input_data\x01\x02\x03\n\r\t", 0x0) = ? +$(S) $(XX) -- linkat(1, "input_data\x01\x02\x03\n\r\t", 2, "other_input_data\x01\x02\x03\n\r\t", 0x0) = 22 +$(S) $(XX) -- linkat(1, "input_data\x01\x02\x03\n\r\t", 2, "other_input_data\x01\x02\x03\n\r\t", 0x400) = ? +$(S) $(XX) -- linkat(1, "input_data\x01\x02\x03\n\r\t", 2, "other_input_data\x01\x02\x03\n\r\t", 0x400) = 22 +$(S) $(XX) -- linkat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 2, "other_input_data\x01\x02\x03\n\r\t", 0x400) = ? +$(S) $(XX) -- linkat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 2, "other_input_data\x01\x02\x03\n\r\t", 0x400) = 22 +$(S) $(XX) -- linkat(7, "input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", 0x0) = ? +$(S) $(XX) -- linkat(7, "input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", 0x0) = 22 +$(S) $(XX) -- unlink("input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- unlink("input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- unlinkat(0, "input_data\x01\x02\x03\n\r\t", 0x0) = ? +$(S) $(XX) -- unlinkat(0, "input_data\x01\x02\x03\n\r\t", 0x0) = 22 +$(S) $(XX) -- unlinkat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x200) = ? +$(S) $(XX) -- unlinkat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x200) = 22 +$(S) $(XX) -- unlinkat(9, "other_input_data\x01\x02\x03\n\r\t", 0x200) = ? +$(S) $(XX) -- unlinkat(9, "other_input_data\x01\x02\x03\n\r\t", 0x200) = 22 +$(S) $(XX) -- symlink("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- symlink("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- symlinkat("input_data\x01\x02\x03\n\r\t", 7, "other_input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- symlinkat("input_data\x01\x02\x03\n\r\t", 7, "other_input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- symlinkat("input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- symlinkat("input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- symlinkat("input_data\x01\x02\x03\n\r\t", AT_FDCWD, (null)) = ? +$(S) $(XX) -- symlinkat("input_data\x01\x02\x03\n\r\t", AT_FDCWD, (null)) = 22 +$(S) $(XX) -- readlink("input_data\x01\x02\x03\n\r\t", $(XX), 16) = ? +$(S) $(XX) -- readlink("input_data\x01\x02\x03\n\r\t", "expected_output_data\x06\xff", 16) = 22 +$(S) $(XX) -- readlinkat(2, "input_data\x01\x02\x03\n\r\t", $(XX), 16) = ? +$(S) $(XX) -- readlinkat(2, "input_data\x01\x02\x03\n\r\t", "expected_output_data\x06\xff", 16) = 22 +$(S) $(XX) -- readlinkat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", $(XX), 16) = ? +$(S) $(XX) -- readlinkat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", "expected_output_data\x06\xff", 16) = 22 +$(S) $(XX) -- chmod("input_data\x01\x02\x03\n\r\t", 0644) = ? +$(S) $(XX) -- chmod("input_data\x01\x02\x03\n\r\t", 0644) = 22 +$(S) $(XX) -- fchmod(4, 0644) = ? +$(S) $(XX) -- fchmod(4, 0644) = 22 +$(S) $(XX) -- fchmodat(0, "input_data\x01\x02\x03\n\r\t", 0644) = ? +$(S) $(XX) -- fchmodat(0, "input_data\x01\x02\x03\n\r\t", 0644) = 22 +$(S) $(XX) -- fchmodat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0111) = ? +$(S) $(XX) -- fchmodat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0111) = 22 +$(S) $(XX) -- chown("input_data\x01\x02\x03\n\r\t", 0x2, 0x3) = ? +$(S) $(XX) -- chown("input_data\x01\x02\x03\n\r\t", 0x2, 0x3) = 22 +$(S) $(XX) -- fchown(4, 0x2, 0x3) = ? +$(S) $(XX) -- fchown(4, 0x2, 0x3) = 22 +$(S) $(XX) -- fchownat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x2, 0x3, 0x0) = ? +$(S) $(XX) -- fchownat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x2, 0x3, 0x0) = 22 +$(S) $(XX) -- fchownat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x2, 0x3, 0x100) = ? +$(S) $(XX) -- fchownat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x2, 0x3, 0x100) = 22 +$(S) $(XX) -- fchownat(99, "input_data\x01\x02\x03\n\r\t", 0x2, 0x3, 0x1000) = ? +$(S) $(XX) -- fchownat(99, "input_data\x01\x02\x03\n\r\t", 0x2, 0x3, 0x1000) = 22 +$(S) $(XX) -- lchown("input_data\x01\x02\x03\n\r\t", 0x2, 0x3) = ? +$(S) $(XX) -- lchown("input_data\x01\x02\x03\n\r\t", 0x2, 0x3) = 22 +$(S) $(XX) -- umask(0222) = ? +$(S) $(XX) -- umask(0222) = 026 +$(S) $(XX) -- gettimeofday(0x123000, 0x234000) = ? +$(S) $(XX) -- gettimeofday(0x123000, 0x234000) = 22 +$(S) $(XX) -- gettimeofday(0x0, 0x0) = ? +$(S) $(XX) -- gettimeofday(0x0, 0x0) = 22 +$(S) $(XX) -- settimeofday(0x123000, 0x234000) = ? +$(S) $(XX) -- settimeofday(0x123000, 0x234000) = 22 +$(S) $(XX) -- getrlimit(0x4, 0x234000) = ? +$(S) $(XX) -- getrlimit(0x4, 0x234000) = 22 +$(S) $(XX) -- getrlimit(0x1, 0x234000) = ? +$(S) $(XX) -- getrlimit(0x1, 0x234000) = 22 +$(S) $(XX) -- prlimit64(0x9, 0x4, 0x123000, 0x234000) = ? +$(S) $(XX) -- prlimit64(0x9, 0x4, 0x123000, 0x234000) = 22 +$(S) $(XX) -- prlimit64(0x8, 0x1, 0x123000, 0x234000) = ? +$(S) $(XX) -- prlimit64(0x8, 0x1, 0x123000, 0x234000) = 22 +$(S) $(XX) -- setrlimit(0x0, 0x123000) = ? +$(S) $(XX) -- setrlimit(0x0, 0x123000) = 22 +$(S) $(XX) -- getrusage(0x0, 0x123000) = ? +$(S) $(XX) -- getrusage(0x0, 0x123000) = 22 +$(S) $(XX) -- sysinfo(0x123000, 0x123000) = ? +$(S) $(XX) -- sysinfo(0x123000, 0x123000) = 22 +$(S) $(XX) -- times(0x0) = ? +$(S) $(XX) -- times(0x0) = 22 +$(S) $(XX) -- times(0x123000) = ? +$(S) $(XX) -- times(0x123000) = 22 +$(S) $(XX) -- getuid() = ? +$(S) $(XX) -- getuid() = 22 +$(S) $(XX) -- getgid() = ? +$(S) $(XX) -- getgid() = 22 +$(S) $(XX) -- setuid(0x7b) = ? +$(S) $(XX) -- setuid(0x7b) = 22 +$(S) $(XX) -- setgid(0x7b) = ? +$(S) $(XX) -- setgid(0x7b) = 22 +$(S) $(XX) -- geteuid() = ? +$(S) $(XX) -- geteuid() = 22 +$(S) $(XX) -- getegid() = ? +$(S) $(XX) -- getegid() = 22 +$(S) $(XX) -- setpgid() = ? +$(S) $(XX) -- setpgid() = 22 +$(S) $(XX) -- getppid() = ? +$(S) $(XX) -- getppid() = 22 +$(S) $(XX) -- getpgrp() = ? +$(S) $(XX) -- getpgrp() = 22 +$(S) $(XX) -- setsid() = ? +$(S) $(XX) -- setsid() = 22 +$(S) $(XX) -- setreuid(0x3, 0x4) = ? +$(S) $(XX) -- setreuid(0x3, 0x4) = 22 +$(S) $(XX) -- setregid(0x6, 0x7) = ? +$(S) $(XX) -- setregid(0x6, 0x7) = 22 +$(S) $(XX) -- getgroups(0x9, 0x123000) = ? +$(S) $(XX) -- getgroups(0x9, 0x123000) = 22 +$(S) $(XX) -- setgroups(0x9, 0x123000) = ? +$(S) $(XX) -- setgroups(0x9, 0x123000) = 22 +$(S) $(XX) -- setresuid(0x1, 0x2, 0x3) = ? +$(S) $(XX) -- setresuid(0x1, 0x2, 0x3) = 22 +$(S) $(XX) -- getresuid(0x123000, 0x234000, 0x234000) = ? +$(S) $(XX) -- getresuid(0x123000, 0x234000, 0x234000) = 22 +$(S) $(XX) -- setresgid(0x1, 0x2, 0x3) = ? +$(S) $(XX) -- setresgid(0x1, 0x2, 0x3) = 22 +$(S) $(XX) -- getresgid(0x123000, 0x234000, 0x234000) = ? +$(S) $(XX) -- getresgid(0x123000, 0x234000, 0x234000) = 22 +$(S) $(XX) -- getpgid(0x63) = ? +$(S) $(XX) -- getpgid(0x63) = 22 +$(S) $(XX) -- setfsuid(0x58) = ? +$(S) $(XX) -- setfsuid(0x58) = 22 +$(S) $(XX) -- setfsgid(0x4d) = ? +$(S) $(XX) -- setfsgid(0x4d) = 22 +$(S) $(XX) -- getsid(0x42) = ? +$(S) $(XX) -- getsid(0x42) = 22 +$(S) $(XX) -- syslog(0x5c, $(XX), 0x3) = ? +$(S) $(XX) -- syslog(0x5c, $(XX), 0x3) = 22 +$(S) $(XX) -- capget(0x123000, 0x234000) = ? +$(S) $(XX) -- capget(0x123000, 0x234000) = 22 +$(S) $(XX) -- capset(0x123000, 0x234000) = ? +$(S) $(XX) -- capset(0x123000, 0x234000) = 22 +$(S) $(XX) -- rt_sigpending(0x123000) = ? +$(S) $(XX) -- rt_sigpending(0x123000) = 22 +$(S) $(XX) -- rt_sigtimedwait(0x123000, 0x234000, 0x234000, 0x2) = ? +$(S) $(XX) -- rt_sigtimedwait(0x123000, 0x234000, 0x234000, 0x2) = 22 +$(S) $(XX) -- rt_sigqueueinfo(0x4d, 0x4, 0x123000) = ? +$(S) $(XX) -- rt_sigqueueinfo(0x4d, 0x4, 0x123000) = 22 +$(S) $(XX) -- rt_tgsigqueueinfo(0x4d, 0x58, 0xc, 0x123000) = ? +$(S) $(XX) -- rt_tgsigqueueinfo(0x4d, 0x58, 0xc, 0x123000) = 22 +$(S) $(XX) -- rt_sigsuspend(0x123000, 0x3) = ? +$(S) $(XX) -- rt_sigsuspend(0x123000, 0x3) = 22 +$(S) $(XX) -- sigaltstack(0x123000, 0x234000) = ? +$(S) $(XX) -- sigaltstack(0x123000, 0x234000) = 22 +$(S) $(XX) -- utimensat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", $(XX), $(XX)) = ? +$(S) $(XX) -- utimensat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", $(XX), $(XX)) = 22 +$(S) $(XX) -- utimensat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", $(XX), $(XX)) = ? +$(S) $(XX) -- utimensat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", $(XX), $(XX)) = 22 +$(S) $(XX) -- utimensat(4, "input_data\x01\x02\x03\n\r\t", $(XX), $(XX)) = ? +$(S) $(XX) -- utimensat(4, "input_data\x01\x02\x03\n\r\t", $(XX), $(XX)) = 22 +$(S) $(XX) -- mknodat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01, 0x2) = ? +$(S) $(XX) -- mknodat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01, 0x2) = 22 +$(S) $(XX) -- mknodat(1, "input_data\x01\x02\x03\n\r\t", 01, 0x2) = ? +$(S) $(XX) -- mknodat(1, "input_data\x01\x02\x03\n\r\t", 01, 0x2) = 22 +$(S) $(XX) -- mknodat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01, 0x2) = ? +$(S) $(XX) -- mknodat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01, 0x2) = 22 +$(S) $(XX) -- ustat(0x2, 0x123000) = ? +$(S) $(XX) -- ustat(0x2, 0x123000) = 22 +$(S) $(XX) -- statfs("input_data\x01\x02\x03\n\r\t", 0x123000) = ? +$(S) $(XX) -- statfs("input_data\x01\x02\x03\n\r\t", 0x123000) = 22 +$(S) $(XX) -- fstatfs(4, 0x123000) = ? +$(S) $(XX) -- fstatfs(4, 0x123000) = 22 +$(S) $(XX) -- getpriority(0x1, 0x2) = ? +$(S) $(XX) -- getpriority(0x1, 0x2) = 22 +$(S) $(XX) -- setpriority(0x1, 0x2, 0x3) = ? +$(S) $(XX) -- setpriority(0x1, 0x2, 0x3) = 22 +$(S) $(XX) -- sched_setparam(0x1, 0x123000) = ? +$(S) $(XX) -- sched_setparam(0x1, 0x123000) = 22 +$(S) $(XX) -- sched_getparam(0x1, 0x123000) = ? +$(S) $(XX) -- sched_getparam(0x1, 0x123000) = 22 +$(S) $(XX) -- sched_setscheduler(0x1, 0x3, 0x123000) = ? +$(S) $(XX) -- sched_setscheduler(0x1, 0x3, 0x123000) = 22 +$(S) $(XX) -- sched_getscheduler(0x1) = ? +$(S) $(XX) -- sched_getscheduler(0x1) = 22 +$(S) $(XX) -- sched_get_priority_max(0x2) = ? +$(S) $(XX) -- sched_get_priority_max(0x2) = 22 +$(S) $(XX) -- sched_get_priority_min(0x2) = ? +$(S) $(XX) -- sched_get_priority_min(0x2) = 22 +$(S) $(XX) -- sched_rr_get_interval(0x1, 0x123000) = ? +$(S) $(XX) -- sched_rr_get_interval(0x1, 0x123000) = 22 +$(S) $(XX) -- sched_setaffinity(0x4d, 0x4, 0x123000) = ? +$(S) $(XX) -- sched_setaffinity(0x4d, 0x4, 0x123000) = 22 +$(S) $(XX) -- sched_getaffinity(0x4d, 0x4, 0x123000) = ? +$(S) $(XX) -- sched_getaffinity(0x4d, 0x4, 0x123000) = 22 +$(S) $(XX) -- vhangup() = ? +$(S) $(XX) -- vhangup() = 22 +$(S) $(XX) -- modify_ldt(0x1, 0x123000, 0x1) = ? +$(S) $(XX) -- modify_ldt(0x1, 0x123000, 0x1) = 22 +$(S) $(XX) -- pivot_root("input_data\x01\x02\x03\n\r\t", $(XX)) = ? +$(S) $(XX) -- pivot_root("input_data\x01\x02\x03\n\r\t", $(XX)) = 22 +$(S) $(XX) -- _sysctl(0x123000) = ? +$(S) $(XX) -- _sysctl(0x123000) = 22 +$(S) $(XX) -- prctl(0x18, 0x1, 0x2, 0x3, 0x4) = ? +$(S) $(XX) -- prctl(0x18, 0x1, 0x2, 0x3, 0x4) = 22 +$(S) $(XX) -- arch_prctl(0x1002, 0x123000, $(XX)) = ? +$(S) $(XX) -- arch_prctl(0x1002, 0x123000, $(XX)) = 22 +$(S) $(XX) -- clock_adjtime(0x0, 0x123000) = ? +$(S) $(XX) -- clock_adjtime(0x0, 0x123000) = 22 +$(S) $(XX) -- chroot("input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- chroot("input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- sync() = ? +$(S) $(XX) -- sync() = 22 +$(S) $(XX) -- syncfs(3) = ? +$(S) $(XX) -- syncfs(3) = 22 +$(S) $(XX) -- acct("input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- acct("input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- mount("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", 0x123000, 0x80, 0x234000) = ? +$(S) $(XX) -- mount("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", 0x123000, 0x80, 0x234000) = 22 +$(S) $(XX) -- umount2("input_data\x01\x02\x03\n\r\t", 0x0) = ? +$(S) $(XX) -- umount2("input_data\x01\x02\x03\n\r\t", 0x0) = 22 +$(S) $(XX) -- umount2("input_data\x01\x02\x03\n\r\t", 0x2) = ? +$(S) $(XX) -- umount2("input_data\x01\x02\x03\n\r\t", 0x2) = 22 +$(S) $(XX) -- swapon("input_data\x01\x02\x03\n\r\t", 0x8000) = ? +$(S) $(XX) -- swapon("input_data\x01\x02\x03\n\r\t", 0x8000) = 22 +$(S) $(XX) -- swapoff("input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- swapoff("input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- sethostname($(XX), 0x10) = ? +$(S) $(XX) -- sethostname($(XX), 0x10) = 22 +$(S) $(XX) -- setdomainname($(XX), 0x10) = ? +$(S) $(XX) -- setdomainname($(XX), 0x10) = 22 +$(S) $(XX) -- iopl(0x1) = ? +$(S) $(XX) -- iopl(0x1) = 22 +$(S) $(XX) -- ioperm(0x3, 0x4, 0x1) = ? +$(S) $(XX) -- ioperm(0x3, 0x4, 0x1) = 22 +$(S) $(XX) -- init_module($(XX), 16, $(XX)) = ? +$(S) $(XX) -- init_module($(XX), 16, $(XX)) = 22 +$(S) $(XX) -- finit_module(3, 0x123000, 0x0) = ? +$(S) $(XX) -- finit_module(3, 0x123000, 0x0) = 22 +$(S) $(XX) -- delete_module($(S), $(XX)) = ? +$(S) $(XX) -- delete_module($(S), $(XX)) = 22 +$(S) $(XX) -- quotactl($(N), $(XX), $(N), $(XX)) = ? +$(S) $(XX) -- quotactl($(N), $(XX), $(N), $(XX)) = 22 +$(S) $(XX) -- gettid() = ? +$(S) $(XX) -- gettid() = 22 +$(S) $(XX) -- readahead(4, 17185, 123) = ? +$(S) $(XX) -- readahead(4, 17185, 123) = 22 +$(S) $(XX) -- setxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x1) = ? +$(S) $(XX) -- setxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x1) = 22 +$(S) $(XX) -- setxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x2) = ? +$(S) $(XX) -- setxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x2) = 22 +$(S) $(XX) -- lsetxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x1) = ? +$(S) $(XX) -- lsetxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x1) = 22 +$(S) $(XX) -- lsetxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x2) = ? +$(S) $(XX) -- lsetxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x2) = 22 +$(S) $(XX) -- fsetxattr(4, "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x2) = ? +$(S) $(XX) -- fsetxattr(4, "other_input_data\x01\x02\x03\n\r\t", "oth", 3, 0x2) = 22 +$(S) $(XX) -- getxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = ? +$(S) $(XX) -- getxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = 22 +$(S) $(XX) -- getxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = ? +$(S) $(XX) -- getxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = 22 +$(S) $(XX) -- lgetxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = ? +$(S) $(XX) -- lgetxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = 22 +$(S) $(XX) -- lgetxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = ? +$(S) $(XX) -- lgetxattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = 22 +$(S) $(XX) -- fgetxattr(4, "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = ? +$(S) $(XX) -- fgetxattr(4, "other_input_data\x01\x02\x03\n\r\t", $(N), 0x3) = 22 +$(S) $(XX) -- listxattr("input_data\x01\x02\x03\n\r\t", 0x0000000000123000, 4) = ? +$(S) $(XX) -- listxattr("input_data\x01\x02\x03\n\r\t", 0x0000000000123000, 4) = 22 +$(S) $(XX) -- llistxattr("input_data\x01\x02\x03\n\r\t", 0x0000000000123000, 4) = ? +$(S) $(XX) -- llistxattr("input_data\x01\x02\x03\n\r\t", 0x0000000000123000, 4) = 22 +$(S) $(XX) -- flistxattr(5, 0x0000000000123000, 4) = ? +$(S) $(XX) -- flistxattr(5, 0x0000000000123000, 4) = 22 +$(S) $(XX) -- flistxattr(-100, 0x0000000000123000, 4) = ? +$(S) $(XX) -- flistxattr(-100, 0x0000000000123000, 4) = 22 +$(S) $(XX) -- removexattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- removexattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- lremovexattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- lremovexattr("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- fremovexattr(7, "other_input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- fremovexattr(7, "other_input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- tkill(0x2c, 0x13) = ? +$(S) $(XX) -- tkill(0x2c, 0x13) = 22 +$(S) $(XX) -- tgkill(0x2c, 0x37, 0x13) = ? +$(S) $(XX) -- tgkill(0x2c, 0x37, 0x13) = 22 +$(S) $(XX) -- time(0x123000) = ? +$(S) $(XX) -- time(0x123000) = 22 +$(S) $(XX) -- futex(0x123000, 0x1, 0x7, 0x123000, 0x234000, 0x1) = ? +$(S) $(XX) -- futex(0x123000, 0x1, 0x7, 0x123000, 0x234000, 0x1) = 22 +$(S) $(XX) -- set_thread_area(0x123000) = ? +$(S) $(XX) -- set_thread_area(0x123000) = 22 +$(S) $(XX) -- get_thread_area(0x123000) = ? +$(S) $(XX) -- get_thread_area(0x123000) = 22 +$(S) $(XX) -- io_setup(0x1, 0x123000) = ? +$(S) $(XX) -- io_setup(0x1, 0x123000) = 22 +$(S) $(XX) -- io_destroy(0x4d) = ? +$(S) $(XX) -- io_destroy(0x4d) = 22 +$(S) $(XX) -- io_getevents(0x1, 0x2, 0x3, 0x123000, 0x234000) = ? +$(S) $(XX) -- io_getevents(0x1, 0x2, 0x3, 0x123000, 0x234000) = 22 +$(S) $(XX) -- io_submit(0x1, 0x2, 0x123000) = ? +$(S) $(XX) -- io_submit(0x1, 0x2, 0x123000) = 22 +$(S) $(XX) -- io_cancel(0x1, 0x123000, 0x234000) = ? +$(S) $(XX) -- io_cancel(0x1, 0x123000, 0x234000) = 22 +$(S) $(XX) -- lookup_dcookie(0x7b, 0x123000, 0xc) = ? +$(S) $(XX) -- lookup_dcookie(0x7b, 0x123000, 0xc) = 22 +$(S) $(XX) -- epoll_create(0x7) = ? +$(S) $(XX) -- epoll_create(0x7) = 22 +$(S) $(XX) -- epoll_create1(0x0) = ? +$(S) $(XX) -- epoll_create1(0x0) = 22 +$(S) $(XX) -- epoll_create1(0x80000) = ? +$(S) $(XX) -- epoll_create1(0x80000) = 22 +$(S) $(XX) -- epoll_wait(2, 0x123000, 0x4, 0x5) = ? +$(S) $(XX) -- epoll_wait(2, 0x123000, 0x4, 0x5) = 22 +$(S) $(XX) -- epoll_pwait(2, 0x123000, 0x4, 0x5, 0x234000, 0x6) = ? +$(S) $(XX) -- epoll_pwait(2, 0x123000, 0x4, 0x5, 0x234000, 0x6) = 22 +$(S) $(XX) -- epoll_ctl(2, 0x3, 4, 0x123000) = ? +$(S) $(XX) -- epoll_ctl(2, 0x3, 4, 0x123000) = 22 +$(S) $(XX) -- set_tid_address(0x123000) = ? +$(S) $(XX) -- set_tid_address(0x123000) = 22 +$(S) $(XX) -- fadvise64(3, 0x64, 0x63, 0x2) = ? +$(S) $(XX) -- fadvise64(3, 0x64, 0x63, 0x2) = 22 +$(S) $(XX) -- timer_create(0x3, 0x123000, 0x234000) = ? +$(S) $(XX) -- timer_create(0x3, 0x123000, 0x234000) = 22 +$(S) $(XX) -- timer_settime(0x4, 0x0, 0x123000, 0x234000) = ? +$(S) $(XX) -- timer_settime(0x4, 0x0, 0x123000, 0x234000) = 22 +$(S) $(XX) -- timer_settime(0x4, 0x1, 0x123000, 0x234000) = ? +$(S) $(XX) -- timer_settime(0x4, 0x1, 0x123000, 0x234000) = 22 +$(S) $(XX) -- timer_gettime(0x3, 0x123000) = ? +$(S) $(XX) -- timer_gettime(0x3, 0x123000) = 22 +$(S) $(XX) -- timer_getoverrun(0x3) = ? +$(S) $(XX) -- timer_getoverrun(0x3) = 22 +$(S) $(XX) -- timer_delete(0x3) = ? +$(S) $(XX) -- timer_delete(0x3) = 22 +$(S) $(XX) -- clock_settime(0x7, 0x123000) = ? +$(S) $(XX) -- clock_settime(0x7, 0x123000) = 22 +$(S) $(XX) -- clock_gettime(0x7, 0x123000) = ? +$(S) $(XX) -- clock_gettime(0x7, 0x123000) = 22 +$(S) $(XX) -- clock_getres(0x3, 0x123000) = ? +$(S) $(XX) -- clock_getres(0x3, 0x123000) = 22 +$(S) $(XX) -- clock_nanosleep(0x1, 0x1, 0x123000, 0x234000) = ? +$(S) $(XX) -- clock_nanosleep(0x1, 0x1, 0x123000, 0x234000) = 22 +$(S) $(XX) -- mbind(0x123000, 0x0, 0x8002, 0x234000, 0x4) = ? +$(S) $(XX) -- mbind(0x123000, 0x0, 0x8002, 0x234000, 0x4) = 22 +$(S) $(XX) -- set_mempolicy(0x8000, 0x123000, 0x5) = ? +$(S) $(XX) -- set_mempolicy(0x8000, 0x123000, 0x5) = 22 +$(S) $(XX) -- get_mempolicy(0x123000, 0x234000, 0x6, 0x123000, 0x0) = ? +$(S) $(XX) -- get_mempolicy(0x123000, 0x234000, 0x6, 0x123000, 0x0) = 22 +$(S) $(XX) -- mq_open("input_data\x01\x02\x03\n\r\t", 0x42, 0x1ff, 0x123000, $(XX)) = ? +$(S) $(XX) -- mq_open("input_data\x01\x02\x03\n\r\t", 0x42, 0x1ff, 0x123000, $(XX)) = 22 +$(S) $(XX) -- mq_unlink("input_data\x01\x02\x03\n\r\t") = ? +$(S) $(XX) -- mq_unlink("input_data\x01\x02\x03\n\r\t") = 22 +$(S) $(XX) -- mq_timedsend(0x1, $(XX), 0x10, 0x3, 0x123000) = ? +$(S) $(XX) -- mq_timedsend(0x1, $(XX), 0x10, 0x3, 0x123000) = 22 +$(S) $(XX) -- mq_timedreceive(0x1, $(XX), 0x10, 0x3, 0x123000) = ? +$(S) $(XX) -- mq_timedreceive(0x1, $(XX), 0x10, 0x3, 0x123000) = 22 +$(S) $(XX) -- mq_notify(0x1, 0x123000) = ? +$(S) $(XX) -- mq_notify(0x1, 0x123000) = 22 +$(S) $(XX) -- mq_getsetattr(0x1, 0x123000, 0x234000) = ? +$(S) $(XX) -- mq_getsetattr(0x1, 0x123000, 0x234000) = 22 +$(S) $(XX) -- kexec_load(0x1, 0x2, 0x123000, 0x2) = ? +$(S) $(XX) -- kexec_load(0x1, 0x2, 0x123000, 0x2) = 22 +$(S) $(XX) -- kexec_file_load(0x1, 0x2, 0x3, $(XX), 0x2) = ? +$(S) $(XX) -- kexec_file_load(0x1, 0x2, 0x3, $(XX), 0x2) = 22 +$(S) $(XX) -- waitid(0x1, 0x2, 0x123000, 0x4) = ? +$(S) $(XX) -- waitid(0x1, 0x2, 0x123000, 0x4) = 22 +$(S) $(XX) -- add_key(0x123000, 0x234000, 0x123000, 0x234000, 0x1) = ? +$(S) $(XX) -- add_key(0x123000, 0x234000, 0x123000, 0x234000, 0x1) = 22 +$(S) $(XX) -- request_key(0x123000, 0x234000, 0x123000, 0x1) = ? +$(S) $(XX) -- request_key(0x123000, 0x234000, 0x123000, 0x1) = 22 +$(S) $(XX) -- keyctl(0x0, 0x1, 0x2, 0x3, 0x4) = ? +$(S) $(XX) -- keyctl(0x0, 0x1, 0x2, 0x3, 0x4) = 22 +$(S) $(XX) -- ioprio_set(0x1, 0x3, 0x7b) = ? +$(S) $(XX) -- ioprio_set(0x1, 0x3, 0x7b) = 22 +$(S) $(XX) -- ioprio_get(0x1, 0x3) = ? +$(S) $(XX) -- ioprio_get(0x1, 0x3) = 22 +$(S) $(XX) -- inotify_init() = ? +$(S) $(XX) -- inotify_init() = 22 +$(S) $(XX) -- inotify_init1(0x800) = ? +$(S) $(XX) -- inotify_init1(0x800) = 22 +$(S) $(XX) -- inotify_init1(0x80000) = ? +$(S) $(XX) -- inotify_init1(0x80000) = 22 +$(S) $(XX) -- inotify_add_watch(7, "input_data\x01\x02\x03\n\r\t", 0x7b) = ? +$(S) $(XX) -- inotify_add_watch(7, "input_data\x01\x02\x03\n\r\t", 0x7b) = 22 +$(S) $(XX) -- inotify_rm_watch(7, 0x8) = ? +$(S) $(XX) -- inotify_rm_watch(7, 0x8) = 22 +$(S) $(XX) -- migrate_pages(0x1, 0x2, 0x123000, 0x234000) = ? +$(S) $(XX) -- migrate_pages(0x1, 0x2, 0x123000, 0x234000) = 22 +$(S) $(XX) -- unshare(0x20400) = ? +$(S) $(XX) -- unshare(0x20400) = 22 +$(S) $(XX) -- set_robust_list(0x123000, 33) = ? +$(S) $(XX) -- set_robust_list(0x123000, 33) = 22 +$(S) $(XX) -- get_robust_list(0x2c, 0x123000, 0x234000) = ? +$(S) $(XX) -- get_robust_list(0x2c, 0x123000, 0x234000) = 22 +$(S) $(XX) -- splice(2, 0x123000, 3, 0x234000, 0x7b, 0x1) = ? +$(S) $(XX) -- splice(2, 0x123000, 3, 0x234000, 0x7b, 0x1) = 22 +$(S) $(XX) -- splice(2, 0x123000, 3, 0x234000, 0x0, 0x4) = ? +$(S) $(XX) -- splice(2, 0x123000, 3, 0x234000, 0x0, 0x4) = 22 +$(S) $(XX) -- vmsplice(1, 0x123000, 0x2, 0x3) = ? +$(S) $(XX) -- vmsplice(1, 0x123000, 0x2, 0x3) = 22 +$(S) $(XX) -- tee(1, 2, 0x3, 0x0) = ? +$(S) $(XX) -- tee(1, 2, 0x3, 0x0) = 22 +$(S) $(XX) -- tee(1, 2, 0x3, 0x1) = ? +$(S) $(XX) -- tee(1, 2, 0x3, 0x1) = 22 +$(S) $(XX) -- tee(1, 2, 0x3, 0x2) = ? +$(S) $(XX) -- tee(1, 2, 0x3, 0x2) = 22 +$(S) $(XX) -- sync_file_range(2, 0x3, 0x4, 0x0) = ? +$(S) $(XX) -- sync_file_range(2, 0x3, 0x4, 0x0) = 22 +$(S) $(XX) -- sync_file_range(2, 0x3, 0x4, 0x1) = ? +$(S) $(XX) -- sync_file_range(2, 0x3, 0x4, 0x1) = 22 +$(S) $(XX) -- signalfd(1, 0x123000, 0xc) = ? +$(S) $(XX) -- signalfd(1, 0x123000, 0xc) = 22 +$(S) $(XX) -- signalfd4(1, 0x123000, 0xd, 0x800, $(XX)) = ? +$(S) $(XX) -- signalfd4(1, 0x123000, 0xd, 0x800, $(XX)) = 22 +$(S) $(XX) -- timerfd_create(0x0, 0x80000) = ? +$(S) $(XX) -- timerfd_create(0x0, 0x80000) = 22 +$(S) $(XX) -- timerfd_settime(1, 0x1, 0x123000, 0x234000) = ? +$(S) $(XX) -- timerfd_settime(1, 0x1, 0x123000, 0x234000) = 22 +$(S) $(XX) -- timerfd_gettime(2, 0x123000) = ? +$(S) $(XX) -- timerfd_gettime(2, 0x123000) = 22 +$(S) $(XX) -- eventfd(0x2d) = ? +$(S) $(XX) -- eventfd(0x2d) = 22 +$(S) $(XX) -- eventfd2(0x2f, 0x1) = ? +$(S) $(XX) -- eventfd2(0x2f, 0x1) = 22 +$(S) $(XX) -- fallocate(1, 0x2, 0x3, 0x4) = ? +$(S) $(XX) -- fallocate(1, 0x2, 0x3, 0x4) = 22 +$(S) $(XX) -- perf_event_open(0x123000, 0x1, 0x2, 0x3, 0x4) = ? +$(S) $(XX) -- perf_event_open(0x123000, 0x1, 0x2, 0x3, 0x4) = 22 +$(S) $(XX) -- fanotify_init(0x9, 0x2) = ? +$(S) $(XX) -- fanotify_init(0x9, 0x2) = 22 +$(S) $(XX) -- fanotify_mark(0x2, 0x2, 0x4000, 0x3, $(XX)) = ? +$(S) $(XX) -- fanotify_mark(0x2, 0x2, 0x4000, 0x3, $(XX)) = 22 +$(S) $(XX) -- name_to_handle_at(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x123000, 0x234000, 0x0) = ? +$(S) $(XX) -- name_to_handle_at(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x123000, 0x234000, 0x0) = 22 +$(S) $(XX) -- open_by_handle_at(3, 0x0000000000123000, 0) = ? +$(S) $(XX) -- open_by_handle_at(3, 0x0000000000123000, 0) = 22 +$(S) $(XX) -- setns(2, 0x0) = ? +$(S) $(XX) -- setns(2, 0x0) = 22 +$(S) $(XX) -- getcpu(0x123000, 0x123000, 0x234000) = ? +$(S) $(XX) -- getcpu(0x123000, 0x123000, 0x234000) = 22 +$(S) $(XX) -- process_vm_readv(0x1, 0x2, 0x3, 0x4, 0x5, 0x6) = ? +$(S) $(XX) -- process_vm_readv(0x1, 0x2, 0x3, 0x4, 0x5, 0x6) = 22 +$(S) $(XX) -- process_vm_writev(0x1, 0x2, 0x3, 0x4, 0x5, 0x6) = ? +$(S) $(XX) -- process_vm_writev(0x1, 0x2, 0x3, 0x4, 0x5, 0x6) = 22 +$(S) $(XX) -- kcmp(0x1, 0x2, 0x3, 0x4, 0x5) = ? +$(S) $(XX) -- kcmp(0x1, 0x2, 0x3, 0x4, 0x5) = 22 diff --git a/test/vfork_logging.c b/test/arch/x86_64/vfork_logging.c similarity index 100% rename from test/vfork_logging.c rename to test/arch/x86_64/vfork_logging.c diff --git a/test/riscv/src/clone_test.c b/test/clone_test.c similarity index 97% rename from test/riscv/src/clone_test.c rename to test/clone_test.c index 84d376f..9b38d8a 100644 --- a/test/riscv/src/clone_test.c +++ b/test/clone_test.c @@ -29,8 +29,10 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif + #include #include #include @@ -56,7 +58,7 @@ int main() { char child_stack[8192]; pid_t ppid = getpid(); pid_t pid = clone(child_func, child_stack + sizeof(child_stack), - CLONE_VM | SIGCHLD, &ppid); + SIGCHLD, &ppid); if (pid == -1) { perror("Clone failed"); diff --git a/test/riscv/src/fcntl_test.c b/test/fcntl_test.c similarity index 95% rename from test/riscv/src/fcntl_test.c rename to test/fcntl_test.c index 3c54cf2..464f58b 100644 --- a/test/riscv/src/fcntl_test.c +++ b/test/fcntl_test.c @@ -40,10 +40,14 @@ int main() { int fd2 = openat(AT_FDCWD, "testfile2.txt", O_RDWR | O_CREAT | O_TRUNC, 0666); int fd2_dup = fcntl(fd2, F_DUPFD, 0); char buf[128] = "writing to fd2_dup\n"; - write(fd2_dup, buf, strlen(buf)); + write(fd2_dup, buf, strlen(buf)); char dst_buf[128]; int n = read(fd, dst_buf, sizeof(buf)); dst_buf[n] = '\0'; assert(strcmp(buf, dst_buf) == 0); write(1, "FCNTL TEST - OK\n",16); + close(fd); + close(fd2); + close(fd2_dup); + return 0; } diff --git a/test/fork_test.c b/test/fork_test.c new file mode 100644 index 0000000..687a776 --- /dev/null +++ b/test/fork_test.c @@ -0,0 +1,78 @@ +/* + * Copyright 2025, University of Turin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + +#include +#include +#include +#include +#include + +int main() { + + int fd = openat(AT_FDCWD, "testfile.txt", O_CREAT | O_TRUNC | O_RDWR, 0666); + int fd2 = openat(AT_FDCWD, "testfile2.txt", O_CREAT | O_TRUNC | O_RDWR, 0666); + + pid_t pid = fork(); + int n, n2; + char buf[128]; + char buf2[128]; + + switch(pid) { + case -1: + perror("fork failed\n"); + break; + case 0: + n = read(fd, buf, sizeof(buf)); + buf[n] = '\0'; + n = atoi(buf); + assert(n == getpid()); + exit(EXIT_SUCCESS); + break; + default: + n2 = read(fd2, buf2, sizeof(buf2)); + buf2[n2] = '\0'; + n2 = atoi(buf2); + assert(n2 == getpid()); + int status; + wait(&status); + if (WIFSIGNALED(status) && WTERMSIG(status) == SIGABRT) { + fprintf(stderr, "Child assertion failed\n"); + return 1; + } + + break; + } + return 0; +} diff --git a/test/riscv/src/intercept_sys_clone.c b/test/intercept_sys_clone.c similarity index 94% rename from test/riscv/src/intercept_sys_clone.c rename to test/intercept_sys_clone.c index 854dc79..ad822e3 100644 --- a/test/riscv/src/intercept_sys_clone.c +++ b/test/intercept_sys_clone.c @@ -42,6 +42,14 @@ static int hook(long syscall_number, long arg4, long arg5, long *result) { + (void) arg0; + (void) arg1; + (void) arg2; + (void) arg3; + (void) arg4; + (void) arg5; + (void) result; + if (syscall_number == SYS_clone) { int fd = openat(AT_FDCWD, "testfile.txt", O_CREAT | O_TRUNC | O_RDWR, 0666); dprintf(fd,"%d\n",getpid()); diff --git a/test/riscv/src/intercept_sys_fcntl.c b/test/intercept_sys_fcntl.c similarity index 99% rename from test/riscv/src/intercept_sys_fcntl.c rename to test/intercept_sys_fcntl.c index 2470a74..f388007 100644 --- a/test/riscv/src/intercept_sys_fcntl.c +++ b/test/intercept_sys_fcntl.c @@ -42,6 +42,8 @@ hook(long syscall_number, long arg4, long arg5, long *result) { + (void) arg0; + if (syscall_number == SYS_fcntl) { int fd = openat(AT_FDCWD, "testfile.txt", O_RDWR | O_CREAT | O_TRUNC, 0666); int ret = syscall_no_intercept(syscall_number, fd, arg1, arg2, arg3, arg4, arg5); diff --git a/test/riscv/src/intercept_sys_write.c b/test/intercept_sys_fork.c similarity index 62% rename from test/riscv/src/intercept_sys_write.c rename to test/intercept_sys_fork.c index 103d0a6..a41e1b0 100644 --- a/test/riscv/src/intercept_sys_write.c +++ b/test/intercept_sys_fork.c @@ -1,5 +1,5 @@ /* - * Copyright 2017, Intel Corporation +* Copyright 2025, University of Turin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,53 +31,47 @@ */ #include "libsyscall_intercept_hook_point.h" +#include +#include +#include +#include -#include -#include -#include - -static int -hook(long syscall_number, - long arg0, long arg1, - long arg2, long arg3, - long arg4, long arg5, - long *result) +static int hook(long syscall_number, + long arg0, long arg1, + long arg2, long arg3, + long arg4, long arg5, + long *result) { - (void) arg0; - (void) arg2; - (void) arg3; - (void) arg4; - (void) arg5; - (void) result; - - if (syscall_number == SYS_write) { - const char test[] = "WRITE TEST - OK\n"; - const char *tmp = test; - if (strcmp((char *)arg1, tmp) == 0) return 1; - - const char interc[] = "intercepted_"; - const char *src = interc; - - /* write(fd, buf, len) */ - size_t len = (size_t)arg2; - char *buf = (char *)arg1; + (void) arg1; + (void) arg2; + (void) arg3; + (void) arg4; + (void) arg5; + (void) result; -#ifdef EXPECT_SPURIOUS_SYSCALLS - if (strcmp(buf, "original_syscall") != 0) - return 1; -#endif + if (syscall_number == SYS_clone) { + printf("Fork intercepted - Flags: 0x%lx - PID: %d\n", arg0, getpid()); + } + return 1; +} - if (len > sizeof(interc)) { - while (*src != '\0') - *buf++ = *src++; - } - } +static void hook_clone_parent(long child_pid) +{ + (void) child_pid; + int fd = openat(AT_FDCWD, "testfile2.txt", O_WRONLY); + dprintf(fd, "%d\n", getpid()); +} - return 1; +static void hook_clone_child(void) +{ + int fd = openat(AT_FDCWD, "testfile.txt", O_WRONLY); + dprintf(fd, "%d\n", getpid()); } static __attribute__((constructor)) void init(void) { - intercept_hook_point = hook; + intercept_hook_point = hook; + intercept_hook_point_clone_child = hook_clone_child; + intercept_hook_point_clone_parent = hook_clone_parent; } diff --git a/test/riscv/src/intercept_sys_mkdirat.c b/test/intercept_sys_mkdirat.c similarity index 99% rename from test/riscv/src/intercept_sys_mkdirat.c rename to test/intercept_sys_mkdirat.c index 41d311d..5ba5c45 100644 --- a/test/riscv/src/intercept_sys_mkdirat.c +++ b/test/intercept_sys_mkdirat.c @@ -45,6 +45,8 @@ static int hook(long syscall_number, long arg4, long arg5, long *result) { + (void) result; + if (syscall_number == SYS_mkdirat) { char buf[128] = "wrongdir/"; char *tmp = buf; diff --git a/test/riscv/src/intercept_sys_openat.c b/test/intercept_sys_openat.c similarity index 99% rename from test/riscv/src/intercept_sys_openat.c rename to test/intercept_sys_openat.c index 7c38553..34f8ed8 100644 --- a/test/riscv/src/intercept_sys_openat.c +++ b/test/intercept_sys_openat.c @@ -48,6 +48,7 @@ static int hook(long syscall_number, long arg4, long arg5, long *result) { + (void) arg2; if (syscall_number == SYS_openat) { const char non_existing[] = "non_existing.txt"; diff --git a/test/riscv/src/intercept_sys_read.c b/test/intercept_sys_read.c similarity index 94% rename from test/riscv/src/intercept_sys_read.c rename to test/intercept_sys_read.c index f9a2482..46e5c4c 100644 --- a/test/riscv/src/intercept_sys_read.c +++ b/test/intercept_sys_read.c @@ -44,10 +44,13 @@ static int hook(long syscall_number, long arg4, long arg5, long *result) { - (void)arg3; - (void)arg4; - (void)arg5; - (void)result; + (void) arg0; + (void) arg1; + (void) arg2; + (void) arg3; + (void) arg4; + (void) arg5; + (void) result; if (syscall_number == SYS_read) { int fd = openat(AT_FDCWD, "testfile.txt", O_WRONLY); diff --git a/test/riscv/src/intercept_sys_statx.c b/test/intercept_sys_statx.c similarity index 99% rename from test/riscv/src/intercept_sys_statx.c rename to test/intercept_sys_statx.c index 6c7112c..53c6ada 100644 --- a/test/riscv/src/intercept_sys_statx.c +++ b/test/intercept_sys_statx.c @@ -43,6 +43,8 @@ static int hook(long syscall_number, long arg4, long arg5, long *result) { + (void) result; + if (syscall_number == SYS_statx) { const char file2[] = "testfile2.txt"; const char *tmp = file2; diff --git a/test/libcintercept0.log.match b/test/libcintercept0.log.match index 1191f10..d7721f4 100644 --- a/test/libcintercept0.log.match +++ b/test/libcintercept0.log.match @@ -1,9 +1,9 @@ -$(S) $(XX) -- clone(CLONE_CHILD_CLEARTID | CLONE_CHILD_SETTID | 0x11, (null), (null), $(XX), $(XX)) = ? -$(OPT)$(S) $(XX) -- clone(CLONE_CHILD_CLEARTID | CLONE_CHILD_SETTID | 0x11, (null), (null), $(XX), $(XX)) = 0 -$(S) $(XX) -- clone(CLONE_CHILD_CLEARTID | CLONE_CHILD_SETTID | 0x11, (null), (null), $(XX), $(XX)) = $(N) -$(OPT)$(S) $(XX) -- clone(CLONE_CHILD_CLEARTID | CLONE_CHILD_SETTID | 0x11, (null), (null), $(XX), $(XX)) = 0 +$(S) $(XX) -- clone(CLONE_CHILD_CLEARTID | CLONE_CHILD_SETTID | SIGCHLD, (null), (null), $(XX), $(XX)) = ? +$(OPT)$(S) $(XX) -- clone(CLONE_CHILD_CLEARTID | CLONE_CHILD_SETTID | SIGCHLD, (null), (null), $(XX), $(XX)) = 0 +$(S) $(XX) -- clone(CLONE_CHILD_CLEARTID | CLONE_CHILD_SETTID | SIGCHLD, (null), (null), $(XX), $(XX)) = $(N) +$(OPT)$(S) $(XX) -- clone(CLONE_CHILD_CLEARTID | CLONE_CHILD_SETTID | SIGCHLD, (null), (null), $(XX), $(XX)) = 0 $(S) $(XX) -- wait4($(N), 0x0, 0x0, 0x0) = ? -$(OPT)$(S) $(XX) -- clone(CLONE_CHILD_CLEARTID | CLONE_CHILD_SETTID | 0x11, (null), (null), $(XX), $(XX)) = 0 +$(OPT)$(S) $(XX) -- clone(CLONE_CHILD_CLEARTID | CLONE_CHILD_SETTID | SIGCHLD, (null), (null), $(XX), $(XX)) = 0 $(OPT)$(S) $(XX) -- set_robust_list($(XX), $(N)) = ? $(OPT)$(S) $(XX) -- set_robust_list($(XX), $(N)) = $(N) $(S) $(XX) -- wait4($(N), 0x0, 0x0, 0x0) = $(N) @@ -11,16 +11,16 @@ $(OPT)$(S) $(XX) -- open($(S), O_RDONLY) = ? $(OPT)$(S) $(XX) -- open($(S), O_RDONLY) = $(N) $(OPT)$(S) $(XX) -- openat(AT_FDCWD, $(S), O_RDONLY) = ? $(OPT)$(S) $(XX) -- openat(AT_FDCWD, $(S), O_RDONLY) = $(N) -$(S) $(XX) -- fstat($(N), $(XX)) = ? -$(S) $(XX) -- fstat($(N), $(XX)) = 0 +$(S) $(XX) -- $(*)fstat$(*)($(N),$(*)$(XX)$(*)) = ? +$(S) $(XX) -- $(*)fstat$(*)($(N),$(*)$(XX)$(*)) = 0 $(OPT)$(S) $(XX) -- mmap($(XX), $(N), $(N), $(N), $(N), $(XX)) = ? $(OPT)$(S) $(XX) -- mmap($(XX), $(N), $(N), $(N), $(N), $(XX)) = $(N) $(OPT)$(S) $(XX) -- mmap($(XX), $(N), $(N), $(N), $(N), $(XX)) = ? $(OPT)$(S) $(XX) -- mmap($(XX), $(N), $(N), $(N), $(N), $(XX)) = $(N) $(S) $(XX) -- read($(N), $(XX), $(N)) = ? $(S) $(XX) -- read($(N), "/*\n * Copyright 2016-2017, Intel Corporation\n *\n * Redistribution and use in source and binary forms, with or without\n...", $(N)) = $(N) -$(S) $(XX) -- fstat(1, $(XX)) = ? -$(S) $(XX) -- fstat(1, $(XX)) = 0 +$(S) $(XX) -- $(*)fstat$(*)(1,$(*)$(XX)$(*)) = ? +$(S) $(XX) -- $(*)fstat$(*)(1,$(*)$(XX)$(*)) = 0 $(OPT)$(S) $(XX) -- mmap($(XX), $(N), $(N), $(N), $(N), $(XX)) = ? $(OPT)$(S) $(XX) -- mmap($(XX), $(N), $(N), $(N), $(N), $(XX)) = $(N) $(OPT)$(S) $(XX) -- mmap($(XX), $(N), $(N), $(N), $(N), $(XX)) = ? diff --git a/test/libcintercept0_child.log.match b/test/libcintercept0_child.log.match index bcd3f60..401a0bf 100644 --- a/test/libcintercept0_child.log.match +++ b/test/libcintercept0_child.log.match @@ -2,16 +2,16 @@ $(OPT)$(S) $(XX) -- open($(S), O_RDONLY) = ? $(OPT)$(S) $(XX) -- open($(S), O_RDONLY) = $(N) $(OPT)$(S) $(XX) -- openat(AT_FDCWD, $(S), O_RDONLY) = ? $(OPT)$(S) $(XX) -- openat(AT_FDCWD, $(S), O_RDONLY) = $(N) -$(S) $(XX) -- fstat($(N), $(XX)) = ? -$(S) $(XX) -- fstat($(N), $(XX)) = 0 +$(S) $(XX) -- $(*)fstat$(*)($(N),$(*)$(XX)$(*)) = ? +$(S) $(XX) -- $(*)fstat$(*)($(N),$(*)$(XX)$(*)) = 0 $(OPT)$(S) $(XX) -- mmap($(XX), $(N), $(N), $(N), $(N), $(XX)) = ? $(OPT)$(S) $(XX) -- mmap($(XX), $(N), $(N), $(N), $(N), $(XX)) = $(N) $(OPT)$(S) $(XX) -- mmap($(XX), $(N), $(N), $(N), $(N), $(XX)) = ? $(OPT)$(S) $(XX) -- mmap($(XX), $(N), $(N), $(N), $(N), $(XX)) = $(N) $(S) $(XX) -- read($(N), $(XX), $(N)) = ? $(S) $(XX) -- read($(N), "/*\n * Copyright 2016-2017, Intel Corporation\n *\n * Redistribution and use in source and binary forms, with or without\n...", $(N)) = $(N) -$(S) $(XX) -- fstat(1, $(XX)) = ? -$(S) $(XX) -- fstat(1, $(XX)) = 0 +$(S) $(XX) -- $(*)fstat$(*)(1,$(*)$(XX)$(*)) = ? +$(S) $(XX) -- $(*)fstat$(*)(1,$(*)$(XX)$(*)) = 0 $(OPT)$(S) $(XX) -- mmap($(XX), $(N), $(N), $(N), $(N), $(XX)) = ? $(OPT)$(S) $(XX) -- mmap($(XX), $(N), $(N), $(N), $(N), $(XX)) = $(N) $(OPT)$(S) $(XX) -- mmap($(XX), $(N), $(N), $(N), $(N), $(XX)) = ? diff --git a/test/riscv/src/mkdirat_test.c b/test/mkdirat_test.c similarity index 98% rename from test/riscv/src/mkdirat_test.c rename to test/mkdirat_test.c index 5700a1f..821014d 100644 --- a/test/riscv/src/mkdirat_test.c +++ b/test/mkdirat_test.c @@ -47,10 +47,10 @@ #include int main() { + system("rm -rf testdir/"); mkdirat(AT_FDCWD,"wrongdir/", 0777); int fd = openat(AT_FDCWD, "testdir/testdirfile.txt", O_RDWR | O_CREAT | O_TRUNC, 0666); assert(fd != -1); - system("rm -rf testdir/"); write(1, "MKDIRAT TEST - OK\n", 18); return 0; } diff --git a/test/riscv/src/openat_test.c b/test/openat_test.c similarity index 100% rename from test/riscv/src/openat_test.c rename to test/openat_test.c diff --git a/test/riscv/src/read_test.c b/test/read_test.c similarity index 100% rename from test/riscv/src/read_test.c rename to test/read_test.c diff --git a/test/riscv/Makefile b/test/riscv/Makefile deleted file mode 100644 index cacedc2..0000000 --- a/test/riscv/Makefile +++ /dev/null @@ -1,65 +0,0 @@ -CC = gcc -CFLAGS += -I../../include -CFLAGS += -L../../build -CFLAGS += -lsyscall_intercept -CFLAGS += -fpic -shared - -BIN_DIR = bin -BUILD_DIR = build -SRC_DIR = src - -LD_LIBRARY_PATH = ./build:../../build -LD_PRELOAD = ./build - -TESTS += clone -TESTS += fcntl -TESTS += mkdirat -TESTS += openat -TESTS += read -TESTS += statx -TESTS += write - -EXECUTABLES += $(BIN_DIR)/clone_test -EXECUTABLES += $(BIN_DIR)/fcntl_test -EXECUTABLES += $(BIN_DIR)/mkdirat_test -EXECUTABLES += $(BIN_DIR)/openat_test -EXECUTABLES += $(BIN_DIR)/read_test -EXECUTABLES += $(BIN_DIR)/statx_test -EXECUTABLES += $(BIN_DIR)/write_test - -INTERCEPT_LIBS += $(BUILD_DIR)/intercept_sys_clone.so -INTERCEPT_LIBS += $(BUILD_DIR)/intercept_sys_fcntl.so -INTERCEPT_LIBS += $(BUILD_DIR)/intercept_sys_mkdirat.so -INTERCEPT_LIBS += $(BUILD_DIR)/intercept_sys_openat.so -INTERCEPT_LIBS += $(BUILD_DIR)/intercept_sys_read.so -INTERCEPT_LIBS += $(BUILD_DIR)/intercept_sys_statx.so -INTERCEPT_LIBS += $(BUILD_DIR)/intercept_sys_write.so - -all: $(BIN_DIR) $(BUILD_DIR) $(EXECUTABLES) $(INTERCEPT_LIBS) - -$(BUILD_DIR)/%.so: $(SRC_DIR)/%.c - $(CC) -o $@ $< $(CFLAGS) - -$(BIN_DIR)/%: $(SRC_DIR)/%.c - $(CC) $< -o $@ - -test: $(TESTS) - -$(TESTS): - @echo "Running test: $@" - @LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) LD_PRELOAD=$(LD_PRELOAD)/intercept_sys_$@.so $(BIN_DIR)/$@_test \ - && echo "Test $@ - \033[32mPASSED\033[0m" \ - || echo "Test $@ - \033[31mFAILED\033[0m" - @echo - -clean: - rm -f $(BIN_DIR)/* - rm -f $(BUILD_DIR)/* - rm -f *.txt - rm -rf wrongdir/ - -$(BIN_DIR): - mkdir -p $(BIN_DIR) - -$(BUILD_DIR): - mkdir -p $(BUILD_DIR) diff --git a/test/riscv/README.md b/test/riscv/README.md deleted file mode 100644 index 7cad175..0000000 --- a/test/riscv/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# Testing on RISC-V # - -The tests inside `./src` must be considered as couples containing an executable -and an initialization library, named as follows: -- `_test.c` -- `intercept_sys_.c` - -They can be compiled with -```shell -make -``` -and executed with -```shell -make test -``` -Alternatively, it is possible to execute a specific test with the following -command, where syscall-name must be replaced with one of the entries in -the TESTS variable in the Makefile -``` -make -``` - -## How these test work ## - -These tests basically assert a condition which can't possibly be true unless -the hook function is executed as expected thanks to a correct interception of -the tested system call. As an example, the `write` test writes a string to a -file, then reads the written string from that file and in the end asserts that -the two strings are perfectly equal. By looking at the content of -[write_test.c](src/write_test.c) it is obvious how the assertion could never be -true since the written string and the expected string are different. The hook -function which will be executed before forwarding the system call to the kernel -will make sure to modify the string that is going to be written to the file so -that the actual written string and the expected string match. -All the tests implement the described pattern. \ No newline at end of file diff --git a/test/riscv/src/statx_test.c b/test/statx_test.c similarity index 92% rename from test/riscv/src/statx_test.c rename to test/statx_test.c index 3e2c922..d82884a 100644 --- a/test/riscv/src/statx_test.c +++ b/test/statx_test.c @@ -29,8 +29,10 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif + #include #include #include @@ -41,11 +43,11 @@ #include int main() { - int fd = openat(AT_FDCWD, "testfile.txt", O_RDWR | O_CREAT | O_TRUNC, 0666); + openat(AT_FDCWD, "testfile.txt", O_RDWR | O_CREAT | O_TRUNC, 0666); struct statx stx; statx(AT_FDCWD, "testfile.txt", 0, STATX_BASIC_STATS | STATX_BTIME, &stx); - int fd2 = openat(AT_FDCWD, "testfile2.txt", O_RDWR | O_CREAT | O_TRUNC, 0666); + openat(AT_FDCWD, "testfile2.txt", O_RDWR | O_CREAT | O_TRUNC, 0666); struct statx stx2; statx(AT_FDCWD, "testfile2.txt", 0, STATX_BASIC_STATS | STATX_BTIME, &stx2); diff --git a/test/syscall_format.c b/test/syscall_format.c index 8d33be3..7a4112d 100644 --- a/test/syscall_format.c +++ b/test/syscall_format.c @@ -60,7 +60,6 @@ #undef _FORTIFY_SOURCE #endif -#include #include #include #include @@ -84,7 +83,6 @@ #include #include #include -#include #include #include #include @@ -117,6 +115,13 @@ #include #include +#ifdef SYS_arch_prctl + #include +#endif +#if defined(SYS_iopl) || defined(SYS_ioperm) + #include +#endif + #include "libsyscall_intercept_hook_point.h" #include "magic_syscalls.h" @@ -240,7 +245,9 @@ main(int argc, char **argv) void *p0 = (void *)0x123000; void *p1 = (void *)0x234000; void *p2 = (void *)0x456000; - void *p3 = (void *)0x567000; + struct timeval tv = {.tv_sec = 123, .tv_usec = 456}; + struct utimbuf utb = {.actime = 1234567890, .modtime = 1234567890}; + struct timeval tv_arr[2] = {tv, tv}; socklen_t sl[2] = {1, 1}; @@ -280,6 +287,7 @@ main(int argc, char **argv) pwritev(1, NULL, 4, 0x1000); /* open, close */ +#ifdef SYS_open syscall(SYS_open, input[0], O_CREAT | O_RDWR | O_SYNC, 0321); syscall(SYS_open, input[0], 0, 0321); syscall(SYS_open, NULL, all_o_flags, 0777); @@ -287,6 +295,7 @@ main(int argc, char **argv) syscall(SYS_open, input[1], O_RDWR | O_NONBLOCK, 0111); syscall(SYS_open, input[1], 0); syscall(SYS_open, NULL, 0); +#endif openat(AT_FDCWD, input[0], O_CREAT | O_RDWR | O_SYNC, 0321); openat(AT_FDCWD, input[0], 0, 0321); openat(AT_FDCWD, NULL, all_o_flags, 0777); @@ -307,6 +316,12 @@ main(int argc, char **argv) stat(NULL, &statbuf); stat("/", &statbuf); fstat(0, NULL); + /* + * fstat implementation from some glibc versions doesn't invoke kernel if + * fd is negative so the related expected entries in + * syscall_format_logging.match (79-82) of the next two calls are marked + * with optional token $(OPT) + */ fstat(-1, NULL); fstat(AT_FDCWD, &statbuf); fstat(2, &statbuf); @@ -388,7 +403,7 @@ main(int argc, char **argv) pipe(fd2); pipe2(fd2, 0); - select(2, p0, p1, p2, p3); + select(2, p0, p1, p2, &tv); syscall(SYS_pselect6, 2, p0, p1, p0, p1, p0); sched_yield(); @@ -396,7 +411,7 @@ main(int argc, char **argv) /* shared memory */ shmget(3, 4, 5); shmat(3, p0, 5); - shmctl(3, 5, p0); + shmctl(3, SHM_INFO, p0); shmdt(p0); dup(4); @@ -466,7 +481,9 @@ main(int argc, char **argv) truncate(input[0], 4); ftruncate(3, 3); +#ifdef SYS_getdents syscall(SYS_getdents, 4, p0, 1); +#endif syscall(SYS_getdents64, 4, p0, 1); setup_buffers(); @@ -480,15 +497,21 @@ main(int argc, char **argv) renameat(AT_FDCWD, input[0], 7, input[1]); renameat(9, input[0], AT_FDCWD, input[1]); +#ifdef SYS_mkdir syscall(SYS_mkdir, input[0], 0644); +#endif syscall(SYS_mkdirat, AT_FDCWD, input[0], 0644); mkdirat(33, input[0], 0644); mkdirat(33, NULL, 0555); +#ifdef SYS_rmdir syscall(SYS_rmdir, input[0]); syscall(SYS_rmdir, NULL); +#endif /* libc implementations might translate creat to open with O_CREAT */ +#ifdef SYS_creat syscall(SYS_creat, input[0], 0644); +#endif link(input[0], input[1]); linkat(1, input[0], 2, input[1], 0); @@ -576,15 +599,17 @@ main(int argc, char **argv) syscall(SYS_rt_sigsuspend, p0, 3); syscall(SYS_sigaltstack, p0, p1); - utime(input[0], p0); - utimes(input[0], p0); - futimesat(4, input[0], p0); + utime(input[0], &utb); + utimes(input[0], tv_arr); + futimesat(4, input[0], tv_arr); mknod(input[0], 1, 2); mknodat(1, input[0], 1, 2); mknodat(AT_FDCWD, input[0], 1, 2); +#ifdef SYS_ustat syscall(SYS_ustat, 2, p0); +#endif statfs(input[0], p0); fstatfs(4, p0); @@ -603,16 +628,21 @@ main(int argc, char **argv) vhangup(); +#ifdef SYS_modify_ldt syscall(SYS_modify_ldt, 1, p0, 1); +#endif setup_buffers(); syscall(SYS_pivot_root, input[0], buffer[0]); +#ifdef SYS__sysctl syscall(SYS__sysctl, p0); +#endif prctl(PR_CAPBSET_DROP, 1, 2, 3, 4); +#ifdef SYS_arch_prctl syscall(SYS_arch_prctl, ARCH_SET_FS, p0); - +#endif adjtimex(p0); chroot(input[0]); @@ -630,9 +660,12 @@ main(int argc, char **argv) sethostname(input[0], len0); setdomainname(input[0], len0); - +#ifdef SYS_iopl iopl(1); +#endif +#ifdef SYS_ioperm ioperm(3, 4, 1); +#endif syscall(SYS_init_module, p0, 16, p1); syscall(SYS_finit_module, 3, p0, 0); @@ -665,12 +698,18 @@ main(int argc, char **argv) syscall(SYS_tkill, 44, SIGSTOP); syscall(SYS_tgkill, 44, 55, SIGSTOP); +#ifdef SYS_time syscall(SYS_time, p0); +#endif syscall(SYS_futex, p0, FUTEX_WAKE, 7L, p0, p1, 1L); +#ifdef SYS_set_thread_area syscall(SYS_set_thread_area, p0); +#endif +#ifdef SYS_get_thread_area syscall(SYS_get_thread_area, p0); +#endif syscall(SYS_io_setup, 1, p0); syscall(SYS_io_destroy, 77); @@ -683,7 +722,9 @@ main(int argc, char **argv) epoll_create(7); epoll_create1(0); epoll_create1(EPOLL_CLOEXEC); +#ifdef SYS_epoll_wait syscall(SYS_epoll_wait, 2L, p0, 4L, 5L); +#endif syscall(SYS_epoll_pwait, 2L, p0, 4L, 5L, p1, 6L); epoll_ctl(2L, 3L, 4L, p0); @@ -752,14 +793,18 @@ main(int argc, char **argv) sync_file_range(2, 3, 4, 0); sync_file_range(2, 3, 4, SYNC_FILE_RANGE_WAIT_BEFORE); +#ifdef SYS_signalfd syscall(SYS_signalfd, 1, p0, 12); +#endif syscall(SYS_signalfd4, 1, p0, 13, SFD_NONBLOCK); timerfd_create(CLOCK_REALTIME, TFD_CLOEXEC); timerfd_settime(1, TFD_TIMER_ABSTIME, p0, p1); timerfd_gettime(2, p0); +#ifdef SYS_eventfd syscall(SYS_eventfd, 45); +#endif syscall(SYS_eventfd2, 47, EFD_SEMAPHORE); fallocate(1, FALLOC_FL_PUNCH_HOLE, 3, 4); diff --git a/test/syscall_format.log.match b/test/syscall_format.log.match index 8c89d45..de64dd8 100644 --- a/test/syscall_format.log.match +++ b/test/syscall_format.log.match @@ -32,20 +32,20 @@ $(S) $(XX) -- pwritev(1, 0x123000, 0x4, 0x1000) = ? $(S) $(XX) -- pwritev(1, 0x123000, 0x4, 0x1000) = 22 $(S) $(XX) -- pwritev(1, 0x0, 0x4, 0x1000) = ? $(S) $(XX) -- pwritev(1, 0x0, 0x4, 0x1000) = 22 -$(S) $(XX) -- open("input_data\x01\x02\x03\n\r\t", O_RDWR | O_CREAT | O_DSYNC | O_RSYNC, 0321) = ? -$(S) $(XX) -- open("input_data\x01\x02\x03\n\r\t", O_RDWR | O_CREAT | O_DSYNC | O_RSYNC, 0321) = 22 -$(S) $(XX) -- open("input_data\x01\x02\x03\n\r\t", O_RDONLY) = ? -$(S) $(XX) -- open("input_data\x01\x02\x03\n\r\t", O_RDONLY) = 22 -$(S) $(XX) -- open((null), O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = ? -$(S) $(XX) -- open((null), O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = 22 -$(S) $(XX) -- open("input_data\x01\x02\x03\n\r\t", O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = ? -$(S) $(XX) -- open("input_data\x01\x02\x03\n\r\t", O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = 22 -$(S) $(XX) -- open("other_input_data\x01\x02\x03\n\r\t", O_RDWR | O_NONBLOCK) = ? -$(S) $(XX) -- open("other_input_data\x01\x02\x03\n\r\t", O_RDWR | O_NONBLOCK) = 22 -$(S) $(XX) -- open("other_input_data\x01\x02\x03\n\r\t", O_RDONLY) = ? -$(S) $(XX) -- open("other_input_data\x01\x02\x03\n\r\t", O_RDONLY) = 22 -$(S) $(XX) -- open((null), O_RDONLY) = ? -$(S) $(XX) -- open((null), O_RDONLY) = 22 +$(OPT)$(S) $(XX) -- open("input_data\x01\x02\x03\n\r\t", O_RDWR | O_CREAT | O_DSYNC | O_RSYNC, 0321) = ? +$(OPT)$(S) $(XX) -- open("input_data\x01\x02\x03\n\r\t", O_RDWR | O_CREAT | O_DSYNC | O_RSYNC, 0321) = 22 +$(OPT)$(S) $(XX) -- open("input_data\x01\x02\x03\n\r\t", O_RDONLY) = ? +$(OPT)$(S) $(XX) -- open("input_data\x01\x02\x03\n\r\t", O_RDONLY) = 22 +$(OPT)$(S) $(XX) -- open((null), O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = ? +$(OPT)$(S) $(XX) -- open((null), O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = 22 +$(OPT)$(S) $(XX) -- open("input_data\x01\x02\x03\n\r\t", O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = ? +$(OPT)$(S) $(XX) -- open("input_data\x01\x02\x03\n\r\t", O_RDWR | O_APPEND | O_CLOEXEC | O_CREAT | O_DIRECTORY | O_DSYNC | O_EXCL | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_RSYNC | O_TRUNC, 0777) = 22 +$(OPT)$(S) $(XX) -- open("other_input_data\x01\x02\x03\n\r\t", O_RDWR | O_NONBLOCK) = ? +$(OPT)$(S) $(XX) -- open("other_input_data\x01\x02\x03\n\r\t", O_RDWR | O_NONBLOCK) = 22 +$(OPT)$(S) $(XX) -- open("other_input_data\x01\x02\x03\n\r\t", O_RDONLY) = ? +$(OPT)$(S) $(XX) -- open("other_input_data\x01\x02\x03\n\r\t", O_RDONLY) = 22 +$(OPT)$(S) $(XX) -- open((null), O_RDONLY) = ? +$(OPT)$(S) $(XX) -- open((null), O_RDONLY) = 22 $(S) $(XX) -- openat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", O_RDWR | O_CREAT | O_DSYNC | O_RSYNC, 0321) = ? $(S) $(XX) -- openat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", O_RDWR | O_CREAT | O_DSYNC | O_RSYNC, 0321) = 22 $(S) $(XX) -- openat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", O_RDONLY) = ? @@ -66,30 +66,30 @@ $(S) $(XX) -- openat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", O_RDWR | O_ $(S) $(XX) -- openat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", O_RDWR | O_TMPFILE, 0333) = 22 $(S) $(XX) -- close(9) = ? $(S) $(XX) -- close(9) = 22 -$(S) $(XX) -- stat((null), (null)) = ? -$(S) $(XX) -- stat((null), (null)) = 22 -$(S) $(XX) -- stat("/", (null)) = ? -$(S) $(XX) -- stat("/", (null)) = 22 -$(S) $(XX) -- stat((null), $(XX)) = ? -$(S) $(XX) -- stat((null), $(XX)) = 22 -$(S) $(XX) -- stat("/", $(XX)) = ? -$(S) $(XX) -- stat("/", $(XX)) = 22 -$(S) $(XX) -- fstat(0, (null)) = ? -$(S) $(XX) -- fstat(0, (null)) = 22 -$(S) $(XX) -- fstat(-1, (null)) = ? -$(S) $(XX) -- fstat(-1, (null)) = 22 -$(S) $(XX) -- fstat(-100, $(XX)) = ? -$(S) $(XX) -- fstat(-100, $(XX)) = 22 -$(S) $(XX) -- fstat(2, $(XX)) = ? -$(S) $(XX) -- fstat(2, $(XX)) = 22 -$(S) $(XX) -- lstat((null), (null)) = ? -$(S) $(XX) -- lstat((null), (null)) = 22 -$(S) $(XX) -- lstat("/", (null)) = ? -$(S) $(XX) -- lstat("/", (null)) = 22 -$(S) $(XX) -- lstat((null), $(XX)) = ? -$(S) $(XX) -- lstat((null), $(XX)) = 22 -$(S) $(XX) -- lstat("/", $(XX)) = ? -$(S) $(XX) -- lstat("/", $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), $(XX), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), $(XX), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", $(XX), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", $(XX), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), $(XX), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), $(XX), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", $(XX), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", $(XX), $(XX)) = 22 +$(S) $(XX) -- $(S)fstat$(S)(0, $(*)) = ? +$(S) $(XX) -- $(S)fstat$(S)(0, $(*)) = 22 +$(OPT)$(S) $(XX) -- $(S)fstat$(S)(-1, $(*)) = ? +$(OPT)$(S) $(XX) -- $(S)fstat$(S)(-1, $(*)) = 22 +$(OPT)$(S) $(XX) -- $(S)fstat$(S)(AT_FDCWD, $(*)) = ? +$(OPT)$(S) $(XX) -- $(S)fstat$(S)(AT_FDCWD, $(*)) = 22 +$(S) $(XX) -- $(S)fstat$(S)(2, $(*)) = ? +$(S) $(XX) -- $(S)fstat$(S)(2, $(*)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), $(XX), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), $(XX), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", $(XX), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", $(XX), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), $(XX), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, (null), $(XX), $(XX)) = 22 +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", $(XX), $(XX)) = ? +$(S) $(XX) -- newfstatat(AT_FDCWD, "/", $(XX), $(XX)) = 22 $(S) $(XX) -- newfstatat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x0, 0x0) = ? $(S) $(XX) -- newfstatat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0x0, 0x0) = 22 $(S) $(XX) -- newfstatat(AT_FDCWD, (null), 0x0, 0x0) = ? @@ -98,12 +98,12 @@ $(S) $(XX) -- newfstatat(-1000, "", $(XX), 0x0) = ? $(S) $(XX) -- newfstatat(-1000, "", $(XX), 0x0) = 22 $(S) $(XX) -- newfstatat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", $(XX), 0x100) = ? $(S) $(XX) -- newfstatat(AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t", $(XX), 0x100) = 22 -$(S) $(XX) -- poll((null), 0x0, 0x7) = ? -$(S) $(XX) -- poll((null), 0x0, 0x7) = 22 -$(S) $(XX) -- poll($(XX), 0x3, 0x7) = ? -$(S) $(XX) -- poll($(XX), 0x3, 0x7) = 22 -$(S) $(XX) -- ppoll($(XX), 0x2, 0x123000, 0x234000, 0x2) = ? -$(S) $(XX) -- ppoll($(XX), 0x2, 0x123000, 0x234000, 0x2) = 22 +$(S) $(XX) -- $(*)poll((null), 0, $(*)) = ? +$(S) $(XX) -- $(*)poll((null), 0, $(*)) = 22 +$(S) $(XX) -- $(*)poll($(XX), 3, $(*)) = ? +$(S) $(XX) -- $(*)poll($(XX), 3, $(*)) = 22 +$(S) $(XX) -- ppoll($(XX), 2, 0x123000, 0x234000, 2) = ? +$(S) $(XX) -- ppoll($(XX), 2, 0x123000, 0x234000, 2) = 22 $(S) $(XX) -- lseek(0, 0, SEEK_SET) = ? $(S) $(XX) -- lseek(0, 0, SEEK_SET) = 22 $(S) $(XX) -- lseek(0, 0, SEEK_CUR) = ? @@ -186,28 +186,28 @@ $(S) $(XX) -- rt_sigprocmask(0x2, 0x0000000000123000, 0x0000000000234000, 10) = $(S) $(XX) -- rt_sigprocmask(0x2, 0x0000000000123000, 0x0000000000234000, 10) = 22 $(S) $(XX) -- ioctl(1, 0x4d, 0x0000000000234000) = ? $(S) $(XX) -- ioctl(1, 0x4d, 0x0000000000234000) = 22 -$(S) $(XX) -- access((null), F_OK) = ? -$(S) $(XX) -- access((null), F_OK) = 22 -$(S) $(XX) -- access("input_data\x01\x02\x03\n\r\t", X_OK) = ? -$(S) $(XX) -- access("input_data\x01\x02\x03\n\r\t", X_OK) = 22 -$(S) $(XX) -- access("", R_OK | W_OK) = ? -$(S) $(XX) -- access("", R_OK | W_OK) = 22 -$(S) $(XX) -- access("input_data\x01\x02\x03\n\r\t", R_OK | W_OK | X_OK) = ? -$(S) $(XX) -- access("input_data\x01\x02\x03\n\r\t", R_OK | W_OK | X_OK) = 22 -$(S) $(XX) -- faccessat(AT_FDCWD, (null), 00) = ? -$(S) $(XX) -- faccessat(AT_FDCWD, (null), 00) = 22 -$(S) $(XX) -- faccessat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01) = ? -$(S) $(XX) -- faccessat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01) = 22 -$(S) $(XX) -- faccessat(AT_FDCWD, "", 06) = ? -$(S) $(XX) -- faccessat(AT_FDCWD, "", 06) = 22 -$(S) $(XX) -- faccessat(9, "input_data\x01\x02\x03\n\r\t", 07) = ? -$(S) $(XX) -- faccessat(9, "input_data\x01\x02\x03\n\r\t", 07) = 22 -$(S) $(XX) -- pipe($(XX)) = ? -$(S) $(XX) -- pipe([123, 234]) = 22 +$(S) $(XX) -- $(*)access$(*)($(*)(null), F_OK) = ? +$(S) $(XX) -- $(*)access$(*)($(*)(null), F_OK) = 22 +$(S) $(XX) -- $(*)access$(*)($(*)"input_data\x01\x02\x03\n\r\t", X_OK) = ? +$(S) $(XX) -- $(*)access$(*)($(*)"input_data\x01\x02\x03\n\r\t", X_OK) = 22 +$(S) $(XX) -- $(*)access$(*)($(*)"", R_OK | W_OK) = ? +$(S) $(XX) -- $(*)access$(*)($(*)"", R_OK | W_OK) = 22 +$(S) $(XX) -- $(*)access$(*)($(*)"input_data\x01\x02\x03\n\r\t", R_OK | W_OK | X_OK) = ? +$(S) $(XX) -- $(*)access$(*)($(*)"input_data\x01\x02\x03\n\r\t", R_OK | W_OK | X_OK) = 22 +$(S) $(XX) -- faccessat2(AT_FDCWD, (null), 00, $(XX)) = ? +$(S) $(XX) -- faccessat2(AT_FDCWD, (null), 00, $(XX)) = 22 +$(S) $(XX) -- faccessat2(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01, $(XX)) = ? +$(S) $(XX) -- faccessat2(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01, $(XX)) = 22 +$(S) $(XX) -- faccessat2(AT_FDCWD, "", 06, $(XX)) = ? +$(S) $(XX) -- faccessat2(AT_FDCWD, "", 06, $(XX)) = 22 +$(S) $(XX) -- faccessat2(9, "input_data\x01\x02\x03\n\r\t", 07, $(XX)) = ? +$(S) $(XX) -- faccessat2(9, "input_data\x01\x02\x03\n\r\t", 07, $(XX)) = 22 +$(S) $(XX) -- pipe2($(XX), $(N)) = ? +$(S) $(XX) -- pipe2([123, 234], $(N)) = 22 $(S) $(XX) -- pipe2($(XX), 0) = ? $(S) $(XX) -- pipe2([123, 234], 0) = 22 -$(S) $(XX) -- select(2, 0x0000000000123000, 0x0000000000234000, 0x0000000000456000, 0x0000000000567000) = ? -$(S) $(XX) -- select(2, 0x0000000000123000, 0x0000000000234000, 0x0000000000456000, 0x0000000000567000) = 22 +$(S) $(XX) -- pselect6(0x2, 0x123000, 0x234000, 0x456000, $(XX), $(XX)) = ? +$(S) $(XX) -- pselect6(0x2, 0x123000, 0x234000, 0x456000, $(XX), $(XX)) = 22 $(S) $(XX) -- pselect6(0x2, 0x123000, 0x234000, 0x123000, 0x234000, 0x123000) = ? $(S) $(XX) -- pselect6(0x2, 0x123000, 0x234000, 0x123000, 0x234000, 0x123000) = 22 $(S) $(XX) -- sched_yield() = ? @@ -216,20 +216,20 @@ $(S) $(XX) -- shmget(0x3, 0x4, 0x5) = ? $(S) $(XX) -- shmget(0x3, 0x4, 0x5) = 22 $(S) $(XX) -- shmat(0x3, 0x123000, 0x5) = ? $(S) $(XX) -- shmat(0x3, 0x123000, 0x5) = 0x16 -$(S) $(XX) -- shmctl(0x3, 0x5, 0x123000) = ? -$(S) $(XX) -- shmctl(0x3, 0x5, 0x123000) = 22 +$(S) $(XX) -- shmctl(0x3, 0xe, 0x123000) = ? +$(S) $(XX) -- shmctl(0x3, 0xe, 0x123000) = 22 $(S) $(XX) -- shmdt(0x123000) = ? $(S) $(XX) -- shmdt(0x123000) = 22 $(S) $(XX) -- dup(4) = ? $(S) $(XX) -- dup(4) = 22 -$(S) $(XX) -- dup2(4, 5) = ? -$(S) $(XX) -- dup2(4, 5) = 22 +$(S) $(XX) -- dup$(N)(4, 5$(*)) = ? +$(S) $(XX) -- dup$(N)(4, 5$(*)) = 22 $(S) $(XX) -- dup3(4, 5, 0x0) = ? $(S) $(XX) -- dup3(4, 5, 0x0) = 22 $(S) $(XX) -- dup3(4, 5, 0x80000) = ? $(S) $(XX) -- dup3(4, 5, 0x80000) = 22 -$(S) $(XX) -- pause() = ? -$(S) $(XX) -- pause() = 22 +$(S) $(XX) -- p$(S)($(*)) = ? +$(S) $(XX) -- p$(S)($(*)) = 22 $(S) $(XX) -- clock_nanosleep(0x0, 0x0, 0x123000, 0x234000) = ? $(S) $(XX) -- clock_nanosleep(0x0, 0x0, 0x123000, 0x234000) = 22 $(S) $(XX) -- getitimer(0x3, 0x123000) = ? @@ -318,8 +318,8 @@ $(S) $(XX) -- truncate("input_data\x01\x02\x03\n\r\t", 0x4) = ? $(S) $(XX) -- truncate("input_data\x01\x02\x03\n\r\t", 0x4) = 22 $(S) $(XX) -- ftruncate(3, 0x3) = ? $(S) $(XX) -- ftruncate(3, 0x3) = 22 -$(S) $(XX) -- getdents(4, 0x123000, 0x1) = ? -$(S) $(XX) -- getdents(4, 0x123000, 0x1) = 22 +$(OPT)$(S) $(XX) -- getdents(4, 0x123000, 0x1) = ? +$(OPT)$(S) $(XX) -- getdents(4, 0x123000, 0x1) = 22 $(S) $(XX) -- getdents64(4, 0x123000, 0x1) = ? $(S) $(XX) -- getdents64(4, 0x123000, 0x1) = 22 $(S) $(XX) -- getcwd($(XX), 0x9) = ? @@ -336,20 +336,20 @@ $(S) $(XX) -- renameat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 7, "other_input $(S) $(XX) -- renameat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 7, "other_input_data\x01\x02\x03\n\r\t") = 22 $(S) $(XX) -- renameat(9, "input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t") = ? $(S) $(XX) -- renameat(9, "input_data\x01\x02\x03\n\r\t", AT_FDCWD, "other_input_data\x01\x02\x03\n\r\t") = 22 -$(S) $(XX) -- mkdir("input_data\x01\x02\x03\n\r\t", 0644) = ? -$(S) $(XX) -- mkdir("input_data\x01\x02\x03\n\r\t", 0644) = 22 +$(OPT)$(S) $(XX) -- mkdir("input_data\x01\x02\x03\n\r\t", 0644) = ? +$(OPT)$(S) $(XX) -- mkdir("input_data\x01\x02\x03\n\r\t", 0644) = 22 $(S) $(XX) -- mkdirat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0644) = ? $(S) $(XX) -- mkdirat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 0644) = 22 $(S) $(XX) -- mkdirat(33, "input_data\x01\x02\x03\n\r\t", 0644) = ? $(S) $(XX) -- mkdirat(33, "input_data\x01\x02\x03\n\r\t", 0644) = 22 $(S) $(XX) -- mkdirat(33, (null), 0555) = ? $(S) $(XX) -- mkdirat(33, (null), 0555) = 22 -$(S) $(XX) -- rmdir("input_data\x01\x02\x03\n\r\t") = ? -$(S) $(XX) -- rmdir("input_data\x01\x02\x03\n\r\t") = 22 -$(S) $(XX) -- rmdir((null)) = ? -$(S) $(XX) -- rmdir((null)) = 22 -$(S) $(XX) -- creat("input_data\x01\x02\x03\n\r\t", 0644) = ? -$(S) $(XX) -- creat("input_data\x01\x02\x03\n\r\t", 0644) = 22 +$(OPT)$(S) $(XX) -- rmdir("input_data\x01\x02\x03\n\r\t") = ? +$(OPT)$(S) $(XX) -- rmdir("input_data\x01\x02\x03\n\r\t") = 22 +$(OPT)$(S) $(XX) -- rmdir((null)) = ? +$(OPT)$(S) $(XX) -- rmdir((null)) = 22 +$(OPT)$(S) $(XX) -- creat("input_data\x01\x02\x03\n\r\t", 0644) = ? +$(OPT)$(S) $(XX) -- creat("input_data\x01\x02\x03\n\r\t", 0644) = 22 $(S) $(XX) -- link("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t") = ? $(S) $(XX) -- link("input_data\x01\x02\x03\n\r\t", "other_input_data\x01\x02\x03\n\r\t") = 22 $(S) $(XX) -- linkat(1, "input_data\x01\x02\x03\n\r\t", 2, "other_input_data\x01\x02\x03\n\r\t", 0x0) = ? @@ -490,20 +490,20 @@ $(S) $(XX) -- rt_sigsuspend(0x123000, 0x3) = ? $(S) $(XX) -- rt_sigsuspend(0x123000, 0x3) = 22 $(S) $(XX) -- sigaltstack(0x123000, 0x234000) = ? $(S) $(XX) -- sigaltstack(0x123000, 0x234000) = 22 -$(S) $(XX) -- utime("input_data\x01\x02\x03\n\r\t", 0x123000) = ? -$(S) $(XX) -- utime("input_data\x01\x02\x03\n\r\t", 0x123000) = 22 -$(S) $(XX) -- utimes("input_data\x01\x02\x03\n\r\t", 0x123000) = ? -$(S) $(XX) -- utimes("input_data\x01\x02\x03\n\r\t", 0x123000) = 22 -$(S) $(XX) -- futimesat(4, "input_data\x01\x02\x03\n\r\t", 0x123000) = ? -$(S) $(XX) -- futimesat(4, "input_data\x01\x02\x03\n\r\t", 0x123000) = 22 -$(S) $(XX) -- mknod("input_data\x01\x02\x03\n\r\t", 0x1, 0x2) = ? -$(S) $(XX) -- mknod("input_data\x01\x02\x03\n\r\t", 0x1, 0x2) = 22 +$(S) $(XX) -- utimensat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", $(XX), $(XX)) = ? +$(S) $(XX) -- utimensat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", $(XX), $(XX)) = 22 +$(S) $(XX) -- utimensat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", $(XX), $(XX)) = ? +$(S) $(XX) -- utimensat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", $(XX), $(XX)) = 22 +$(S) $(XX) -- utimensat(4, "input_data\x01\x02\x03\n\r\t", $(XX), $(XX)) = ? +$(S) $(XX) -- utimensat(4, "input_data\x01\x02\x03\n\r\t", $(XX), $(XX)) = 22 +$(S) $(XX) -- mknodat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01, 0x2) = ? +$(S) $(XX) -- mknodat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01, 0x2) = 22 $(S) $(XX) -- mknodat(1, "input_data\x01\x02\x03\n\r\t", 01, 0x2) = ? $(S) $(XX) -- mknodat(1, "input_data\x01\x02\x03\n\r\t", 01, 0x2) = 22 $(S) $(XX) -- mknodat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01, 0x2) = ? $(S) $(XX) -- mknodat(AT_FDCWD, "input_data\x01\x02\x03\n\r\t", 01, 0x2) = 22 -$(S) $(XX) -- ustat(0x2, 0x123000) = ? -$(S) $(XX) -- ustat(0x2, 0x123000) = 22 +$(OPT)$(S) $(XX) -- ustat(0x2, 0x123000) = ? +$(OPT)$(S) $(XX) -- ustat(0x2, 0x123000) = 22 $(S) $(XX) -- statfs("input_data\x01\x02\x03\n\r\t", 0x123000) = ? $(S) $(XX) -- statfs("input_data\x01\x02\x03\n\r\t", 0x123000) = 22 $(S) $(XX) -- fstatfs(4, 0x123000) = ? @@ -532,16 +532,16 @@ $(S) $(XX) -- sched_getaffinity(0x4d, 0x4, 0x123000) = ? $(S) $(XX) -- sched_getaffinity(0x4d, 0x4, 0x123000) = 22 $(S) $(XX) -- vhangup() = ? $(S) $(XX) -- vhangup() = 22 -$(S) $(XX) -- modify_ldt(0x1, 0x123000, 0x1) = ? -$(S) $(XX) -- modify_ldt(0x1, 0x123000, 0x1) = 22 +$(OPT)$(S) $(XX) -- modify_ldt(0x1, 0x123000, 0x1) = ? +$(OPT)$(S) $(XX) -- modify_ldt(0x1, 0x123000, 0x1) = 22 $(S) $(XX) -- pivot_root("input_data\x01\x02\x03\n\r\t", $(XX)) = ? $(S) $(XX) -- pivot_root("input_data\x01\x02\x03\n\r\t", $(XX)) = 22 -$(S) $(XX) -- _sysctl(0x123000) = ? -$(S) $(XX) -- _sysctl(0x123000) = 22 +$(OPT)$(S) $(XX) -- _sysctl(0x123000) = ? +$(OPT)$(S) $(XX) -- _sysctl(0x123000) = 22 $(S) $(XX) -- prctl(0x18, 0x1, 0x2, 0x3, 0x4) = ? $(S) $(XX) -- prctl(0x18, 0x1, 0x2, 0x3, 0x4) = 22 -$(S) $(XX) -- arch_prctl(0x1002, 0x123000, $(XX)) = ? -$(S) $(XX) -- arch_prctl(0x1002, 0x123000, $(XX)) = 22 +$(OPT)$(S) $(XX) -- arch_prctl(0x1002, 0x123000, $(XX)) = ? +$(OPT)$(S) $(XX) -- arch_prctl(0x1002, 0x123000, $(XX)) = 22 $(S) $(XX) -- clock_adjtime(0x0, 0x123000) = ? $(S) $(XX) -- clock_adjtime(0x0, 0x123000) = 22 $(S) $(XX) -- chroot("input_data\x01\x02\x03\n\r\t") = ? @@ -566,10 +566,10 @@ $(S) $(XX) -- sethostname($(XX), 0x10) = ? $(S) $(XX) -- sethostname($(XX), 0x10) = 22 $(S) $(XX) -- setdomainname($(XX), 0x10) = ? $(S) $(XX) -- setdomainname($(XX), 0x10) = 22 -$(S) $(XX) -- iopl(0x1) = ? -$(S) $(XX) -- iopl(0x1) = 22 -$(S) $(XX) -- ioperm(0x3, 0x4, 0x1) = ? -$(S) $(XX) -- ioperm(0x3, 0x4, 0x1) = 22 +$(OPT)$(S) $(XX) -- iopl(0x1) = ? +$(OPT)$(S) $(XX) -- iopl(0x1) = 22 +$(OPT)$(S) $(XX) -- ioperm(0x3, 0x4, 0x1) = ? +$(OPT)$(S) $(XX) -- ioperm(0x3, 0x4, 0x1) = 22 $(S) $(XX) -- syscall(175, $(XX), $(XX), $(XX), $(XX), $(XX), $(XX)) = ? $(S) $(XX) -- syscall(175, $(XX), $(XX), $(XX), $(XX), $(XX), $(XX)) = 22 $(S) $(XX) -- finit_module(3, 0x123000, 0x0) = ? @@ -620,14 +620,14 @@ $(S) $(XX) -- tkill(0x2c, 0x13) = ? $(S) $(XX) -- tkill(0x2c, 0x13) = 22 $(S) $(XX) -- tgkill(0x2c, 0x37, 0x13) = ? $(S) $(XX) -- tgkill(0x2c, 0x37, 0x13) = 22 -$(S) $(XX) -- time(0x123000) = ? -$(S) $(XX) -- time(0x123000) = 22 +$(OPT)$(S) $(XX) -- time(0x123000) = ? +$(OPT)$(S) $(XX) -- time(0x123000) = 22 $(S) $(XX) -- futex(0x123000, 0x1, 0x7, 0x123000, 0x234000, 0x1) = ? $(S) $(XX) -- futex(0x123000, 0x1, 0x7, 0x123000, 0x234000, 0x1) = 22 -$(S) $(XX) -- set_thread_area(0x123000) = ? -$(S) $(XX) -- set_thread_area(0x123000) = 22 -$(S) $(XX) -- get_thread_area(0x123000) = ? -$(S) $(XX) -- get_thread_area(0x123000) = 22 +$(OPT)$(S) $(XX) -- set_thread_area(0x123000) = ? +$(OPT)$(S) $(XX) -- set_thread_area(0x123000) = 22 +$(OPT)$(S) $(XX) -- get_thread_area(0x123000) = ? +$(OPT)$(S) $(XX) -- get_thread_area(0x123000) = 22 $(S) $(XX) -- io_setup(0x1, 0x123000) = ? $(S) $(XX) -- io_setup(0x1, 0x123000) = 22 $(S) $(XX) -- io_destroy(0x4d) = ? @@ -646,8 +646,8 @@ $(S) $(XX) -- epoll_create1(0x0) = ? $(S) $(XX) -- epoll_create1(0x0) = 22 $(S) $(XX) -- epoll_create1(0x80000) = ? $(S) $(XX) -- epoll_create1(0x80000) = 22 -$(S) $(XX) -- epoll_wait(2, 0x123000, 0x4, 0x5) = ? -$(S) $(XX) -- epoll_wait(2, 0x123000, 0x4, 0x5) = 22 +$(OPT)$(S) $(XX) -- epoll_wait(2, 0x123000, 0x4, 0x5) = ? +$(OPT)$(S) $(XX) -- epoll_wait(2, 0x123000, 0x4, 0x5) = 22 $(S) $(XX) -- epoll_pwait(2, 0x123000, 0x4, 0x5, 0x234000, 0x6) = ? $(S) $(XX) -- epoll_pwait(2, 0x123000, 0x4, 0x5, 0x234000, 0x6) = 22 $(S) $(XX) -- epoll_ctl(2, 0x3, 4, 0x123000) = ? @@ -724,8 +724,8 @@ $(S) $(XX) -- migrate_pages(0x1, 0x2, 0x123000, 0x234000) = ? $(S) $(XX) -- migrate_pages(0x1, 0x2, 0x123000, 0x234000) = 22 $(S) $(XX) -- unshare(0x20400) = ? $(S) $(XX) -- unshare(0x20400) = 22 -$(S) $(XX) -- set_robust_list(0x123000, 0x21) = ? -$(S) $(XX) -- set_robust_list(0x123000, 0x21) = 22 +$(S) $(XX) -- set_robust_list(0x123000, 33) = ? +$(S) $(XX) -- set_robust_list(0x123000, 33) = 22 $(S) $(XX) -- get_robust_list(0x2c, 0x123000, 0x234000) = ? $(S) $(XX) -- get_robust_list(0x2c, 0x123000, 0x234000) = 22 $(S) $(XX) -- splice(2, 0x123000, 3, 0x234000, 0x7b, 0x1) = ? @@ -744,8 +744,8 @@ $(S) $(XX) -- sync_file_range(2, 0x3, 0x4, 0x0) = ? $(S) $(XX) -- sync_file_range(2, 0x3, 0x4, 0x0) = 22 $(S) $(XX) -- sync_file_range(2, 0x3, 0x4, 0x1) = ? $(S) $(XX) -- sync_file_range(2, 0x3, 0x4, 0x1) = 22 -$(S) $(XX) -- signalfd(1, 0x123000, 0xc) = ? -$(S) $(XX) -- signalfd(1, 0x123000, 0xc) = 22 +$(OPT)$(S) $(XX) -- signalfd(1, 0x123000, 0xc) = ? +$(OPT)$(S) $(XX) -- signalfd(1, 0x123000, 0xc) = 22 $(S) $(XX) -- signalfd4(1, 0x123000, 0xd, 0x800, $(XX)) = ? $(S) $(XX) -- signalfd4(1, 0x123000, 0xd, 0x800, $(XX)) = 22 $(S) $(XX) -- timerfd_create(0x0, 0x80000) = ? @@ -754,8 +754,8 @@ $(S) $(XX) -- timerfd_settime(1, 0x1, 0x123000, 0x234000) = ? $(S) $(XX) -- timerfd_settime(1, 0x1, 0x123000, 0x234000) = 22 $(S) $(XX) -- timerfd_gettime(2, 0x123000) = ? $(S) $(XX) -- timerfd_gettime(2, 0x123000) = 22 -$(S) $(XX) -- eventfd(0x2d) = ? -$(S) $(XX) -- eventfd(0x2d) = 22 +$(OPT)$(S) $(XX) -- eventfd(0x2d) = ? +$(OPT)$(S) $(XX) -- eventfd(0x2d) = 22 $(S) $(XX) -- eventfd2(0x2f, 0x1) = ? $(S) $(XX) -- eventfd2(0x2f, 0x1) = 22 $(S) $(XX) -- fallocate(1, 0x2, 0x3, 0x4) = ? diff --git a/test/riscv/src/write_test.c b/test/write_test.c similarity index 100% rename from test/riscv/src/write_test.c rename to test/write_test.c