sparc32: fix register window handling in genregs32_[gs]et()
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 17 May 2020 16:20:40 +0000 (12:20 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jun 2020 07:05:28 +0000 (09:05 +0200)
commit3721d5dcac2a4d89b200f93b235252cc896e9d6d
tree923ba8b01cdc4f3a2d07ef8b0a2d4691345cf4f6
parent621dbec36ba1dacbc17a5b067ed6531e52ad57e2
sparc32: fix register window handling in genregs32_[gs]et()

commit cf51e129b96847f969bfb8af1ee1516a01a70b39 upstream.

It needs access_process_vm() if the traced process does not share
mm with the caller.  Solution is similar to what sparc64 does.
Note that genregs32_set() is only ever called with pos being 0
or 32 * sizeof(u32) (the latter - as part of PTRACE_SETREGS
handling).

Cc: stable@kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/sparc/kernel/ptrace_32.c