lkml.org 
[lkml]   [2010]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 20/40] trace syscalls: Considder compat_syscall_nr when verifying syscall_nr
    Date
    From: Ian Munsie <imunsie@au1.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@au1.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


    \
     
     \ /
      Last update: 2010-06-23 12:11    [W:0.023 / U:0.652 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site