summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/process.c
diff options
context:
space:
mode:
authorMichael Ellerman2018-10-09 07:51:05 +0200
committerMichael Ellerman2018-10-09 07:51:05 +0200
commit9b7e4d601baac83a7104652042107ce94f245524 (patch)
tree1ed938abb14fd861b5c28d6df90d7508a1cb5184 /arch/powerpc/kernel/process.c
parentmacintosh/via-macii, macintosh/adb-iop: Clean up whitespace (diff)
parentpowerpc/numa: Skip onlining a offline node in kdump path (diff)
downloadkernel-qcow2-linux-9b7e4d601baac83a7104652042107ce94f245524.tar.gz
kernel-qcow2-linux-9b7e4d601baac83a7104652042107ce94f245524.tar.xz
kernel-qcow2-linux-9b7e4d601baac83a7104652042107ce94f245524.zip
Merge branch 'fixes' into next
Merge our fixes branch. It has a few important fixes that are needed for futher testing and also some commits that will conflict with content in next.
Diffstat (limited to 'arch/powerpc/kernel/process.c')
-rw-r--r--arch/powerpc/kernel/process.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index ec264a6f0eb3..d9d4eb2ea6c9 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1303,6 +1303,16 @@ void show_user_instructions(struct pt_regs *regs)
pc = regs->nip - (instructions_to_print * 3 / 4 * sizeof(int));
+ /*
+ * Make sure the NIP points at userspace, not kernel text/data or
+ * elsewhere.
+ */
+ if (!__access_ok(pc, instructions_to_print * sizeof(int), USER_DS)) {
+ pr_info("%s[%d]: Bad NIP, not dumping instructions.\n",
+ current->comm, current->pid);
+ return;
+ }
+
pr_info("%s[%d]: code: ", current->comm, current->pid);
for (i = 0; i < instructions_to_print; i++) {