diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2018-10-09 16:51:05 +1100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-10-09 16:51:05 +1100 |
commit | 9b7e4d601baac83a7104652042107ce94f245524 (patch) | |
tree | 1ed938abb14fd861b5c28d6df90d7508a1cb5184 /arch/powerpc/kernel/process.c | |
parent | 47fd2060660e62b169990a6fcd9eb61bc1a85c5c (diff) | |
parent | ac1788cc7da4ce54edcfd2e499afdb0a23d5c41d (diff) | |
download | talos-op-linux-9b7e4d601baac83a7104652042107ce94f245524.tar.gz talos-op-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.c | 10 |
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++) { |