s390: remove task_show_regs
task_show_regs used to be a debugging aid in the early bringup days
of Linux on s390. /proc/<pid>/status is a world readable file, it
is not a good idea to show the registers of a process. The only
correct fix is to remove task_show_regs.
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index 16d7654..9950005 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -220,44 +220,6 @@
printk("\n");
}
-/* This is called from fs/proc/array.c */
-char *task_show_regs(struct task_struct *task, char *buffer)
-{
- struct pt_regs *regs;
-
- regs = __KSTK_PTREGS(task);
- buffer += sprintf(buffer, "task: %08lx, ksp: %08x\n",
- (unsigned long) task, task->thread.ksp);
- buffer += sprintf(buffer, "User PSW : %08lx %08lx\n",
- (unsigned long) regs->psw.mask,
- (unsigned long) regs->psw.addr);
- buffer += sprintf(buffer, "User GPRS: %08x %08x %08x %08x\n",
- regs->gprs[0], regs->gprs[1],
- regs->gprs[2], regs->gprs[3]);
- buffer += sprintf(buffer, " %08x %08x %08x %08x\n",
- regs->gprs[4], regs->gprs[5],
- regs->gprs[6], regs->gprs[7]);
- buffer += sprintf(buffer, " %08x %08x %08x %08x\n",
- regs->gprs[8], regs->gprs[9],
- regs->gprs[10], regs->gprs[11]);
- buffer += sprintf(buffer, " %08x %08x %08x %08x\n",
- regs->gprs[12], regs->gprs[13],
- regs->gprs[14], regs->gprs[15]);
- buffer += sprintf(buffer, "User ACRS: %08x %08x %08x %08x\n",
- regs->acrs[0], regs->acrs[1],
- regs->acrs[2], regs->acrs[3]);
- buffer += sprintf(buffer, " %08x %08x %08x %08x\n",
- regs->acrs[4], regs->acrs[5],
- regs->acrs[6], regs->acrs[7]);
- buffer += sprintf(buffer, " %08x %08x %08x %08x\n",
- regs->acrs[8], regs->acrs[9],
- regs->acrs[10], regs->acrs[11]);
- buffer += sprintf(buffer, " %08x %08x %08x %08x\n",
- regs->acrs[12], regs->acrs[13],
- regs->acrs[14], regs->acrs[15]);
- return buffer;
-}
-
spinlock_t die_lock = SPIN_LOCK_UNLOCKED;
void die(const char * str, struct pt_regs * regs, long err)
diff --git a/arch/s390x/kernel/traps.c b/arch/s390x/kernel/traps.c
index da5f64b..d1cf86f 100644
--- a/arch/s390x/kernel/traps.c
+++ b/arch/s390x/kernel/traps.c
@@ -222,44 +222,6 @@
printk("\n");
}
-/* This is called from fs/proc/array.c */
-char *task_show_regs(struct task_struct *task, char *buf)
-{
- struct pt_regs *regs;
-
- regs = __KSTK_PTREGS(task);
- buf += sprintf(buf, "task: %016lx, ksp: %016lx\n",
- (unsigned long) task, task->thread.ksp);
- buf += sprintf(buf, "User PSW : %016lx %016lx\n",
- (unsigned long) regs->psw.mask,
- (unsigned long) regs->psw.addr);
- buf += sprintf(buf, "User GPRS: %016lx %016lx %016lx %016lx\n",
- regs->gprs[0], regs->gprs[1],
- regs->gprs[2], regs->gprs[3]);
- buf += sprintf(buf, " %016lx %016lx %016lx %016lx\n",
- regs->gprs[4], regs->gprs[5],
- regs->gprs[6], regs->gprs[7]);
- buf += sprintf(buf, " %016lx %016lx %016lx %016lx\n",
- regs->gprs[8], regs->gprs[9],
- regs->gprs[10], regs->gprs[11]);
- buf += sprintf(buf, " %016lx %016lx %016lx %016lx\n",
- regs->gprs[12], regs->gprs[13],
- regs->gprs[14], regs->gprs[15]);
- buf += sprintf(buf, "User ACRS: %08x %08x %08x %08x\n",
- regs->acrs[0], regs->acrs[1],
- regs->acrs[2], regs->acrs[3]);
- buf += sprintf(buf, " %08x %08x %08x %08x\n",
- regs->acrs[4], regs->acrs[5],
- regs->acrs[6], regs->acrs[7]);
- buf += sprintf(buf, " %08x %08x %08x %08x\n",
- regs->acrs[8], regs->acrs[9],
- regs->acrs[10], regs->acrs[11]);
- buf += sprintf(buf, " %08x %08x %08x %08x\n",
- regs->acrs[12], regs->acrs[13],
- regs->acrs[14], regs->acrs[15]);
- return buf;
-}
-
spinlock_t die_lock = SPIN_LOCK_UNLOCKED;
void die(const char * str, struct pt_regs * regs, long err)
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 3352262..f0f2dc9 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -295,9 +295,6 @@
}
buffer = task_sig(task, buffer);
buffer = task_cap(task, buffer);
-#if defined(CONFIG_ARCH_S390)
- buffer = task_show_regs(task, buffer);
-#endif
return buffer - orig;
}
diff --git a/include/asm-s390/ptrace.h b/include/asm-s390/ptrace.h
index 046db2f..c69e9dc 100644
--- a/include/asm-s390/ptrace.h
+++ b/include/asm-s390/ptrace.h
@@ -326,7 +326,6 @@
#define user_mode(regs) (((regs)->psw.mask & PSW_PROBLEM_STATE) != 0)
#define instruction_pointer(regs) ((regs)->psw.addr)
extern void show_regs(struct pt_regs * regs);
-extern char *task_show_regs(struct task_struct *task, char *buffer);
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-s390x/ptrace.h b/include/asm-s390x/ptrace.h
index dc00d29..85e3c82 100644
--- a/include/asm-s390x/ptrace.h
+++ b/include/asm-s390x/ptrace.h
@@ -308,7 +308,6 @@
#define user_mode(regs) (((regs)->psw.mask & PSW_PROBLEM_STATE) != 0)
#define instruction_pointer(regs) ((regs)->psw.addr)
extern void show_regs(struct pt_regs * regs);
-extern char *task_show_regs(struct task_struct *task, char *buffer);
#endif
#endif /* __ASSEMBLY__ */