[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1277287401-28571-21-git-send-email-imunsie@au1.ibm.com>
Date: Wed, 23 Jun 2010 20:03:01 +1000
From: "Ian Munsie" <imunsie@....ibm.com>
To: linux-kernel@...r.kernel.org, linuxppc-dev@...abs.org
Cc: Jason Baron <jbaron@...hat.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <michael@...erman.id.au>,
Ian Munsie <imunsie@....ibm.com>,
Masami Hiramatsu <mhiramat@...hat.com>
Subject: [PATCH 20/40] trace syscalls: Considder compat_syscall_nr when verifying syscall_nr
From: Ian Munsie <imunsie@....ibm.com>
With the new compat syscall tracing, either syscall_nr or
compat_syscall_nr may be set, so test both before assuming that the
initialisation failed.
Signed-off-by: Ian Munsie <imunsie@....ibm.com>
---
kernel/trace/trace_syscalls.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index 9010405..264441e 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -441,10 +441,12 @@ void unreg_event_syscall_exit(struct ftrace_event_call *call)
int init_syscall_trace(struct ftrace_event_call *call)
{
int id;
- int num;
+ int num, compat_num;
num = ((struct syscall_metadata *)call->data)->syscall_nr;
- if (num < 0 || num >= NR_syscalls) {
+ compat_num = ((struct syscall_metadata *)call->data)->compat_syscall_nr;
+ if (( num < 0 || num >= NR_syscalls) &&
+ (compat_num < 0 || compat_num >= NR_syscalls)) {
pr_debug("syscall %s metadata not mapped, disabling ftrace event\n",
((struct syscall_metadata *)call->data)->name);
return -ENOSYS;
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists