From 3f4bbdb84fa5b864e3f688042810ccd718c7fa0a Mon Sep 17 00:00:00 2001 From: Andrea Terzolo Date: Wed, 8 Mar 2023 12:15:12 +0100 Subject: [PATCH] fix(driver): address some minor comments relative to https://github.com/falcosecurity/libs/pull/811 Signed-off-by: Andrea Terzolo --- driver/bpf/plumbing_helpers.h | 4 ++-- driver/modern_bpf/helpers/interfaces/syscalls_dispatcher.h | 2 +- driver/ppm_fillers.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/driver/bpf/plumbing_helpers.h b/driver/bpf/plumbing_helpers.h index 56ccee8bfe..65de081319 100644 --- a/driver/bpf/plumbing_helpers.h +++ b/driver/bpf/plumbing_helpers.h @@ -647,7 +647,7 @@ static __always_inline void call_filler(void *ctx, release_local_state(state); } -#if defined(CAPTURE_SOCKETCALL) && defined(BPF_SUPPORTS_RAW_TRACEPOINTS) +#if defined(CAPTURE_SOCKETCALL) && defined(BPF_SUPPORTS_RAW_TRACEPOINTS) static __always_inline long convert_network_syscalls(void *ctx) { int socketcall_id = (int)bpf_syscall_get_argument_from_ctx(ctx, 0); @@ -667,7 +667,7 @@ static __always_inline long convert_network_syscalls(void *ctx) case SYS_ACCEPT: #if defined(CONFIG_S390) && defined(__NR_accept4) return __NR_accept4; -#elif defined(__NR_ACCEPT) +#elif defined(__NR_accept) return __NR_accept; #endif break; diff --git a/driver/modern_bpf/helpers/interfaces/syscalls_dispatcher.h b/driver/modern_bpf/helpers/interfaces/syscalls_dispatcher.h index ea81f18985..53aca11c15 100644 --- a/driver/modern_bpf/helpers/interfaces/syscalls_dispatcher.h +++ b/driver/modern_bpf/helpers/interfaces/syscalls_dispatcher.h @@ -55,7 +55,7 @@ static __always_inline long convert_network_syscalls(struct pt_regs *regs) case SYS_ACCEPT: #if defined(__TARGET_ARCH_s390) && defined(__NR_accept4) return __NR_accept4; -#elif defined(__NR_ACCEPT) +#elif defined(__NR_accept) return __NR_accept; #endif break; diff --git a/driver/ppm_fillers.c b/driver/ppm_fillers.c index 6f236cd42b..6c491d8b5f 100644 --- a/driver/ppm_fillers.c +++ b/driver/ppm_fillers.c @@ -2088,7 +2088,7 @@ int f_sys_setsockopt_x(struct event_filler_arguments *args) syscall_get_arguments_deprecated(current, args->regs, 0, 5, val); #ifndef UDIG else - memcpy(val, args->socketcall_args, 5*sizeof(syscall_arg_t)); + memcpy(val, args->socketcall_args, 5*sizeof(unsigned long)); #endif /* Parameter 2: fd (type: PT_FD) */ @@ -2128,7 +2128,7 @@ int f_sys_getsockopt_x(struct event_filler_arguments *args) syscall_get_arguments_deprecated(current, args->regs, 0, 5, val); #ifndef UDIG else - memcpy(val, args->socketcall_args, 5*sizeof(syscall_arg_t)); + memcpy(val, args->socketcall_args, 5*sizeof(unsigned long)); #endif /* Parameter 1: res (type: PT_ERRNO) */