lkml.org 
[lkml]   [2009]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[patch 06/53] prevent kprobes from catching spurious page faults
    2.6.28-stable review patch.  If anyone has any objections, please let us know.
    ------------------

    From: Masami Hiramatsu <mhiramat@redhat.com>

    commit 9be260a646bf76fa418ee519afa10196b3164681 upstream.

    Prevent kprobes from catching spurious faults which will cause infinite
    recursive page-fault and memory corruption by stack overflow.

    Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    arch/x86/mm/fault.c | 8 ++++++--
    1 file changed, 6 insertions(+), 2 deletions(-)

    --- a/arch/x86/mm/fault.c
    +++ b/arch/x86/mm/fault.c
    @@ -601,8 +601,6 @@ void __kprobes do_page_fault(struct pt_r

    si_code = SEGV_MAPERR;

    - if (notify_page_fault(regs))
    - return;
    if (unlikely(kmmio_fault(regs, address)))
    return;

    @@ -632,6 +630,9 @@ void __kprobes do_page_fault(struct pt_r
    if (spurious_fault(address, error_code))
    return;

    + /* kprobes don't want to hook the spurious faults. */
    + if (notify_page_fault(regs))
    + return;
    /*
    * Don't take the mm semaphore here. If we fixup a prefetch
    * fault we could otherwise deadlock.
    @@ -639,6 +640,9 @@ void __kprobes do_page_fault(struct pt_r
    goto bad_area_nosemaphore;
    }

    + /* kprobes don't want to hook the spurious faults. */
    + if (notify_page_fault(regs))
    + return;

    /*
    * It's safe to allow irq's after cr2 has been saved and the


    \
     
     \ /
      Last update: 2009-02-10 20:09    [W:4.098 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site