From f75983c2aa4bd35e97ef4d46bcec697e9b0dc9c1 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 30 Nov 2022 15:45:37 -0500 Subject: [PATCH] Explicitly skip tracing x32 system calls x86 x32 system calls are not supported by LTTng. They are currently not traced simply because their system call number is beyond the range of NR_compat_syscalls. However, this mostly happens by accident rather than by design. Enforce this with an explicit check for in_x32_syscall(), which clearly documents that those are not supported. Signed-off-by: Mathieu Desnoyers Change-Id: I3a6985a8355f14f4e557ee7f5edea36969dadfe9 --- lttng-syscalls.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lttng-syscalls.c b/lttng-syscalls.c index 4596ccfc..3399c9b0 100644 --- a/lttng-syscalls.c +++ b/lttng-syscalls.c @@ -392,6 +392,12 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id) const struct trace_syscall_entry *table, *entry; size_t table_len; +#ifdef CONFIG_X86_X32_ABI + if (in_x32_syscall()) { + /* x32 system calls are not supported. */ + return; + } +#endif if (unlikely(in_compat_syscall())) { struct lttng_syscall_filter *filter = chan->sc_filter; @@ -539,6 +545,12 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret) size_t table_len; long id; +#ifdef CONFIG_X86_X32_ABI + if (in_x32_syscall()) { + /* x32 system calls are not supported. */ + return; + } +#endif id = syscall_get_nr(current, regs); if (unlikely(in_compat_syscall())) { struct lttng_syscall_filter *filter = chan->sc_filter; -- 2.34.1