Skip to content

Commit

Permalink
fix(kmod): use socketcall args in {get,set}sockopt_x
Browse files Browse the repository at this point in the history
Signed-off-by: Hendrik Brueckner <brueckner@de.ibm.com>
  • Loading branch information
hbrueckner authored and poiana committed Mar 8, 2023
1 parent dae0fd6 commit 1720439
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions driver/ppm_fillers.c
Original file line number Diff line number Diff line change
Expand Up @@ -2084,7 +2084,12 @@ int f_sys_setsockopt_x(struct event_filler_arguments *args)
CHECK_RES(res);

/* Get all the five arguments */
syscall_get_arguments_deprecated(current, args->regs, 0, 5, val);
if (!args->is_socketcall)
syscall_get_arguments_deprecated(current, args->regs, 0, 5, val);
#ifndef UDIG
else
memcpy(val, args->socketcall_args, 5*sizeof(syscall_arg_t));
#endif

/* Parameter 2: fd (type: PT_FD) */
fd = (s32)val[0];
Expand Down Expand Up @@ -2117,7 +2122,14 @@ int f_sys_getsockopt_x(struct event_filler_arguments *args)
uint32_t optlen = 0;
s32 fd = 0;
syscall_arg_t val[5] = {0};
syscall_get_arguments_deprecated(current, args->regs, 0, 5, val);

/* Get all the five arguments */
if (!args->is_socketcall)
syscall_get_arguments_deprecated(current, args->regs, 0, 5, val);
#ifndef UDIG
else
memcpy(val, args->socketcall_args, 5*sizeof(syscall_arg_t));
#endif

/* Parameter 1: res (type: PT_ERRNO) */
retval = (int64_t)(long)syscall_get_return_value(current, args->regs);
Expand Down

0 comments on commit 1720439

Please sign in to comment.