Skip to content

Commit

Permalink
cleanup(dup3): fix flags param
Browse files Browse the repository at this point in the history
Signed-off-by: Everett Badeaux <everettc1810@gmail.com>
  • Loading branch information
ecbadeaux committed Nov 22, 2023
1 parent 6f858e7 commit 0749ad0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions driver/bpf/fillers.h
Expand Up @@ -6258,7 +6258,6 @@ FILLER(sys_dup3_x, true)
unsigned long val;
unsigned long retval;
unsigned long res;
unsigned int scap_flags;

retval = bpf_syscall_get_retval(data->ctx);
res = bpf_push_s64_to_ring(data, retval);
Expand All @@ -6281,8 +6280,7 @@ FILLER(sys_dup3_x, true)
* flags
*/
int flags = bpf_syscall_get_argument(data, 2);
scap_flags = dup3_flags_to_scap(flags);
return bpf_push_u32_to_ring(data, scap_flags);
return bpf_push_u32_to_ring(data, dup3_flags_to_scap(flags));
}

FILLER(sys_umount_x, true)
Expand Down
6 changes: 2 additions & 4 deletions driver/ppm_fillers.c
Expand Up @@ -5695,8 +5695,6 @@ int f_sys_dup3_x(struct event_filler_arguments *args)
{
int res;
unsigned long val;
int flags;


int64_t retval = (int64_t)syscall_get_return_value(current, args->regs);
res = val_to_ring(args, retval, 0, false, 0);
Expand All @@ -5719,8 +5717,8 @@ int f_sys_dup3_x(struct event_filler_arguments *args)
/*
* flags
*/
syscall_get_arguments_deprecated(args, 2, 1, &flags);
res = val_to_ring(args, dup3_flags_to_scap(flags), 0, false, 0);
syscall_get_arguments_deprecated(args, 2, 1, &val);
res = val_to_ring(args, dup3_flags_to_scap((int) val), 0, false, 0);
CHECK_RES(res);

return add_sentinel(args);
Expand Down

0 comments on commit 0749ad0

Please sign in to comment.