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)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Jun 2015 13:01:02 +0000 (06:01 -0700)
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>
arch/sparc/include/asm/uaccess_64.h
arch/sparc/kernel/perf_event.c

Simple merge
Simple merge