Re: [PATCH] ARM: Wire up HAVE_SYSCALL_TRACEPOINTS

From: Russell King - ARM Linux
Date: Wed Feb 01 2012 - 04:46:34 EST


On Thu, Dec 01, 2011 at 08:01:32PM +0900, takuo.koguchi.sw@xxxxxxxxxxx wrote:
> diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
> index 4a11237..f4eac2d 100644
> --- a/arch/arm/include/asm/unistd.h
> +++ b/arch/arm/include/asm/unistd.h
> @@ -405,6 +405,9 @@
> #define __NR_process_vm_readv (__NR_SYSCALL_BASE+376)
> #define __NR_process_vm_writev (__NR_SYSCALL_BASE+377)
>
> +#ifndef __ASSEMBLY__
> +#define NR_syscalls 378
> +#endif

So, we have 380 syscalls in the assembly code. You're telling ftrace
that we have 378. That's just great, because it means userspace can
trigger this trivially:

int reg_event_syscall_enter(struct ftrace_event_call *call)
{
int ret = 0;
int num;

num = ((struct syscall_metadata *)call->data)->syscall_nr;
if (WARN_ON_ONCE(num < 0 || num >= NR_syscalls))
return -ENOSYS;

And what about the ARM private syscalls?

This ftrace NR_syscalls definition would have to be some very large
number to avoid these issuing the above warning. ftrace really needs
to lose this before ARM can start using it.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/