From a5ab50536798b1aef26c7152d68ad24c75b7a438 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Tue, 2 Aug 2022 10:47:58 +0200 Subject: [PATCH] fix(driver/modern_bpf): fixed exit syscalls tests. Signed-off-by: Federico Di Pierro --- .../test_suites/syscall_exit_suite/chdir_x.cpp | 6 +++--- .../test_suites/syscall_exit_suite/chmod_x.cpp | 4 ++-- .../syscall_exit_suite/chroot_x.cpp | 6 +++--- .../test_suites/syscall_exit_suite/close_x.cpp | 4 ++-- .../syscall_exit_suite/copy_file_range_x.cpp | 10 +++++----- .../test_suites/syscall_exit_suite/creat_x.cpp | 10 +++++----- .../test_suites/syscall_exit_suite/dup2_x.cpp | 12 ++++++------ .../test_suites/syscall_exit_suite/dup3_x.cpp | 14 +++++++------- .../test_suites/syscall_exit_suite/dup_x.cpp | 8 ++++---- .../syscall_exit_suite/fchdir_x.cpp | 4 ++-- .../syscall_exit_suite/fchmod_x.cpp | 10 +++++----- .../syscall_exit_suite/fchmodat_x.cpp | 10 +++++----- .../test_suites/syscall_exit_suite/mkdir_x.cpp | 4 ++-- .../syscall_exit_suite/mkdirat_x.cpp | 10 +++++----- .../syscall_exit_suite/open_by_handle_at_x.cpp | 8 ++++---- .../test_suites/syscall_exit_suite/open_x.cpp | 10 +++++----- .../syscall_exit_suite/openat2_x.cpp | 18 +++++++++--------- .../syscall_exit_suite/openat_x.cpp | 18 +++++++++--------- .../test_suites/syscall_exit_suite/rmdir_x.cpp | 6 +++--- 19 files changed, 86 insertions(+), 86 deletions(-) diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/chdir_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/chdir_x.cpp index f9ef4fa635..bfc24940d9 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/chdir_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/chdir_x.cpp @@ -17,7 +17,7 @@ TEST(SyscallExit, chdirX) const char* new_dir = "mock_dir"; assert_syscall_state(SYSCALL_FAILURE, "chdir", syscall(__NR_chdir, new_dir)); - int64_t errno_value = -errno; + int32_t errno_value = -errno; /*=============================== TRIGGER SYSCALL ===========================*/ @@ -36,8 +36,8 @@ TEST(SyscallExit, chdirX) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: res (type: PT_ERRNO)*/ - evt_test->assert_numeric_param(1, (int64_t)errno_value); + /* Parameter 1: res (type: PT_ERRNO32)*/ + evt_test->assert_numeric_param(1, errno_value); /* Parameter 2: path (type: PT_CHARBUF) */ evt_test->assert_charbuf_param(2, new_dir); diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/chmod_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/chmod_x.cpp index 7af713ab76..8f539a0573 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/chmod_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/chmod_x.cpp @@ -12,7 +12,7 @@ TEST(SyscallExit, chmodX) const char* filename = "*//null"; uint32_t mode = S_IXUSR; assert_syscall_state(SYSCALL_FAILURE, "chmod", syscall(__NR_chmod, filename, mode)); - int64_t errno_value = -errno; + int32_t errno_value = -errno; /*=============================== TRIGGER SYSCALL ===========================*/ @@ -31,7 +31,7 @@ TEST(SyscallExit, chmodX) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: res (type: PT_ERRNO) */ + /* Parameter 1: res (type: PT_ERRNO32) */ evt_test->assert_numeric_param(1, errno_value); /* Parameter 2: filename (type: PT_FSPATH) */ diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/chroot_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/chroot_x.cpp index ebb801990a..a752c60702 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/chroot_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/chroot_x.cpp @@ -12,7 +12,7 @@ TEST(SyscallExit, chrootX) const char* path = "*//null"; assert_syscall_state(SYSCALL_FAILURE, "chroot", syscall(__NR_chroot, path)); - int64_t errno_value = -errno; + int32_t errno_value = -errno; /*=============================== TRIGGER SYSCALL ===========================*/ @@ -31,8 +31,8 @@ TEST(SyscallExit, chrootX) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: res (type: PT_ERRNO)*/ - evt_test->assert_numeric_param(1, (int64_t)errno_value); + /* Parameter 1: res (type: PT_ERRNO32)*/ + evt_test->assert_numeric_param(1, errno_value); /* Parameter 2: path (type: PT_FSPATH) */ evt_test->assert_charbuf_param(2, path); diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/close_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/close_x.cpp index 097431e465..92737d7435 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/close_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/close_x.cpp @@ -11,7 +11,7 @@ TEST(SyscallExit, closeX) int invalid_fd = -1; assert_syscall_state(SYSCALL_FAILURE, "close", syscall(__NR_close, invalid_fd)); - int64_t errno_value = -errno; + int32_t errno_value = -errno; /*=============================== TRIGGER SYSCALL ===========================*/ @@ -30,7 +30,7 @@ TEST(SyscallExit, closeX) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: ret (type: PT_ERRNO)*/ + /* Parameter 1: ret (type: PT_ERRNO32)*/ evt_test->assert_numeric_param(1, errno_value); /*=============================== ASSERT PARAMETERS ===========================*/ diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/copy_file_range_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/copy_file_range_x.cpp index 1bfa06f547..08535c5cc5 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/copy_file_range_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/copy_file_range_x.cpp @@ -16,7 +16,7 @@ TEST(SyscallExit, copy_file_rangeX) size_t len = 20; uint32_t flags = 0; assert_syscall_state(SYSCALL_FAILURE, "copy_file_range", syscall(__NR_copy_file_range, fd_in, off_in, fd_out, off_out, len, flags)); - int64_t errno_value = -errno; + int32_t errno_value = -errno; /*=============================== TRIGGER SYSCALL ===========================*/ @@ -35,11 +35,11 @@ TEST(SyscallExit, copy_file_rangeX) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: res (type: PT_FD) */ - evt_test->assert_numeric_param(1, (int64_t)errno_value); + /* Parameter 1: res (type: PT_FD32) */ + evt_test->assert_numeric_param(1, errno_value); - /* Parameter 2: fdout (type: PT_FD) */ - evt_test->assert_numeric_param(2, (int64_t)fd_out); + /* Parameter 2: fdout (type: PT_FD32) */ + evt_test->assert_numeric_param(2, fd_out); /* Parameter 3: offout (type: PT_UINT64) */ evt_test->assert_numeric_param(3, (uint64_t)off_out); diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/creat_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/creat_x.cpp index 4f42d0e53e..7789ada1ac 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/creat_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/creat_x.cpp @@ -43,8 +43,8 @@ TEST(SyscallExit, creatX_success) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: fd (type: PT_FD) */ - evt_test->assert_numeric_param(1, (int64_t)fd); + /* Parameter 1: fd (type: PT_FD32) */ + evt_test->assert_numeric_param(1, fd); /* Parameter 2: name (type: PT_FSPATH) */ evt_test->assert_charbuf_param(2, path); @@ -75,7 +75,7 @@ TEST(SyscallExit, creatX_failure) const char* path = "*//null"; mode_t mode = S_IRGRP; assert_syscall_state(SYSCALL_FAILURE, "creat", syscall(__NR_creat, path, mode)); - int64_t errno_value = -errno; + int32_t errno_value = -errno; /*=============================== TRIGGER SYSCALL ===========================*/ @@ -94,8 +94,8 @@ TEST(SyscallExit, creatX_failure) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: fd (type: PT_FD) */ - evt_test->assert_numeric_param(1, (int64_t)errno_value); + /* Parameter 1: fd (type: PT_FD32) */ + evt_test->assert_numeric_param(1, errno_value); /* Parameter 2: name (type: PT_FSPATH) */ evt_test->assert_charbuf_param(2, path); diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/dup2_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/dup2_x.cpp index b4a7ba0ac7..4f5f50d037 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/dup2_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/dup2_x.cpp @@ -37,14 +37,14 @@ TEST(SyscallExit, dup2X) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: res (type: PT_FD) */ - evt_test->assert_numeric_param(1, (int64_t)res); + /* Parameter 1: res (type: PT_FD32) */ + evt_test->assert_numeric_param(1, res); - /* Parameter 2: oldfd (type: PT_FD) */ - evt_test->assert_numeric_param(2, (int64_t)old_fd); + /* Parameter 2: oldfd (type: PT_FD32) */ + evt_test->assert_numeric_param(2, old_fd); - /* Parameter 3: newfd (type: PT_FD) */ - evt_test->assert_numeric_param(3, (int64_t)new_fd); + /* Parameter 3: newfd (type: PT_FD32) */ + evt_test->assert_numeric_param(3, new_fd); /*=============================== ASSERT PARAMETERS ===========================*/ diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/dup3_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/dup3_x.cpp index 55dc78cdab..d399538a6c 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/dup3_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/dup3_x.cpp @@ -17,7 +17,7 @@ TEST(SyscallExit, dup3X) uint32_t flags = O_CLOEXEC; int32_t res = syscall(__NR_dup3, old_fd, new_fd, flags); assert_syscall_state(SYSCALL_FAILURE, "dup3", res); - int64_t errno_value = -errno; + int32_t errno_value = -errno; syscall(__NR_close, old_fd); syscall(__NR_close, new_fd); @@ -40,14 +40,14 @@ TEST(SyscallExit, dup3X) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: res (type: PT_FD) */ - evt_test->assert_numeric_param(1, (int64_t)errno_value); + /* Parameter 1: res (type: PT_FD32) */ + evt_test->assert_numeric_param(1, errno_value); - /* Parameter 2: oldfd (type: PT_FD) */ - evt_test->assert_numeric_param(2, (int64_t)old_fd); + /* Parameter 2: oldfd (type: PT_FD32) */ + evt_test->assert_numeric_param(2, old_fd); - /* Parameter 3: newfd (type: PT_FD) */ - evt_test->assert_numeric_param(3, (int64_t)new_fd); + /* Parameter 3: newfd (type: PT_FD32) */ + evt_test->assert_numeric_param(3, new_fd); /* Parameter 4: flags (type: PT_FLAGS32) */ evt_test->assert_numeric_param(4, (uint32_t)PPM_O_CLOEXEC); diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/dup_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/dup_x.cpp index 6c78c01679..9e34782889 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/dup_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/dup_x.cpp @@ -35,11 +35,11 @@ TEST(SyscallExit, dupX) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: res (type: PT_FD) */ - evt_test->assert_numeric_param(1, (int64_t)new_fd); + /* Parameter 1: res (type: PT_FD32) */ + evt_test->assert_numeric_param(1, new_fd); - /* Parameter 2: oldfd (type: PT_FD) */ - evt_test->assert_numeric_param(2, (int64_t)old_fd); + /* Parameter 2: oldfd (type: PT_FD32) */ + evt_test->assert_numeric_param(2, old_fd); /*=============================== ASSERT PARAMETERS ===========================*/ diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/fchdir_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/fchdir_x.cpp index bcc4e45c4b..20fdc546c7 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/fchdir_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/fchdir_x.cpp @@ -11,7 +11,7 @@ TEST(SyscallExit, fchdirX) int invalid_fd = -1; assert_syscall_state(SYSCALL_FAILURE, "fchdir", syscall(__NR_fchdir, invalid_fd)); - int64_t errno_value = -errno; + int32_t errno_value = -errno; /*=============================== TRIGGER SYSCALL ===========================*/ @@ -30,7 +30,7 @@ TEST(SyscallExit, fchdirX) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: res (type: PT_ERRNO)*/ + /* Parameter 1: res (type: PT_ERRNO32)*/ evt_test->assert_numeric_param(1, errno_value); /*=============================== ASSERT PARAMETERS ===========================*/ diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/fchmod_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/fchmod_x.cpp index 34c095cfaf..ce27ddecde 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/fchmod_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/fchmod_x.cpp @@ -12,7 +12,7 @@ TEST(SyscallExit, fchmodX) int32_t mock_fd = -1; uint32_t mode = S_IXUSR; assert_syscall_state(SYSCALL_FAILURE, "fchmod", syscall(__NR_fchmod, mock_fd, mode)); - int64_t errno_value = -errno; + int32_t errno_value = -errno; /*=============================== TRIGGER SYSCALL ===========================*/ @@ -31,11 +31,11 @@ TEST(SyscallExit, fchmodX) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: res (type: PT_ERRNO) */ - evt_test->assert_numeric_param(1, (int64_t)errno_value); + /* Parameter 1: res (type: PT_ERRNO32) */ + evt_test->assert_numeric_param(1, errno_value); - /* Parameter 2: fd (type: PT_FD) */ - evt_test->assert_numeric_param(2, (int64_t)mock_fd); + /* Parameter 2: fd (type: PT_FD32) */ + evt_test->assert_numeric_param(2, mock_fd); /* Parameter 3: mode (type: PT_MODE) */ evt_test->assert_numeric_param(3, (uint32_t)PPM_S_IXUSR); diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/fchmodat_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/fchmodat_x.cpp index 808a7707c5..1771f1f92a 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/fchmodat_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/fchmodat_x.cpp @@ -14,7 +14,7 @@ TEST(SyscallExit, fchmodatX) uint32_t mode = S_IXUSR; uint32_t flags = 0; assert_syscall_state(SYSCALL_FAILURE, "fchmodat", syscall(__NR_fchmodat, mock_dirfd, pathname, mode, flags)); - int64_t errno_value = -errno; + int32_t errno_value = -errno; /*=============================== TRIGGER SYSCALL ===========================*/ @@ -33,11 +33,11 @@ TEST(SyscallExit, fchmodatX) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: res (type: PT_ERRNO) */ - evt_test->assert_numeric_param(1, (int64_t)errno_value); + /* Parameter 1: res (type: PT_ERRNO32) */ + evt_test->assert_numeric_param(1, errno_value); - /* Parameter 2: dirfd (type: PT_FD) */ - evt_test->assert_numeric_param(2, (int64_t)mock_dirfd); + /* Parameter 2: dirfd (type: PT_FD32) */ + evt_test->assert_numeric_param(2, mock_dirfd); /* Parameter 3: filename (type: PT_FSPATH) */ evt_test->assert_charbuf_param(3, pathname); diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/mkdir_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/mkdir_x.cpp index d956be067e..ff038d53d9 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/mkdir_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/mkdir_x.cpp @@ -12,7 +12,7 @@ TEST(SyscallExit, mkdirX) uint32_t mode = 7; const char* path = "*//null"; assert_syscall_state(SYSCALL_FAILURE, "mkdir", syscall(__NR_mkdir, path, mode)); - int64_t errno_value = -errno; + int32_t errno_value = -errno; /*=============================== TRIGGER SYSCALL ===========================*/ @@ -31,7 +31,7 @@ TEST(SyscallExit, mkdirX) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: res (type: PT_ERRNO)*/ + /* Parameter 1: res (type: PT_ERRNO32)*/ evt_test->assert_numeric_param(1, errno_value); /* Parameter 2: path (type: PT_FSPATH) */ diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/mkdirat_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/mkdirat_x.cpp index 1745af52b9..699dea7fb0 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/mkdirat_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/mkdirat_x.cpp @@ -13,7 +13,7 @@ TEST(SyscallExit, mkdiratX) const char* path = "/invalid/path"; uint32_t mode = 8; assert_syscall_state(SYSCALL_FAILURE, "mkdirat", syscall(__NR_mkdirat, mock_dirfd, path, mode)); - int64_t errno_value = -errno; + int32_t errno_value = -errno; /*=============================== TRIGGER SYSCALL ===========================*/ @@ -32,11 +32,11 @@ TEST(SyscallExit, mkdiratX) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: res (type: PT_ERRNO) */ - evt_test->assert_numeric_param(1, (int64_t)errno_value); + /* Parameter 1: res (type: PT_ERRNO32) */ + evt_test->assert_numeric_param(1, errno_value); - /* Parameter 2: dirfd (type: PT_FD) */ - evt_test->assert_numeric_param(2, (int64_t)mock_dirfd); + /* Parameter 2: dirfd (type: PT_FD32) */ + evt_test->assert_numeric_param(2, mock_dirfd); /* Parameter 3: path (type: PT_FSRELPATH) */ evt_test->assert_charbuf_param(3, path); diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/open_by_handle_at_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/open_by_handle_at_x.cpp index f91308e495..8857f6a3e8 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/open_by_handle_at_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/open_by_handle_at_x.cpp @@ -143,11 +143,11 @@ TEST(SyscallExit, open_by_handle_atX_success) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: ret (type: PT_FD) */ - evt_test->assert_numeric_param(1, (int64_t)open_by_handle_fd); + /* Parameter 1: ret (type: PT_FD32) */ + evt_test->assert_numeric_param(1, open_by_handle_fd); - /* Parameter 2: mountfd (type: PT_FD) */ - evt_test->assert_numeric_param(2, (int64_t)dirfd); + /* Parameter 2: mountfd (type: PT_FD32) */ + evt_test->assert_numeric_param(2, dirfd); /* Parameter 3: flags (type: PT_FLAGS32) */ evt_test->assert_numeric_param(3, (uint32_t)PPM_O_RDONLY); diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/open_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/open_x.cpp index 1171fd839e..88b1a04d63 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/open_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/open_x.cpp @@ -45,8 +45,8 @@ TEST(SyscallExit, openX_success) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: ret (type: PT_FD)*/ - evt_test->assert_numeric_param(1, (int64_t)fd); + /* Parameter 1: ret (type: PT_FD32)*/ + evt_test->assert_numeric_param(1, fd); /* Parameter 2: name (type: PT_FSPATH) */ evt_test->assert_charbuf_param(2, pathname); @@ -85,7 +85,7 @@ TEST(SyscallExit, openX_failure) int flags = O_RDWR | O_TMPFILE | O_DIRECTORY; mode_t mode = 0; assert_syscall_state(SYSCALL_FAILURE, "open", syscall(__NR_open, pathname, flags, mode)); - int64_t errno_value = -errno; + int32_t errno_value = -errno; /*=============================== TRIGGER SYSCALL ===========================*/ @@ -104,8 +104,8 @@ TEST(SyscallExit, openX_failure) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: ret (type: PT_FD)*/ - evt_test->assert_numeric_param(1, (int64_t)errno_value); + /* Parameter 1: ret (type: PT_FD32)*/ + evt_test->assert_numeric_param(1, errno_value); /* Parameter 2: name (type: PT_FSPATH) */ evt_test->assert_charbuf_param(2, pathname); diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/openat2_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/openat2_x.cpp index 425c0c099c..2d14e7cde5 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/openat2_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/openat2_x.cpp @@ -42,11 +42,11 @@ TEST(SyscallExit, openat2X_success) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: fd (type: PT_FD) */ - evt_test->assert_numeric_param(1, (int64_t)fd); + /* Parameter 1: fd (type: PT_FD32) */ + evt_test->assert_numeric_param(1, fd); - /* Parameter 2: dirfd (type: PT_FD) */ - evt_test->assert_numeric_param(2, (int64_t)PPM_AT_FDCWD); + /* Parameter 2: dirfd (type: PT_FD32) */ + evt_test->assert_numeric_param(2, PPM_AT_FDCWD); /* Parameter 3: name (type: PT_FSPATH) */ evt_test->assert_charbuf_param(3, pathname); @@ -85,7 +85,7 @@ TEST(SyscallExit, openat2X_failure) how.mode = 0; how.resolve = RESOLVE_BENEATH | RESOLVE_NO_MAGICLINKS; assert_syscall_state(SYSCALL_FAILURE, "openat2", syscall(__NR_openat2, dirfd, pathname, &how, sizeof(struct open_how))); - int64_t errno_value = -errno; + int32_t errno_value = -errno; /*=============================== TRIGGER SYSCALL ===========================*/ @@ -104,11 +104,11 @@ TEST(SyscallExit, openat2X_failure) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: fd (type: PT_FD) */ - evt_test->assert_numeric_param(1, (int64_t)errno_value); + /* Parameter 1: fd (type: PT_FD32) */ + evt_test->assert_numeric_param(1, errno_value); - /* Parameter 2: dirfd (type: PT_FD) */ - evt_test->assert_numeric_param(2, (int64_t)PPM_AT_FDCWD); + /* Parameter 2: dirfd (type: PT_FD32) */ + evt_test->assert_numeric_param(2, PPM_AT_FDCWD); /* Parameter 3: name (type: PT_FSPATH) */ evt_test->assert_charbuf_param(3, pathname); diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/openat_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/openat_x.cpp index dd95e7e2f5..eb244b27a8 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/openat_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/openat_x.cpp @@ -46,11 +46,11 @@ TEST(SyscallExit, openatX_success) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: fd (type: PT_FD) */ - evt_test->assert_numeric_param(1, (int64_t)fd); + /* Parameter 1: fd (type: PT_FD32) */ + evt_test->assert_numeric_param(1, fd); - /* Parameter 2: dirfd (type: PT_FD) */ - evt_test->assert_numeric_param(2, (int64_t)PPM_AT_FDCWD); + /* Parameter 2: dirfd (type: PT_FD32) */ + evt_test->assert_numeric_param(2, PPM_AT_FDCWD); /* Parameter 3: name (type: PT_FSPATH) */ evt_test->assert_charbuf_param(3, pathname); @@ -90,7 +90,7 @@ TEST(SyscallExit, openatX_failure) int flags = O_RDWR | O_TMPFILE | O_DIRECTORY; mode_t mode = 0; assert_syscall_state(SYSCALL_FAILURE, "openat", syscall(__NR_openat, dirfd, pathname, flags, mode)); - int64_t errno_value = -errno; + int32_t errno_value = -errno; /*=============================== TRIGGER SYSCALL ===========================*/ @@ -109,11 +109,11 @@ TEST(SyscallExit, openatX_failure) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: fd (type: PT_FD) */ - evt_test->assert_numeric_param(1, (int64_t)errno_value); + /* Parameter 1: fd (type: PT_FD32) */ + evt_test->assert_numeric_param(1, errno_value); - /* Parameter 2: dirfd (type: PT_FD) */ - evt_test->assert_numeric_param(2, (int64_t)PPM_AT_FDCWD); + /* Parameter 2: dirfd (type: PT_FD32) */ + evt_test->assert_numeric_param(2, PPM_AT_FDCWD); /* Parameter 3: name (type: PT_FSPATH) */ evt_test->assert_charbuf_param(3, pathname); diff --git a/test/modern_bpf/test_suites/syscall_exit_suite/rmdir_x.cpp b/test/modern_bpf/test_suites/syscall_exit_suite/rmdir_x.cpp index fa3088024e..73cd7d9af7 100644 --- a/test/modern_bpf/test_suites/syscall_exit_suite/rmdir_x.cpp +++ b/test/modern_bpf/test_suites/syscall_exit_suite/rmdir_x.cpp @@ -11,7 +11,7 @@ TEST(SyscallExit, rmdirX) const char* path = "*//null"; assert_syscall_state(SYSCALL_FAILURE, "rmdir", syscall(__NR_rmdir, path)); - int64_t errno_value = -errno; + int32_t errno_value = -errno; /*=============================== TRIGGER SYSCALL ===========================*/ @@ -30,8 +30,8 @@ TEST(SyscallExit, rmdirX) /*=============================== ASSERT PARAMETERS ===========================*/ - /* Parameter 1: res (type: PT_ERRNO)*/ - evt_test->assert_numeric_param(1, (int64_t)errno_value); + /* Parameter 1: res (type: PT_ERRNO32)*/ + evt_test->assert_numeric_param(1, errno_value); /* Parameter 2: path (type: PT_FSPATH) */ evt_test->assert_charbuf_param(2, path);