diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index a426b7c7e6b5..b140bc5bcfd9 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -188,6 +188,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_gic_set_affinity); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_dc_send_copy); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_dc_receive); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_bpf_syscall); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_nanosleep_syscall); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rproc_recovery); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rproc_recovery_set); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_timer_calc_index); diff --git a/include/trace/hooks/syscall_check.h b/include/trace/hooks/syscall_check.h index 56d8267297ca..4710700b0108 100644 --- a/include/trace/hooks/syscall_check.h +++ b/include/trace/hooks/syscall_check.h @@ -12,6 +12,8 @@ */ struct file; union bpf_attr; +struct timespec64; + DECLARE_HOOK(android_vh_check_mmap_file, TP_PROTO(const struct file *file, unsigned long prot, unsigned long flag, unsigned long ret), @@ -25,6 +27,10 @@ DECLARE_HOOK(android_vh_check_bpf_syscall, TP_PROTO(int cmd, const union bpf_attr *attr, unsigned int size), TP_ARGS(cmd, attr, size)); +DECLARE_HOOK(android_vh_check_nanosleep_syscall, + TP_PROTO(struct timespec64 *tu), + TP_ARGS(tu)); + #endif /* _TRACE_HOOK_SYSCALL_CHECK_H */ /* This part must be outside protection */ #include diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 8890c8313f68..8f1ccc0f0a1e 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -46,6 +46,7 @@ #include #include +#include #include "tick-internal.h" @@ -2173,6 +2174,7 @@ SYSCALL_DEFINE2(nanosleep, struct __kernel_timespec __user *, rqtp, if (!timespec64_valid(&tu)) return -EINVAL; + trace_android_vh_check_nanosleep_syscall(&tu); current->restart_block.fn = do_no_restart_syscall; current->restart_block.nanosleep.type = rmtp ? TT_NATIVE : TT_NONE; current->restart_block.nanosleep.rmtp = rmtp; @@ -2195,6 +2197,7 @@ SYSCALL_DEFINE2(nanosleep_time32, struct old_timespec32 __user *, rqtp, if (!timespec64_valid(&tu)) return -EINVAL; + trace_android_vh_check_nanosleep_syscall(&tu); current->restart_block.fn = do_no_restart_syscall; current->restart_block.nanosleep.type = rmtp ? TT_COMPAT : TT_NONE; current->restart_block.nanosleep.compat_rmtp = rmtp;