]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sparc64: perf: Add sanity checking on addresses in user stack
authorDavid Ahern <david.ahern@oracle.com>
Mon, 15 Jun 2015 20:15:45 +0000 (16:15 -0400)
committerAllen Pais <allen.pais@oracle.com>
Wed, 9 Sep 2015 19:00:10 +0000 (00:30 +0530)
commitd4998e31dc969b94f25e3c134130af5741d3af68
tree09fc9a3fdccb5402066d822097524e7672599651
parent61dafe8473fab84fcc415a730af1e0af9668d938
sparc64: perf: Add sanity checking on addresses in user stack

Processes are getting killed (sigbus or segv) while walking userspace
callchains when using perf. In some instances I have seen ufp = 0x7ff
which does not seem like a proper stack address.

This patch adds a function to run validity checks against the address
before attempting the copy_from_user. The checks are copied from the
x86 version as a start point with the addition of a 4-byte alignment
check.

Signed-off-by: David Ahern <david.ahern@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b69fb7699c92f85991672fc144b0adb7c717fbc8)
(cherry picked from commit 64ff44be3eb1044b7ce000dc409c785810f9d1f0)
arch/sparc/include/asm/uaccess_64.h
arch/sparc/kernel/perf_event.c