Fix: kernel/ptrace.c: ptrace_peek_siginfo() missing __put_user() validation
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 28 Jun 2013 13:49:46 +0000 (09:49 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 29 Jun 2013 18:29:08 +0000 (11:29 -0700)
commit706b23bde27a391f0974df2a8351661770fa2e07
tree2b8d6be33dda49dcfc9ed8a5a688db4e8f56ac4c
parentbd2931b5cff6a3bf39bfe15fae051fb8229c0029
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 <mathieu.desnoyers@efficios.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Andrey Vagin <avagin@openvz.org>
Cc: Roland McGrath <roland@redhat.com>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Dave Jones <davej@redhat.com>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Pedro Alves <palves@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/ptrace.c