]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
MIPS: ptrace: Fix regs_return_value for kernel context
authorMarcin Nowakowski <marcin.nowakowski@imgtec.com>
Wed, 12 Oct 2016 07:32:56 +0000 (09:32 +0200)
committerJiri Slaby <jslaby@suse.cz>
Fri, 28 Oct 2016 18:36:59 +0000 (20:36 +0200)
commit75393dbe932eec4d00d15faa5cb18a512d1d7bfe
tree3705e46d836dc08565c1418431a886a0f63cf098
parent9802f2db0751d0e3669b730fe55dda95bd9628ad
MIPS: ptrace: Fix regs_return_value for kernel context

commit 74f1077b5b783e7bf4fa3007cefdc8dbd6c07518 upstream.

Currently regs_return_value always negates reg[2] if it determines
the syscall has failed, but when called in kernel context this check is
invalid and may result in returning a wrong value.

This fixes errors reported by CONFIG_KPROBES_SANITY_TEST

Fixes: d7e7528bcd45 ("Audit: push audit success and retcode into arch ptrace.h")
Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14381/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
arch/mips/include/asm/ptrace.h