• Jeff Dike's avatar
    [PATCH] uml: Fix setting of TIF_SIGPENDING · 754641c7
    Jeff Dike authored
    From: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
    
    My older patch, that sets TIF_SIGPENDING after an ptrace-interception
    in syscall_trace() is wrong.
    Some syscalls want to be called without any signal pending. If a signal
    is pending on syscall-entry, they immediately return with -ERESTARTNOINTR.
    Thus, on return to user, the pending signals can be processed and the
    kernel will lower eip by 2 to have the syscall restarted after that.
    Since my change sets TIF_SIGPENDING on the entry and exit interception,
    stracing such a syscall looped! Try "strace ls" to see what happens.
    Fix: set TIF_SIGPENDING on the exit interception only. This avoids the
    loop and is enough for security.
    Signed-off-by: default avatarBodo Stroesser <bstroesser@fujitsu-siemens.com>
    Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    754641c7
ptrace.c 8.24 KB