diff options
| -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 913c5725cdb2..bb6ac471a784 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
| @@ -1306,6 +1306,16 @@ void show_user_instructions(struct pt_regs *regs) | |||
| 1306 | 1306 | ||
| 1307 | pc = regs->nip - (instructions_to_print * 3 / 4 * sizeof(int)); | 1307 | pc = regs->nip - (instructions_to_print * 3 / 4 * sizeof(int)); |
| 1308 | 1308 | ||
| 1309 | /* | ||
| 1310 | * Make sure the NIP points at userspace, not kernel text/data or | ||
| 1311 | * elsewhere. | ||
| 1312 | */ | ||
| 1313 | if (!__access_ok(pc, instructions_to_print * sizeof(int), USER_DS)) { | ||
| 1314 | pr_info("%s[%d]: Bad NIP, not dumping instructions.\n", | ||
| 1315 | current->comm, current->pid); | ||
| 1316 | return; | ||
| 1317 | } | ||
| 1318 | |||
| 1309 | pr_info("%s[%d]: code: ", current->comm, current->pid); | 1319 | pr_info("%s[%d]: code: ", current->comm, current->pid); |
| 1310 | 1320 | ||
| 1311 | for (i = 0; i < instructions_to_print; i++) { | 1321 | for (i = 0; i < instructions_to_print; i++) { |
