Fix: kernel/ptrace.c: ptrace_peek_siginfo() missing __put_user() validation

This __put_user() could be used by unprivileged processes to write into
kernel memory.  The issue here is that even if copy_siginfo_to_user()
fails, the error code is not checked before __put_user() is executed.

Luckily, ptrace_peek_siginfo() has been added within the 3.10-rc cycle,
so it has not hit a stable release yet.

Signed-off-by: Mathieu Desnoyers <>
Acked-by: Oleg Nesterov <>
Cc: Andrey Vagin <>
Cc: Roland McGrath <>
Cc: Paul McKenney <>
Cc: David Howells <>
Cc: Dave Jones <>
Cc: Pavel Emelyanov <>
Cc: Pedro Alves <>
Cc: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
1 file changed