Skip to content

Commit

Permalink
fix: indentation issues
Browse files Browse the repository at this point in the history
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
  • Loading branch information
mrgian committed Jan 19, 2024
1 parent 75c2615 commit e3923d9
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int BPF_PROG(newfstatat_x,
unsigned long path_pointer = extract__syscall_argument(regs, 1);
auxmap__store_charbuf_param(auxmap, path_pointer, MAX_PATH, USER);

/* Parameter 4: path (type: PT_BYTEBUF) */
/* Parameter 4: path (type: PT_BYTEBUF) */
/*unsigned long buf_pointer = extract__syscall_argument(regs, 2);
auxmap__store_charbuf_param(auxmap, buf_pointer);*/

Expand Down
164 changes: 82 additions & 82 deletions driver/ppm_fillers.c
Original file line number Diff line number Diff line change
Expand Up @@ -8011,105 +8011,105 @@ int f_sys_finit_module_x(struct event_filler_arguments *args)

int f_sys_mknod_x(struct event_filler_arguments *args)
{
unsigned long val;
int res;
long retval;
unsigned long val;
int res;
long retval;

/* Parameter 1: ret (type: PT_ERRNO) */
retval = (int64_t) syscall_get_return_value(current,args->regs);
res = val_to_ring(args, retval, 0, false, 0);
CHECK_RES(res);
/* Parameter 1: ret (type: PT_ERRNO) */
retval = (int64_t) syscall_get_return_value(current,args->regs);
res = val_to_ring(args, retval, 0, false, 0);
CHECK_RES(res);

/* Parameter 2: path (type: PT_CHARBUF) */
syscall_get_arguments_deprecated(args, 0, 1, &val);
res = val_to_ring(args, val, 0, true, 0);
CHECK_RES(res);
/* Parameter 2: path (type: PT_CHARBUF) */
syscall_get_arguments_deprecated(args, 0, 1, &val);
res = val_to_ring(args, val, 0, true, 0);
CHECK_RES(res);

/* Parameter 3: mode (type: PT_MODE) */
syscall_get_arguments_deprecated(args, 1, 1, &val);
res = val_to_ring(args, mknod_mode_to_scap(val), 0, false, 0);
CHECK_RES(res);
/* Parameter 3: mode (type: PT_MODE) */
syscall_get_arguments_deprecated(args, 1, 1, &val);
res = val_to_ring(args, mknod_mode_to_scap(val), 0, false, 0);
CHECK_RES(res);

/* Parameter 4: dev (type: PT_UINT32) */
syscall_get_arguments_deprecated(args, 2, 1, &val);
res = val_to_ring(args, new_encode_dev(val), 0, false, 0);
CHECK_RES(res);
/* Parameter 4: dev (type: PT_UINT32) */
syscall_get_arguments_deprecated(args, 2, 1, &val);
res = val_to_ring(args, new_encode_dev(val), 0, false, 0);
CHECK_RES(res);

return add_sentinel(args);
return add_sentinel(args);
}

int f_sys_mknodat_x(struct event_filler_arguments *args)
{
unsigned long val;
int res;
int32_t fd;
long retval;
unsigned long val;
int res;
int32_t fd;
long retval;

/* Parameter 1: ret (type: PT_ERRNO) */
retval = (int64_t) syscall_get_return_value(current,args->regs);
res = val_to_ring(args, retval, 0, false, 0);
CHECK_RES(res);
/* Parameter 1: ret (type: PT_ERRNO) */
retval = (int64_t) syscall_get_return_value(current,args->regs);
res = val_to_ring(args, retval, 0, false, 0);
CHECK_RES(res);

/* Parameter 2: dirfd (type: PT_FD) */
syscall_get_arguments_deprecated(args, 0, 1, &val);
fd = (int32_t)val;
if (fd == AT_FDCWD)
fd = PPM_AT_FDCWD;
res = val_to_ring(args, (int64_t)fd, 0, true, 0);
CHECK_RES(res);
/* Parameter 2: dirfd (type: PT_FD) */
syscall_get_arguments_deprecated(args, 0, 1, &val);
fd = (int32_t)val;
if (fd == AT_FDCWD)
fd = PPM_AT_FDCWD;
res = val_to_ring(args, (int64_t)fd, 0, true, 0);
CHECK_RES(res);

/* Parameter 2: path (type: PT_CHARBUF) */
syscall_get_arguments_deprecated(args, 1, 1, &val);
res = val_to_ring(args, val, 0, true, 0);
CHECK_RES(res);
/* Parameter 2: path (type: PT_CHARBUF) */
syscall_get_arguments_deprecated(args, 1, 1, &val);
res = val_to_ring(args, val, 0, true, 0);
CHECK_RES(res);

/* Parameter 3: mode (type: PT_MODE) */
syscall_get_arguments_deprecated(args, 2, 1, &val);
res = val_to_ring(args, mknod_mode_to_scap(val), 0, false, 0);
CHECK_RES(res);
/* Parameter 3: mode (type: PT_MODE) */
syscall_get_arguments_deprecated(args, 2, 1, &val);
res = val_to_ring(args, mknod_mode_to_scap(val), 0, false, 0);
CHECK_RES(res);

/* Parameter 4: dev (type: PT_UINT32) */
syscall_get_arguments_deprecated(args, 3, 1, &val);
res = val_to_ring(args, new_encode_dev(val), 0, false, 0);
CHECK_RES(res);
/* Parameter 4: dev (type: PT_UINT32) */
syscall_get_arguments_deprecated(args, 3, 1, &val);
res = val_to_ring(args, new_encode_dev(val), 0, false, 0);
CHECK_RES(res);

return add_sentinel(args);
return add_sentinel(args);
}

int f_sys_newfstatat_x(struct event_filler_arguments *args)
{
unsigned long val;
int res;
int32_t fd;
long retval;

/* Parameter 1: ret (type: PT_ERRNO) */
retval = (int64_t) syscall_get_return_value(current,args->regs);
res = val_to_ring(args, retval, 0, false, 0);
CHECK_RES(res);

/* Parameter 2: dirfd (type: PT_FD) */
syscall_get_arguments_deprecated(args, 0, 1, &val);
fd = (int32_t)val;
if (fd == AT_FDCWD)
fd = PPM_AT_FDCWD;
res = val_to_ring(args, (int64_t)fd, 0, true, 0);
CHECK_RES(res);

/* Parameter 3: path (type: PT_RELPATH) */
syscall_get_arguments_deprecated(args, 1, 1, &val);
res = val_to_ring(args, val, 0, true, 0);
CHECK_RES(res);

/* Parameter 4: stat (type: PT_BYTEBUF) */
/*syscall_get_arguments_deprecated(args, 2, 1, &val);
res = val_to_ring(args, val, 0, true, 0);
CHECK_RES(res);*/

/* Parameter 5: flags (type: PT_FLAGS32) */
syscall_get_arguments_deprecated(args, 3, 1, &val);
res = val_to_ring(args, newfstatat_flags_to_scap(val), 0, true, 0);
CHECK_RES(res);

return add_sentinel(args);
unsigned long val;
int res;
int32_t fd;
long retval;

/* Parameter 1: ret (type: PT_ERRNO) */
retval = (int64_t) syscall_get_return_value(current,args->regs);
res = val_to_ring(args, retval, 0, false, 0);
CHECK_RES(res);

/* Parameter 2: dirfd (type: PT_FD) */
syscall_get_arguments_deprecated(args, 0, 1, &val);
fd = (int32_t)val;
if (fd == AT_FDCWD)
fd = PPM_AT_FDCWD;
res = val_to_ring(args, (int64_t)fd, 0, true, 0);
CHECK_RES(res);

/* Parameter 3: path (type: PT_RELPATH) */
syscall_get_arguments_deprecated(args, 1, 1, &val);
res = val_to_ring(args, val, 0, true, 0);
CHECK_RES(res);

/* Parameter 4: stat (type: PT_BYTEBUF) */
/*syscall_get_arguments_deprecated(args, 2, 1, &val);
res = val_to_ring(args, val, 0, true, 0);
CHECK_RES(res);*/

/* Parameter 5: flags (type: PT_FLAGS32) */
syscall_get_arguments_deprecated(args, 3, 1, &val);
res = val_to_ring(args, newfstatat_flags_to_scap(val), 0, true, 0);
CHECK_RES(res);

return add_sentinel(args);
}
6 changes: 3 additions & 3 deletions test/drivers/test_suites/syscall_enter_suite/newfstatat_e.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ TEST(SyscallEnter, newfstatatE)

/*=============================== TRIGGER SYSCALL ===========================*/

//int dirfd = AT_FDCWD;
int dirfd = -1;
//int dirfd = AT_FDCWD;
int dirfd = -1;
const char* pathname = "mock_path";
struct stat buffer;
struct stat buffer;
int flags = AT_EMPTY_PATH | AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW;

assert_syscall_state(SYSCALL_FAILURE, "newfstatat", syscall(__NR_newfstatat, dirfd, pathname, &buffer, flags));
Expand Down
10 changes: 5 additions & 5 deletions test/drivers/test_suites/syscall_exit_suite/newfstatat_x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ TEST(SyscallExit, newfstatatX_success)

/*=============================== TRIGGER SYSCALL ===========================*/

int dirfd = AT_FDCWD;
int dirfd = AT_FDCWD;
const char* pathname = ".";
struct stat buffer;
struct stat buffer;
int flags = AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW;

int32_t res = syscall(__NR_newfstatat, dirfd, pathname, &buffer, flags);
Expand Down Expand Up @@ -62,14 +62,14 @@ TEST(SyscallExit, newfstatatX_failure)

/*=============================== TRIGGER SYSCALL ===========================*/

int dirfd = AT_FDCWD;
int dirfd = AT_FDCWD;
const char* pathname = "mock_path";
struct stat buffer;
struct stat buffer;
int flags = AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW;

int32_t res = syscall(__NR_newfstatat, dirfd, pathname, &buffer, flags);
assert_syscall_state(SYSCALL_FAILURE, "newfstatat", res);
int64_t errno_value = -errno;
int64_t errno_value = -errno;

/*=============================== TRIGGER SYSCALL ===========================*/

Expand Down

0 comments on commit e3923d9

Please sign in to comment.