diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-30 20:37:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-30 20:37:43 -0400 |
commit | 5f56886521d6ddd3648777fae44d82382dd8c87f (patch) | |
tree | aa0db6331cdb01c23f1884439840aadd31bbcca4 /arch | |
parent | f1e9a236e5ddab6c349611ee86f54291916f226c (diff) | |
parent | e2a8b0a779787314eca1061308a8182e6c5bfabd (diff) |
Merge branch 'akpm' (incoming from Andrew)
Merge third batch of fixes from Andrew Morton:
"Most of the rest. I still have two large patchsets against AIO and
IPC, but they're a bit stuck behind other trees and I'm about to
vanish for six days.
- random fixlets
- inotify
- more of the MM queue
- show_stack() cleanups
- DMI update
- kthread/workqueue things
- compat cleanups
- epoll udpates
- binfmt updates
- nilfs2
- hfs
- hfsplus
- ptrace
- kmod
- coredump
- kexec
- rbtree
- pids
- pidns
- pps
- semaphore tweaks
- some w1 patches
- relay updates
- core Kconfig changes
- sysrq tweaks"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (109 commits)
Documentation/sysrq: fix inconstistent help message of sysrq key
ethernet/emac/sysrq: fix inconstistent help message of sysrq key
sparc/sysrq: fix inconstistent help message of sysrq key
powerpc/xmon/sysrq: fix inconstistent help message of sysrq key
ARM/etm/sysrq: fix inconstistent help message of sysrq key
power/sysrq: fix inconstistent help message of sysrq key
kgdb/sysrq: fix inconstistent help message of sysrq key
lib/decompress.c: fix initconst
notifier-error-inject: fix module names in Kconfig
kernel/sys.c: make prctl(PR_SET_MM) generally available
UAPI: remove empty Kbuild files
menuconfig: print more info for symbol without prompts
init/Kconfig: re-order CONFIG_EXPERT options to fix menuconfig display
kconfig menu: move Virtualization drivers near other virtualization options
Kconfig: consolidate CONFIG_DEBUG_STRICT_USER_COPY_CHECKS
relay: use macro PAGE_ALIGN instead of FIX_SIZE
kernel/relay.c: move FIX_SIZE macro into relay.c
kernel/relay.c: remove unused function argument actor
drivers/w1/slaves/w1_ds2760.c: fix the error handling in w1_ds2760_add_slave()
drivers/w1/slaves/w1_ds2781.c: fix the error handling in w1_ds2781_add_slave()
...
Diffstat (limited to 'arch')
75 files changed, 88 insertions, 439 deletions
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index a3fd8a29ccac..ab80a80d38a2 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c | |||
@@ -175,6 +175,7 @@ machine_power_off(void) | |||
175 | void | 175 | void |
176 | show_regs(struct pt_regs *regs) | 176 | show_regs(struct pt_regs *regs) |
177 | { | 177 | { |
178 | show_regs_print_info(KERN_DEFAULT); | ||
178 | dik_show_regs(regs, NULL); | 179 | dik_show_regs(regs, NULL); |
179 | } | 180 | } |
180 | 181 | ||
diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c index 4037461a6493..affccb959a9e 100644 --- a/arch/alpha/kernel/traps.c +++ b/arch/alpha/kernel/traps.c | |||
@@ -169,13 +169,6 @@ void show_stack(struct task_struct *task, unsigned long *sp) | |||
169 | dik_show_trace(sp); | 169 | dik_show_trace(sp); |
170 | } | 170 | } |
171 | 171 | ||
172 | void dump_stack(void) | ||
173 | { | ||
174 | show_stack(NULL, NULL); | ||
175 | } | ||
176 | |||
177 | EXPORT_SYMBOL(dump_stack); | ||
178 | |||
179 | void | 172 | void |
180 | die_if_kernel(char * str, struct pt_regs *regs, long err, unsigned long *r9_15) | 173 | die_if_kernel(char * str, struct pt_regs *regs, long err, unsigned long *r9_15) |
181 | { | 174 | { |
diff --git a/arch/arc/kernel/stacktrace.c b/arch/arc/kernel/stacktrace.c index a63ff842564b..ca0207b9d5b6 100644 --- a/arch/arc/kernel/stacktrace.c +++ b/arch/arc/kernel/stacktrace.c | |||
@@ -220,13 +220,6 @@ void show_stack(struct task_struct *tsk, unsigned long *sp) | |||
220 | show_stacktrace(tsk, NULL); | 220 | show_stacktrace(tsk, NULL); |
221 | } | 221 | } |
222 | 222 | ||
223 | /* Expected by Rest of kernel code */ | ||
224 | void dump_stack(void) | ||
225 | { | ||
226 | show_stacktrace(NULL, NULL); | ||
227 | } | ||
228 | EXPORT_SYMBOL(dump_stack); | ||
229 | |||
230 | /* Another API expected by schedular, shows up in "ps" as Wait Channel | 223 | /* Another API expected by schedular, shows up in "ps" as Wait Channel |
231 | * Ofcourse just returning schedule( ) would be pointless so unwind until | 224 | * Ofcourse just returning schedule( ) would be pointless so unwind until |
232 | * the function is not in schedular code | 225 | * the function is not in schedular code |
diff --git a/arch/arc/kernel/troubleshoot.c b/arch/arc/kernel/troubleshoot.c index 7c10873c311f..0aec01985bf9 100644 --- a/arch/arc/kernel/troubleshoot.c +++ b/arch/arc/kernel/troubleshoot.c | |||
@@ -71,7 +71,7 @@ void print_task_path_n_nm(struct task_struct *tsk, char *buf) | |||
71 | } | 71 | } |
72 | 72 | ||
73 | done: | 73 | done: |
74 | pr_info("%s, TGID %u\n", path_nm, tsk->tgid); | 74 | pr_info("Path: %s\n", path_nm); |
75 | } | 75 | } |
76 | EXPORT_SYMBOL(print_task_path_n_nm); | 76 | EXPORT_SYMBOL(print_task_path_n_nm); |
77 | 77 | ||
@@ -163,6 +163,7 @@ void show_regs(struct pt_regs *regs) | |||
163 | return; | 163 | return; |
164 | 164 | ||
165 | print_task_path_n_nm(tsk, buf); | 165 | print_task_path_n_nm(tsk, buf); |
166 | show_regs_print_info(KERN_INFO); | ||
166 | 167 | ||
167 | if (current->thread.cause_code) | 168 | if (current->thread.cause_code) |
168 | show_ecr_verbose(regs); | 169 | show_ecr_verbose(regs); |
diff --git a/arch/arm/kernel/etm.c b/arch/arm/kernel/etm.c index 9b6de8c988f3..8ff0ecdc637f 100644 --- a/arch/arm/kernel/etm.c +++ b/arch/arm/kernel/etm.c | |||
@@ -254,7 +254,7 @@ static void sysrq_etm_dump(int key) | |||
254 | 254 | ||
255 | static struct sysrq_key_op sysrq_etm_op = { | 255 | static struct sysrq_key_op sysrq_etm_op = { |
256 | .handler = sysrq_etm_dump, | 256 | .handler = sysrq_etm_dump, |
257 | .help_msg = "ETM buffer dump", | 257 | .help_msg = "etm-buffer-dump(v)", |
258 | .action_msg = "etm", | 258 | .action_msg = "etm", |
259 | }; | 259 | }; |
260 | 260 | ||
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index c9a5e2ce8aa9..ae58d3b37d9d 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -225,11 +225,8 @@ void __show_regs(struct pt_regs *regs) | |||
225 | unsigned long flags; | 225 | unsigned long flags; |
226 | char buf[64]; | 226 | char buf[64]; |
227 | 227 | ||
228 | printk("CPU: %d %s (%s %.*s)\n", | 228 | show_regs_print_info(KERN_DEFAULT); |
229 | raw_smp_processor_id(), print_tainted(), | 229 | |
230 | init_utsname()->release, | ||
231 | (int)strcspn(init_utsname()->version, " "), | ||
232 | init_utsname()->version); | ||
233 | print_symbol("PC is at %s\n", instruction_pointer(regs)); | 230 | print_symbol("PC is at %s\n", instruction_pointer(regs)); |
234 | print_symbol("LR is at %s\n", regs->ARM_lr); | 231 | print_symbol("LR is at %s\n", regs->ARM_lr); |
235 | printk("pc : [<%08lx>] lr : [<%08lx>] psr: %08lx\n" | 232 | printk("pc : [<%08lx>] lr : [<%08lx>] psr: %08lx\n" |
@@ -284,7 +281,6 @@ void __show_regs(struct pt_regs *regs) | |||
284 | void show_regs(struct pt_regs * regs) | 281 | void show_regs(struct pt_regs * regs) |
285 | { | 282 | { |
286 | printk("\n"); | 283 | printk("\n"); |
287 | printk("Pid: %d, comm: %20s\n", task_pid_nr(current), current->comm); | ||
288 | __show_regs(regs); | 284 | __show_regs(regs); |
289 | dump_stack(); | 285 | dump_stack(); |
290 | } | 286 | } |
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 1c089119b2d7..18b32e8e4497 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
@@ -204,13 +204,6 @@ static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) | |||
204 | } | 204 | } |
205 | #endif | 205 | #endif |
206 | 206 | ||
207 | void dump_stack(void) | ||
208 | { | ||
209 | dump_backtrace(NULL, NULL); | ||
210 | } | ||
211 | |||
212 | EXPORT_SYMBOL(dump_stack); | ||
213 | |||
214 | void show_stack(struct task_struct *tsk, unsigned long *sp) | 207 | void show_stack(struct task_struct *tsk, unsigned long *sp) |
215 | { | 208 | { |
216 | dump_backtrace(NULL, tsk); | 209 | dump_backtrace(NULL, tsk); |
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 6f3822f98dcd..f4919721f7dd 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c | |||
@@ -145,11 +145,7 @@ void __show_regs(struct pt_regs *regs) | |||
145 | { | 145 | { |
146 | int i; | 146 | int i; |
147 | 147 | ||
148 | printk("CPU: %d %s (%s %.*s)\n", | 148 | show_regs_print_info(KERN_DEFAULT); |
149 | raw_smp_processor_id(), print_tainted(), | ||
150 | init_utsname()->release, | ||
151 | (int)strcspn(init_utsname()->version, " "), | ||
152 | init_utsname()->version); | ||
153 | print_symbol("PC is at %s\n", instruction_pointer(regs)); | 149 | print_symbol("PC is at %s\n", instruction_pointer(regs)); |
154 | print_symbol("LR is at %s\n", regs->regs[30]); | 150 | print_symbol("LR is at %s\n", regs->regs[30]); |
155 | printk("pc : [<%016llx>] lr : [<%016llx>] pstate: %08llx\n", | 151 | printk("pc : [<%016llx>] lr : [<%016llx>] pstate: %08llx\n", |
@@ -166,7 +162,6 @@ void __show_regs(struct pt_regs *regs) | |||
166 | void show_regs(struct pt_regs * regs) | 162 | void show_regs(struct pt_regs * regs) |
167 | { | 163 | { |
168 | printk("\n"); | 164 | printk("\n"); |
169 | printk("Pid: %d, comm: %20s\n", task_pid_nr(current), current->comm); | ||
170 | __show_regs(regs); | 165 | __show_regs(regs); |
171 | } | 166 | } |
172 | 167 | ||
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index b3c5f628bdb4..61d7dd29f756 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c | |||
@@ -167,13 +167,6 @@ static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) | |||
167 | } | 167 | } |
168 | } | 168 | } |
169 | 169 | ||
170 | void dump_stack(void) | ||
171 | { | ||
172 | dump_backtrace(NULL, NULL); | ||
173 | } | ||
174 | |||
175 | EXPORT_SYMBOL(dump_stack); | ||
176 | |||
177 | void show_stack(struct task_struct *tsk, unsigned long *sp) | 170 | void show_stack(struct task_struct *tsk, unsigned long *sp) |
178 | { | 171 | { |
179 | dump_backtrace(NULL, tsk); | 172 | dump_backtrace(NULL, tsk); |
diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c index 073c3c2fa521..e7b61494c312 100644 --- a/arch/avr32/kernel/process.c +++ b/arch/avr32/kernel/process.c | |||
@@ -204,14 +204,6 @@ void show_stack(struct task_struct *tsk, unsigned long *stack) | |||
204 | show_stack_log_lvl(tsk, (unsigned long)stack, NULL, ""); | 204 | show_stack_log_lvl(tsk, (unsigned long)stack, NULL, ""); |
205 | } | 205 | } |
206 | 206 | ||
207 | void dump_stack(void) | ||
208 | { | ||
209 | unsigned long stack; | ||
210 | |||
211 | show_trace_log_lvl(current, &stack, NULL, ""); | ||
212 | } | ||
213 | EXPORT_SYMBOL(dump_stack); | ||
214 | |||
215 | static const char *cpu_modes[] = { | 207 | static const char *cpu_modes[] = { |
216 | "Application", "Supervisor", "Interrupt level 0", "Interrupt level 1", | 208 | "Application", "Supervisor", "Interrupt level 0", "Interrupt level 1", |
217 | "Interrupt level 2", "Interrupt level 3", "Exception", "NMI" | 209 | "Interrupt level 2", "Interrupt level 3", "Exception", "NMI" |
@@ -223,6 +215,8 @@ void show_regs_log_lvl(struct pt_regs *regs, const char *log_lvl) | |||
223 | unsigned long lr = regs->lr; | 215 | unsigned long lr = regs->lr; |
224 | unsigned long mode = (regs->sr & MODE_MASK) >> MODE_SHIFT; | 216 | unsigned long mode = (regs->sr & MODE_MASK) >> MODE_SHIFT; |
225 | 217 | ||
218 | show_regs_print_info(log_lvl); | ||
219 | |||
226 | if (!user_mode(regs)) { | 220 | if (!user_mode(regs)) { |
227 | sp = (unsigned long)regs + FRAME_SIZE_FULL; | 221 | sp = (unsigned long)regs + FRAME_SIZE_FULL; |
228 | 222 | ||
@@ -260,9 +254,6 @@ void show_regs_log_lvl(struct pt_regs *regs, const char *log_lvl) | |||
260 | regs->sr & SR_I0M ? '0' : '.', | 254 | regs->sr & SR_I0M ? '0' : '.', |
261 | regs->sr & SR_GM ? 'G' : 'g'); | 255 | regs->sr & SR_GM ? 'G' : 'g'); |
262 | printk("%sCPU Mode: %s\n", log_lvl, cpu_modes[mode]); | 256 | printk("%sCPU Mode: %s\n", log_lvl, cpu_modes[mode]); |
263 | printk("%sProcess: %s [%d] (task: %p thread: %p)\n", | ||
264 | log_lvl, current->comm, current->pid, current, | ||
265 | task_thread_info(current)); | ||
266 | } | 257 | } |
267 | 258 | ||
268 | void show_regs(struct pt_regs *regs) | 259 | void show_regs(struct pt_regs *regs) |
diff --git a/arch/blackfin/kernel/dumpstack.c b/arch/blackfin/kernel/dumpstack.c index 5cfbaa298211..95ba6d9e9a3d 100644 --- a/arch/blackfin/kernel/dumpstack.c +++ b/arch/blackfin/kernel/dumpstack.c | |||
@@ -168,6 +168,7 @@ void dump_stack(void) | |||
168 | #endif | 168 | #endif |
169 | trace_buffer_save(tflags); | 169 | trace_buffer_save(tflags); |
170 | dump_bfin_trace_buffer(); | 170 | dump_bfin_trace_buffer(); |
171 | dump_stack_print_info(KERN_DEFAULT); | ||
171 | show_stack(current, &stack); | 172 | show_stack(current, &stack); |
172 | trace_buffer_restore(tflags); | 173 | trace_buffer_restore(tflags); |
173 | } | 174 | } |
diff --git a/arch/blackfin/kernel/trace.c b/arch/blackfin/kernel/trace.c index f7f7a18abca9..c36efa0c7163 100644 --- a/arch/blackfin/kernel/trace.c +++ b/arch/blackfin/kernel/trace.c | |||
@@ -853,6 +853,8 @@ void show_regs(struct pt_regs *fp) | |||
853 | unsigned char in_atomic = (bfin_read_IPEND() & 0x10) || in_atomic(); | 853 | unsigned char in_atomic = (bfin_read_IPEND() & 0x10) || in_atomic(); |
854 | 854 | ||
855 | pr_notice("\n"); | 855 | pr_notice("\n"); |
856 | show_regs_print_info(KERN_NOTICE); | ||
857 | |||
856 | if (CPUID != bfin_cpuid()) | 858 | if (CPUID != bfin_cpuid()) |
857 | pr_notice("Compiled for cpu family 0x%04x (Rev %d), " | 859 | pr_notice("Compiled for cpu family 0x%04x (Rev %d), " |
858 | "but running on:0x%04x (Rev %d)\n", | 860 | "but running on:0x%04x (Rev %d)\n", |
diff --git a/arch/c6x/kernel/traps.c b/arch/c6x/kernel/traps.c index 1be74e5b4788..dcc2c2f6d67c 100644 --- a/arch/c6x/kernel/traps.c +++ b/arch/c6x/kernel/traps.c | |||
@@ -31,6 +31,7 @@ void __init trap_init(void) | |||
31 | void show_regs(struct pt_regs *regs) | 31 | void show_regs(struct pt_regs *regs) |
32 | { | 32 | { |
33 | pr_err("\n"); | 33 | pr_err("\n"); |
34 | show_regs_print_info(KERN_ERR); | ||
34 | pr_err("PC: %08lx SP: %08lx\n", regs->pc, regs->sp); | 35 | pr_err("PC: %08lx SP: %08lx\n", regs->pc, regs->sp); |
35 | pr_err("Status: %08lx ORIG_A4: %08lx\n", regs->csr, regs->orig_a4); | 36 | pr_err("Status: %08lx ORIG_A4: %08lx\n", regs->csr, regs->orig_a4); |
36 | pr_err("A0: %08lx B0: %08lx\n", regs->a0, regs->b0); | 37 | pr_err("A0: %08lx B0: %08lx\n", regs->a0, regs->b0); |
@@ -67,15 +68,6 @@ void show_regs(struct pt_regs *regs) | |||
67 | pr_err("A31: %08lx B31: %08lx\n", regs->a31, regs->b31); | 68 | pr_err("A31: %08lx B31: %08lx\n", regs->a31, regs->b31); |
68 | } | 69 | } |
69 | 70 | ||
70 | void dump_stack(void) | ||
71 | { | ||
72 | unsigned long stack; | ||
73 | |||
74 | show_stack(current, &stack); | ||
75 | } | ||
76 | EXPORT_SYMBOL(dump_stack); | ||
77 | |||
78 | |||
79 | void die(char *str, struct pt_regs *fp, int nr) | 71 | void die(char *str, struct pt_regs *fp, int nr) |
80 | { | 72 | { |
81 | console_verbose(); | 73 | console_verbose(); |
diff --git a/arch/cris/arch-v10/kernel/process.c b/arch/cris/arch-v10/kernel/process.c index 2ba23c13df68..753e9a03cf87 100644 --- a/arch/cris/arch-v10/kernel/process.c +++ b/arch/cris/arch-v10/kernel/process.c | |||
@@ -176,6 +176,9 @@ unsigned long get_wchan(struct task_struct *p) | |||
176 | void show_regs(struct pt_regs * regs) | 176 | void show_regs(struct pt_regs * regs) |
177 | { | 177 | { |
178 | unsigned long usp = rdusp(); | 178 | unsigned long usp = rdusp(); |
179 | |||
180 | show_regs_print_info(KERN_DEFAULT); | ||
181 | |||
179 | printk("IRP: %08lx SRP: %08lx DCCR: %08lx USP: %08lx MOF: %08lx\n", | 182 | printk("IRP: %08lx SRP: %08lx DCCR: %08lx USP: %08lx MOF: %08lx\n", |
180 | regs->irp, regs->srp, regs->dccr, usp, regs->mof ); | 183 | regs->irp, regs->srp, regs->dccr, usp, regs->mof ); |
181 | printk(" r0: %08lx r1: %08lx r2: %08lx r3: %08lx\n", | 184 | printk(" r0: %08lx r1: %08lx r2: %08lx r3: %08lx\n", |
diff --git a/arch/cris/arch-v32/kernel/process.c b/arch/cris/arch-v32/kernel/process.c index 57451faa9b20..cebd32e2a8fb 100644 --- a/arch/cris/arch-v32/kernel/process.c +++ b/arch/cris/arch-v32/kernel/process.c | |||
@@ -164,6 +164,9 @@ get_wchan(struct task_struct *p) | |||
164 | void show_regs(struct pt_regs * regs) | 164 | void show_regs(struct pt_regs * regs) |
165 | { | 165 | { |
166 | unsigned long usp = rdusp(); | 166 | unsigned long usp = rdusp(); |
167 | |||
168 | show_regs_print_info(KERN_DEFAULT); | ||
169 | |||
167 | printk("ERP: %08lx SRP: %08lx CCS: %08lx USP: %08lx MOF: %08lx\n", | 170 | printk("ERP: %08lx SRP: %08lx CCS: %08lx USP: %08lx MOF: %08lx\n", |
168 | regs->erp, regs->srp, regs->ccs, usp, regs->mof); | 171 | regs->erp, regs->srp, regs->ccs, usp, regs->mof); |
169 | 172 | ||
diff --git a/arch/cris/kernel/traps.c b/arch/cris/kernel/traps.c index a11ad3229f8c..0ffda73734f5 100644 --- a/arch/cris/kernel/traps.c +++ b/arch/cris/kernel/traps.c | |||
@@ -147,13 +147,6 @@ show_stack(void) | |||
147 | #endif | 147 | #endif |
148 | 148 | ||
149 | void | 149 | void |
150 | dump_stack(void) | ||
151 | { | ||
152 | show_stack(NULL, NULL); | ||
153 | } | ||
154 | EXPORT_SYMBOL(dump_stack); | ||
155 | |||
156 | void | ||
157 | set_nmi_handler(void (*handler)(struct pt_regs *)) | 150 | set_nmi_handler(void (*handler)(struct pt_regs *)) |
158 | { | 151 | { |
159 | nmi_handler = handler; | 152 | nmi_handler = handler; |
diff --git a/arch/frv/kernel/traps.c b/arch/frv/kernel/traps.c index 5cfd1420b091..4bff48c19d29 100644 --- a/arch/frv/kernel/traps.c +++ b/arch/frv/kernel/traps.c | |||
@@ -466,17 +466,6 @@ asmlinkage void compound_exception(unsigned long esfr1, | |||
466 | BUG(); | 466 | BUG(); |
467 | } /* end compound_exception() */ | 467 | } /* end compound_exception() */ |
468 | 468 | ||
469 | /*****************************************************************************/ | ||
470 | /* | ||
471 | * The architecture-independent backtrace generator | ||
472 | */ | ||
473 | void dump_stack(void) | ||
474 | { | ||
475 | show_stack(NULL, NULL); | ||
476 | } | ||
477 | |||
478 | EXPORT_SYMBOL(dump_stack); | ||
479 | |||
480 | void show_stack(struct task_struct *task, unsigned long *sp) | 469 | void show_stack(struct task_struct *task, unsigned long *sp) |
481 | { | 470 | { |
482 | } | 471 | } |
@@ -508,6 +497,7 @@ void show_regs(struct pt_regs *regs) | |||
508 | int loop; | 497 | int loop; |
509 | 498 | ||
510 | printk("\n"); | 499 | printk("\n"); |
500 | show_regs_print_info(KERN_DEFAULT); | ||
511 | 501 | ||
512 | printk("Frame: @%08lx [%s]\n", | 502 | printk("Frame: @%08lx [%s]\n", |
513 | (unsigned long) regs, | 503 | (unsigned long) regs, |
@@ -522,8 +512,6 @@ void show_regs(struct pt_regs *regs) | |||
522 | else | 512 | else |
523 | printk(" | "); | 513 | printk(" | "); |
524 | } | 514 | } |
525 | |||
526 | printk("Process %s (pid: %d)\n", current->comm, current->pid); | ||
527 | } | 515 | } |
528 | 516 | ||
529 | void die_if_kernel(const char *str, ...) | 517 | void die_if_kernel(const char *str, ...) |
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c index a17d2cd463d2..1a744ab7e7e5 100644 --- a/arch/h8300/kernel/process.c +++ b/arch/h8300/kernel/process.c | |||
@@ -83,6 +83,8 @@ void machine_power_off(void) | |||
83 | 83 | ||
84 | void show_regs(struct pt_regs * regs) | 84 | void show_regs(struct pt_regs * regs) |
85 | { | 85 | { |
86 | show_regs_print_info(KERN_DEFAULT); | ||
87 | |||
86 | printk("\nPC: %08lx Status: %02x", | 88 | printk("\nPC: %08lx Status: %02x", |
87 | regs->pc, regs->ccr); | 89 | regs->pc, regs->ccr); |
88 | printk("\nORIG_ER0: %08lx ER0: %08lx ER1: %08lx", | 90 | printk("\nORIG_ER0: %08lx ER0: %08lx ER1: %08lx", |
diff --git a/arch/h8300/kernel/traps.c b/arch/h8300/kernel/traps.c index 7833aa3e7c7d..cfe494dbe3da 100644 --- a/arch/h8300/kernel/traps.c +++ b/arch/h8300/kernel/traps.c | |||
@@ -164,10 +164,3 @@ void show_trace_task(struct task_struct *tsk) | |||
164 | { | 164 | { |
165 | show_stack(tsk,(unsigned long *)tsk->thread.esp0); | 165 | show_stack(tsk,(unsigned long *)tsk->thread.esp0); |
166 | } | 166 | } |
167 | |||
168 | void dump_stack(void) | ||
169 | { | ||
170 | show_stack(NULL,NULL); | ||
171 | } | ||
172 | |||
173 | EXPORT_SYMBOL(dump_stack); | ||
diff --git a/arch/hexagon/kernel/traps.c b/arch/hexagon/kernel/traps.c index be5e2dd9c9d3..cc2171b2aa04 100644 --- a/arch/hexagon/kernel/traps.c +++ b/arch/hexagon/kernel/traps.c | |||
@@ -191,14 +191,6 @@ void show_stack(struct task_struct *task, unsigned long *fp) | |||
191 | do_show_stack(task, fp, 0); | 191 | do_show_stack(task, fp, 0); |
192 | } | 192 | } |
193 | 193 | ||
194 | void dump_stack(void) | ||
195 | { | ||
196 | unsigned long *fp; | ||
197 | asm("%0 = r30" : "=r" (fp)); | ||
198 | show_stack(current, fp); | ||
199 | } | ||
200 | EXPORT_SYMBOL(dump_stack); | ||
201 | |||
202 | int die(const char *str, struct pt_regs *regs, long err) | 194 | int die(const char *str, struct pt_regs *regs, long err) |
203 | { | 195 | { |
204 | static struct { | 196 | static struct { |
diff --git a/arch/hexagon/kernel/vm_events.c b/arch/hexagon/kernel/vm_events.c index 9b5a4a295a68..f337281ebe67 100644 --- a/arch/hexagon/kernel/vm_events.c +++ b/arch/hexagon/kernel/vm_events.c | |||
@@ -33,6 +33,8 @@ | |||
33 | */ | 33 | */ |
34 | void show_regs(struct pt_regs *regs) | 34 | void show_regs(struct pt_regs *regs) |
35 | { | 35 | { |
36 | show_regs_print_info(KERN_EMERG); | ||
37 | |||
36 | printk(KERN_EMERG "restart_r0: \t0x%08lx syscall_nr: %ld\n", | 38 | printk(KERN_EMERG "restart_r0: \t0x%08lx syscall_nr: %ld\n", |
37 | regs->restart_r0, regs->syscall_nr); | 39 | regs->restart_r0, regs->syscall_nr); |
38 | printk(KERN_EMERG "preds: \t\t0x%08lx\n", regs->preds); | 40 | printk(KERN_EMERG "preds: \t\t0x%08lx\n", regs->preds); |
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index a26fc640e4ce..55d4ba47a907 100644 --- a/arch/ia64/kernel/process.c +++ b/arch/ia64/kernel/process.c | |||
@@ -96,21 +96,13 @@ show_stack (struct task_struct *task, unsigned long *sp) | |||
96 | } | 96 | } |
97 | 97 | ||
98 | void | 98 | void |
99 | dump_stack (void) | ||
100 | { | ||
101 | show_stack(NULL, NULL); | ||
102 | } | ||
103 | |||
104 | EXPORT_SYMBOL(dump_stack); | ||
105 | |||
106 | void | ||
107 | show_regs (struct pt_regs *regs) | 99 | show_regs (struct pt_regs *regs) |
108 | { | 100 | { |
109 | unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri; | 101 | unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri; |
110 | 102 | ||
111 | print_modules(); | 103 | print_modules(); |
112 | printk("\nPid: %d, CPU %d, comm: %20s\n", task_pid_nr(current), | 104 | printk("\n"); |
113 | smp_processor_id(), current->comm); | 105 | show_regs_print_info(KERN_DEFAULT); |
114 | printk("psr : %016lx ifs : %016lx ip : [<%016lx>] %s (%s)\n", | 106 | printk("psr : %016lx ifs : %016lx ip : [<%016lx>] %s (%s)\n", |
115 | regs->cr_ipsr, regs->cr_ifs, ip, print_tainted(), | 107 | regs->cr_ipsr, regs->cr_ifs, ip, print_tainted(), |
116 | init_utsname()->release); | 108 | init_utsname()->release); |
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 2029cc0d2fc6..13bfdd22afc8 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
@@ -1063,6 +1063,7 @@ check_bugs (void) | |||
1063 | static int __init run_dmi_scan(void) | 1063 | static int __init run_dmi_scan(void) |
1064 | { | 1064 | { |
1065 | dmi_scan_machine(); | 1065 | dmi_scan_machine(); |
1066 | dmi_set_dump_stack_arch_desc(); | ||
1066 | return 0; | 1067 | return 0; |
1067 | } | 1068 | } |
1068 | core_initcall(run_dmi_scan); | 1069 | core_initcall(run_dmi_scan); |
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c index e2d049018c3b..e69221d581d5 100644 --- a/arch/m32r/kernel/process.c +++ b/arch/m32r/kernel/process.c | |||
@@ -73,6 +73,8 @@ void machine_power_off(void) | |||
73 | void show_regs(struct pt_regs * regs) | 73 | void show_regs(struct pt_regs * regs) |
74 | { | 74 | { |
75 | printk("\n"); | 75 | printk("\n"); |
76 | show_regs_print_info(KERN_DEFAULT); | ||
77 | |||
76 | printk("BPC[%08lx]:PSW[%08lx]:LR [%08lx]:FP [%08lx]\n", \ | 78 | printk("BPC[%08lx]:PSW[%08lx]:LR [%08lx]:FP [%08lx]\n", \ |
77 | regs->bpc, regs->psw, regs->lr, regs->fp); | 79 | regs->bpc, regs->psw, regs->lr, regs->fp); |
78 | printk("BBPC[%08lx]:BBPSW[%08lx]:SPU[%08lx]:SPI[%08lx]\n", \ | 80 | printk("BBPC[%08lx]:BBPSW[%08lx]:SPU[%08lx]:SPI[%08lx]\n", \ |
diff --git a/arch/m32r/kernel/traps.c b/arch/m32r/kernel/traps.c index 9fe3467a5133..a7a424f852e4 100644 --- a/arch/m32r/kernel/traps.c +++ b/arch/m32r/kernel/traps.c | |||
@@ -167,15 +167,6 @@ void show_stack(struct task_struct *task, unsigned long *sp) | |||
167 | show_trace(task, sp); | 167 | show_trace(task, sp); |
168 | } | 168 | } |
169 | 169 | ||
170 | void dump_stack(void) | ||
171 | { | ||
172 | unsigned long stack; | ||
173 | |||
174 | show_trace(current, &stack); | ||
175 | } | ||
176 | |||
177 | EXPORT_SYMBOL(dump_stack); | ||
178 | |||
179 | static void show_registers(struct pt_regs *regs) | 170 | static void show_registers(struct pt_regs *regs) |
180 | { | 171 | { |
181 | int i = 0; | 172 | int i = 0; |
diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c index f32ab22e7ed3..88fcd8c70e7b 100644 --- a/arch/m68k/kernel/traps.c +++ b/arch/m68k/kernel/traps.c | |||
@@ -992,18 +992,6 @@ void show_stack(struct task_struct *task, unsigned long *stack) | |||
992 | } | 992 | } |
993 | 993 | ||
994 | /* | 994 | /* |
995 | * The architecture-independent backtrace generator | ||
996 | */ | ||
997 | void dump_stack(void) | ||
998 | { | ||
999 | unsigned long stack; | ||
1000 | |||
1001 | show_trace(&stack); | ||
1002 | } | ||
1003 | |||
1004 | EXPORT_SYMBOL(dump_stack); | ||
1005 | |||
1006 | /* | ||
1007 | * The vector number returned in the frame pointer may also contain | 995 | * The vector number returned in the frame pointer may also contain |
1008 | * the "fs" (Fault Status) bits on ColdFire. These are in the bottom | 996 | * the "fs" (Fault Status) bits on ColdFire. These are in the bottom |
1009 | * 2 bits, and upper 2 bits. So we need to mask out the real vector | 997 | * 2 bits, and upper 2 bits. So we need to mask out the real vector |
diff --git a/arch/metag/kernel/process.c b/arch/metag/kernel/process.c index dc5923544560..483dff986a23 100644 --- a/arch/metag/kernel/process.c +++ b/arch/metag/kernel/process.c | |||
@@ -129,6 +129,8 @@ void show_regs(struct pt_regs *regs) | |||
129 | "D1.7 " | 129 | "D1.7 " |
130 | }; | 130 | }; |
131 | 131 | ||
132 | show_regs_print_info(KERN_INFO); | ||
133 | |||
132 | pr_info(" pt_regs @ %p\n", regs); | 134 | pr_info(" pt_regs @ %p\n", regs); |
133 | pr_info(" SaveMask = 0x%04hx\n", regs->ctx.SaveMask); | 135 | pr_info(" SaveMask = 0x%04hx\n", regs->ctx.SaveMask); |
134 | pr_info(" Flags = 0x%04hx (%c%c%c%c)\n", regs->ctx.Flags, | 136 | pr_info(" Flags = 0x%04hx (%c%c%c%c)\n", regs->ctx.Flags, |
diff --git a/arch/metag/kernel/traps.c b/arch/metag/kernel/traps.c index 8961f247b500..2ceeaae5b199 100644 --- a/arch/metag/kernel/traps.c +++ b/arch/metag/kernel/traps.c | |||
@@ -987,9 +987,3 @@ void show_stack(struct task_struct *tsk, unsigned long *sp) | |||
987 | 987 | ||
988 | show_trace(tsk, sp, NULL); | 988 | show_trace(tsk, sp, NULL); |
989 | } | 989 | } |
990 | |||
991 | void dump_stack(void) | ||
992 | { | ||
993 | show_stack(NULL, NULL); | ||
994 | } | ||
995 | EXPORT_SYMBOL(dump_stack); | ||
diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c index 7cce2e9c1719..a55893807274 100644 --- a/arch/microblaze/kernel/process.c +++ b/arch/microblaze/kernel/process.c | |||
@@ -20,6 +20,8 @@ | |||
20 | 20 | ||
21 | void show_regs(struct pt_regs *regs) | 21 | void show_regs(struct pt_regs *regs) |
22 | { | 22 | { |
23 | show_regs_print_info(KERN_INFO); | ||
24 | |||
23 | pr_info(" Registers dump: mode=%X\r\n", regs->pt_mode); | 25 | pr_info(" Registers dump: mode=%X\r\n", regs->pt_mode); |
24 | pr_info(" r1=%08lX, r2=%08lX, r3=%08lX, r4=%08lX\n", | 26 | pr_info(" r1=%08lX, r2=%08lX, r3=%08lX, r4=%08lX\n", |
25 | regs->r1, regs->r2, regs->r3, regs->r4); | 27 | regs->r1, regs->r2, regs->r3, regs->r4); |
diff --git a/arch/microblaze/kernel/traps.c b/arch/microblaze/kernel/traps.c index 30e6b5004a6a..cb619533a192 100644 --- a/arch/microblaze/kernel/traps.c +++ b/arch/microblaze/kernel/traps.c | |||
@@ -75,9 +75,3 @@ void show_stack(struct task_struct *task, unsigned long *sp) | |||
75 | 75 | ||
76 | debug_show_held_locks(task); | 76 | debug_show_held_locks(task); |
77 | } | 77 | } |
78 | |||
79 | void dump_stack(void) | ||
80 | { | ||
81 | show_stack(NULL, NULL); | ||
82 | } | ||
83 | EXPORT_SYMBOL(dump_stack); | ||
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index c3abb88170fc..25225515451f 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -206,19 +206,6 @@ void show_stack(struct task_struct *task, unsigned long *sp) | |||
206 | show_stacktrace(task, ®s); | 206 | show_stacktrace(task, ®s); |
207 | } | 207 | } |
208 | 208 | ||
209 | /* | ||
210 | * The architecture-independent dump_stack generator | ||
211 | */ | ||
212 | void dump_stack(void) | ||
213 | { | ||
214 | struct pt_regs regs; | ||
215 | |||
216 | prepare_frametrace(®s); | ||
217 | show_backtrace(current, ®s); | ||
218 | } | ||
219 | |||
220 | EXPORT_SYMBOL(dump_stack); | ||
221 | |||
222 | static void show_code(unsigned int __user *pc) | 209 | static void show_code(unsigned int __user *pc) |
223 | { | 210 | { |
224 | long i; | 211 | long i; |
@@ -244,7 +231,7 @@ static void __show_regs(const struct pt_regs *regs) | |||
244 | unsigned int cause = regs->cp0_cause; | 231 | unsigned int cause = regs->cp0_cause; |
245 | int i; | 232 | int i; |
246 | 233 | ||
247 | printk("Cpu %d\n", smp_processor_id()); | 234 | show_regs_print_info(KERN_DEFAULT); |
248 | 235 | ||
249 | /* | 236 | /* |
250 | * Saved main processor registers | 237 | * Saved main processor registers |
diff --git a/arch/mn10300/kernel/process.c b/arch/mn10300/kernel/process.c index 2da39fb8b3b2..3707da583d05 100644 --- a/arch/mn10300/kernel/process.c +++ b/arch/mn10300/kernel/process.c | |||
@@ -97,6 +97,7 @@ void machine_power_off(void) | |||
97 | 97 | ||
98 | void show_regs(struct pt_regs *regs) | 98 | void show_regs(struct pt_regs *regs) |
99 | { | 99 | { |
100 | show_regs_print_info(KERN_DEFAULT); | ||
100 | } | 101 | } |
101 | 102 | ||
102 | /* | 103 | /* |
diff --git a/arch/mn10300/kernel/traps.c b/arch/mn10300/kernel/traps.c index b900e5afa0ae..a7a987c7954f 100644 --- a/arch/mn10300/kernel/traps.c +++ b/arch/mn10300/kernel/traps.c | |||
@@ -294,17 +294,6 @@ void show_stack(struct task_struct *task, unsigned long *sp) | |||
294 | } | 294 | } |
295 | 295 | ||
296 | /* | 296 | /* |
297 | * the architecture-independent dump_stack generator | ||
298 | */ | ||
299 | void dump_stack(void) | ||
300 | { | ||
301 | unsigned long stack; | ||
302 | |||
303 | show_stack(current, &stack); | ||
304 | } | ||
305 | EXPORT_SYMBOL(dump_stack); | ||
306 | |||
307 | /* | ||
308 | * dump the register file in the specified exception frame | 297 | * dump the register file in the specified exception frame |
309 | */ | 298 | */ |
310 | void show_registers_only(struct pt_regs *regs) | 299 | void show_registers_only(struct pt_regs *regs) |
diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c index 00c233bf0d06..386af258591d 100644 --- a/arch/openrisc/kernel/process.c +++ b/arch/openrisc/kernel/process.c | |||
@@ -90,6 +90,7 @@ void show_regs(struct pt_regs *regs) | |||
90 | { | 90 | { |
91 | extern void show_registers(struct pt_regs *regs); | 91 | extern void show_registers(struct pt_regs *regs); |
92 | 92 | ||
93 | show_regs_print_info(KERN_DEFAULT); | ||
93 | /* __PHX__ cleanup this mess */ | 94 | /* __PHX__ cleanup this mess */ |
94 | show_registers(regs); | 95 | show_registers(regs); |
95 | } | 96 | } |
diff --git a/arch/openrisc/kernel/traps.c b/arch/openrisc/kernel/traps.c index 5cce396016d0..3d3f6062f49c 100644 --- a/arch/openrisc/kernel/traps.c +++ b/arch/openrisc/kernel/traps.c | |||
@@ -105,17 +105,6 @@ void show_trace_task(struct task_struct *tsk) | |||
105 | */ | 105 | */ |
106 | } | 106 | } |
107 | 107 | ||
108 | /* | ||
109 | * The architecture-independent backtrace generator | ||
110 | */ | ||
111 | void dump_stack(void) | ||
112 | { | ||
113 | unsigned long stack; | ||
114 | |||
115 | show_stack(current, &stack); | ||
116 | } | ||
117 | EXPORT_SYMBOL(dump_stack); | ||
118 | |||
119 | void show_registers(struct pt_regs *regs) | 108 | void show_registers(struct pt_regs *regs) |
120 | { | 109 | { |
121 | int i; | 110 | int i; |
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 0339181bf3ac..433e75a2ee9a 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig | |||
@@ -1,5 +1,6 @@ | |||
1 | config PARISC | 1 | config PARISC |
2 | def_bool y | 2 | def_bool y |
3 | select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS | ||
3 | select HAVE_IDE | 4 | select HAVE_IDE |
4 | select HAVE_OPROFILE | 5 | select HAVE_OPROFILE |
5 | select HAVE_FUNCTION_TRACER if 64BIT | 6 | select HAVE_FUNCTION_TRACER if 64BIT |
diff --git a/arch/parisc/Kconfig.debug b/arch/parisc/Kconfig.debug index 7305ac8f7f5b..bc989e522a04 100644 --- a/arch/parisc/Kconfig.debug +++ b/arch/parisc/Kconfig.debug | |||
@@ -12,18 +12,4 @@ config DEBUG_RODATA | |||
12 | portion of the kernel code won't be covered by a TLB anymore. | 12 | portion of the kernel code won't be covered by a TLB anymore. |
13 | If in doubt, say "N". | 13 | If in doubt, say "N". |
14 | 14 | ||
15 | config DEBUG_STRICT_USER_COPY_CHECKS | ||
16 | bool "Strict copy size checks" | ||
17 | depends on DEBUG_KERNEL && !TRACE_BRANCH_PROFILING | ||
18 | ---help--- | ||
19 | Enabling this option turns a certain set of sanity checks for user | ||
20 | copy operations into compile time failures. | ||
21 | |||
22 | The copy_from_user() etc checks are there to help test if there | ||
23 | are sufficient security checks on the length argument of | ||
24 | the copy operation, by having gcc prove that the argument is | ||
25 | within bounds. | ||
26 | |||
27 | If unsure, or if you run an older (pre 4.4) gcc, say N. | ||
28 | |||
29 | endmenu | 15 | endmenu |
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c index aeb8f8f2c07a..f702bff0bed9 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c | |||
@@ -126,6 +126,8 @@ void show_regs(struct pt_regs *regs) | |||
126 | user = user_mode(regs); | 126 | user = user_mode(regs); |
127 | level = user ? KERN_DEBUG : KERN_CRIT; | 127 | level = user ? KERN_DEBUG : KERN_CRIT; |
128 | 128 | ||
129 | show_regs_print_info(level); | ||
130 | |||
129 | print_gr(level, regs); | 131 | print_gr(level, regs); |
130 | 132 | ||
131 | for (i = 0; i < 8; i += 4) | 133 | for (i = 0; i < 8; i += 4) |
@@ -158,14 +160,6 @@ void show_regs(struct pt_regs *regs) | |||
158 | } | 160 | } |
159 | } | 161 | } |
160 | 162 | ||
161 | |||
162 | void dump_stack(void) | ||
163 | { | ||
164 | show_stack(NULL, NULL); | ||
165 | } | ||
166 | |||
167 | EXPORT_SYMBOL(dump_stack); | ||
168 | |||
169 | static void do_show_stack(struct unwind_frame_info *info) | 163 | static void do_show_stack(struct unwind_frame_info *info) |
170 | { | 164 | { |
171 | int i = 1; | 165 | int i = 1; |
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 16e77a81ab4f..13a8d9d0b5cb 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -831,6 +831,8 @@ void show_regs(struct pt_regs * regs) | |||
831 | { | 831 | { |
832 | int i, trap; | 832 | int i, trap; |
833 | 833 | ||
834 | show_regs_print_info(KERN_DEFAULT); | ||
835 | |||
834 | printk("NIP: "REG" LR: "REG" CTR: "REG"\n", | 836 | printk("NIP: "REG" LR: "REG" CTR: "REG"\n", |
835 | regs->nip, regs->link, regs->ctr); | 837 | regs->nip, regs->link, regs->ctr); |
836 | printk("REGS: %p TRAP: %04lx %s (%s)\n", | 838 | printk("REGS: %p TRAP: %04lx %s (%s)\n", |
@@ -850,12 +852,6 @@ void show_regs(struct pt_regs * regs) | |||
850 | #else | 852 | #else |
851 | printk("DAR: "REG", DSISR: %08lx\n", regs->dar, regs->dsisr); | 853 | printk("DAR: "REG", DSISR: %08lx\n", regs->dar, regs->dsisr); |
852 | #endif | 854 | #endif |
853 | printk("TASK = %p[%d] '%s' THREAD: %p", | ||
854 | current, task_pid_nr(current), current->comm, task_thread_info(current)); | ||
855 | |||
856 | #ifdef CONFIG_SMP | ||
857 | printk(" CPU: %d", raw_smp_processor_id()); | ||
858 | #endif /* CONFIG_SMP */ | ||
859 | 855 | ||
860 | for (i = 0; i < 32; i++) { | 856 | for (i = 0; i < 32; i++) { |
861 | if ((i % REGS_PER_LINE) == 0) | 857 | if ((i % REGS_PER_LINE) == 0) |
@@ -1362,12 +1358,6 @@ void show_stack(struct task_struct *tsk, unsigned long *stack) | |||
1362 | } while (count++ < kstack_depth_to_print); | 1358 | } while (count++ < kstack_depth_to_print); |
1363 | } | 1359 | } |
1364 | 1360 | ||
1365 | void dump_stack(void) | ||
1366 | { | ||
1367 | show_stack(current, NULL); | ||
1368 | } | ||
1369 | EXPORT_SYMBOL(dump_stack); | ||
1370 | |||
1371 | #ifdef CONFIG_PPC64 | 1361 | #ifdef CONFIG_PPC64 |
1372 | /* Called with hard IRQs off */ | 1362 | /* Called with hard IRQs off */ |
1373 | void __ppc64_runlatch_on(void) | 1363 | void __ppc64_runlatch_on(void) |
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 13f85defabed..3e34cd224b7c 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c | |||
@@ -2947,7 +2947,7 @@ static void sysrq_handle_xmon(int key) | |||
2947 | 2947 | ||
2948 | static struct sysrq_key_op sysrq_xmon_op = { | 2948 | static struct sysrq_key_op sysrq_xmon_op = { |
2949 | .handler = sysrq_handle_xmon, | 2949 | .handler = sysrq_handle_xmon, |
2950 | .help_msg = "Xmon", | 2950 | .help_msg = "xmon(x)", |
2951 | .action_msg = "Entering xmon", | 2951 | .action_msg = "Entering xmon", |
2952 | }; | 2952 | }; |
2953 | 2953 | ||
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index bda6ba6f3cf5..ce640aff61a1 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -91,6 +91,7 @@ config S390 | |||
91 | select ARCH_INLINE_WRITE_UNLOCK_BH | 91 | select ARCH_INLINE_WRITE_UNLOCK_BH |
92 | select ARCH_INLINE_WRITE_UNLOCK_IRQ | 92 | select ARCH_INLINE_WRITE_UNLOCK_IRQ |
93 | select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE | 93 | select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE |
94 | select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS | ||
94 | select ARCH_SAVE_PAGE_KEYS if HIBERNATION | 95 | select ARCH_SAVE_PAGE_KEYS if HIBERNATION |
95 | select ARCH_WANT_IPC_PARSE_VERSION | 96 | select ARCH_WANT_IPC_PARSE_VERSION |
96 | select BUILDTIME_EXTABLE_SORT | 97 | select BUILDTIME_EXTABLE_SORT |
diff --git a/arch/s390/Kconfig.debug b/arch/s390/Kconfig.debug index fc32a2df4974..c56878e1245f 100644 --- a/arch/s390/Kconfig.debug +++ b/arch/s390/Kconfig.debug | |||
@@ -17,20 +17,6 @@ config STRICT_DEVMEM | |||
17 | 17 | ||
18 | If you are unsure, say Y. | 18 | If you are unsure, say Y. |
19 | 19 | ||
20 | config DEBUG_STRICT_USER_COPY_CHECKS | ||
21 | def_bool n | ||
22 | prompt "Strict user copy size checks" | ||
23 | ---help--- | ||
24 | Enabling this option turns a certain set of sanity checks for user | ||
25 | copy operations into compile time warnings. | ||
26 | |||
27 | The copy_from_user() etc checks are there to help test if there | ||
28 | are sufficient security checks on the length argument of | ||
29 | the copy operation, by having gcc prove that the argument is | ||
30 | within bounds. | ||
31 | |||
32 | If unsure, or if you run an older (pre 4.4) gcc, say N. | ||
33 | |||
34 | config S390_PTDUMP | 20 | config S390_PTDUMP |
35 | bool "Export kernel pagetable layout to userspace via debugfs" | 21 | bool "Export kernel pagetable layout to userspace via debugfs" |
36 | depends on DEBUG_KERNEL | 22 | depends on DEBUG_KERNEL |
diff --git a/arch/s390/kernel/dumpstack.c b/arch/s390/kernel/dumpstack.c index 03dce39d01ee..298297477257 100644 --- a/arch/s390/kernel/dumpstack.c +++ b/arch/s390/kernel/dumpstack.c | |||
@@ -129,23 +129,6 @@ static void show_last_breaking_event(struct pt_regs *regs) | |||
129 | #endif | 129 | #endif |
130 | } | 130 | } |
131 | 131 | ||
132 | /* | ||
133 | * The architecture-independent dump_stack generator | ||
134 | */ | ||
135 | void dump_stack(void) | ||
136 | { | ||
137 | printk("CPU: %d %s %s %.*s\n", | ||
138 | task_thread_info(current)->cpu, print_tainted(), | ||
139 | init_utsname()->release, | ||
140 | (int)strcspn(init_utsname()->version, " "), | ||
141 | init_utsname()->version); | ||
142 | printk("Process %s (pid: %d, task: %p, ksp: %p)\n", | ||
143 | current->comm, current->pid, current, | ||
144 | (void *) current->thread.ksp); | ||
145 | show_stack(NULL, NULL); | ||
146 | } | ||
147 | EXPORT_SYMBOL(dump_stack); | ||
148 | |||
149 | static inline int mask_bits(struct pt_regs *regs, unsigned long bits) | 132 | static inline int mask_bits(struct pt_regs *regs, unsigned long bits) |
150 | { | 133 | { |
151 | return (regs->psw.mask & bits) / ((~bits + 1) & bits); | 134 | return (regs->psw.mask & bits) / ((~bits + 1) & bits); |
@@ -183,14 +166,7 @@ void show_registers(struct pt_regs *regs) | |||
183 | 166 | ||
184 | void show_regs(struct pt_regs *regs) | 167 | void show_regs(struct pt_regs *regs) |
185 | { | 168 | { |
186 | printk("CPU: %d %s %s %.*s\n", | 169 | show_regs_print_info(KERN_DEFAULT); |
187 | task_thread_info(current)->cpu, print_tainted(), | ||
188 | init_utsname()->release, | ||
189 | (int)strcspn(init_utsname()->version, " "), | ||
190 | init_utsname()->version); | ||
191 | printk("Process %s (pid: %d, task: %p, ksp: %p)\n", | ||
192 | current->comm, current->pid, current, | ||
193 | (void *) current->thread.ksp); | ||
194 | show_registers(regs); | 170 | show_registers(regs); |
195 | /* Show stack backtrace if pt_regs is from kernel mode */ | 171 | /* Show stack backtrace if pt_regs is from kernel mode */ |
196 | if (!user_mode(regs)) | 172 | if (!user_mode(regs)) |
diff --git a/arch/s390/lib/Makefile b/arch/s390/lib/Makefile index 6ab0d0b5cec8..20b0e97a7df2 100644 --- a/arch/s390/lib/Makefile +++ b/arch/s390/lib/Makefile | |||
@@ -3,7 +3,6 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | lib-y += delay.o string.o uaccess_std.o uaccess_pt.o | 5 | lib-y += delay.o string.o uaccess_std.o uaccess_pt.o |
6 | obj-y += usercopy.o | ||
7 | obj-$(CONFIG_32BIT) += div64.o qrnnd.o ucmpdi2.o mem32.o | 6 | obj-$(CONFIG_32BIT) += div64.o qrnnd.o ucmpdi2.o mem32.o |
8 | obj-$(CONFIG_64BIT) += mem64.o | 7 | obj-$(CONFIG_64BIT) += mem64.o |
9 | lib-$(CONFIG_64BIT) += uaccess_mvcos.o | 8 | lib-$(CONFIG_64BIT) += uaccess_mvcos.o |
diff --git a/arch/s390/lib/usercopy.c b/arch/s390/lib/usercopy.c deleted file mode 100644 index 14b363fec8a2..000000000000 --- a/arch/s390/lib/usercopy.c +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #include <linux/module.h> | ||
2 | #include <linux/bug.h> | ||
3 | |||
4 | void copy_from_user_overflow(void) | ||
5 | { | ||
6 | WARN(1, "Buffer overflow detected!\n"); | ||
7 | } | ||
8 | EXPORT_SYMBOL(copy_from_user_overflow); | ||
diff --git a/arch/score/kernel/traps.c b/arch/score/kernel/traps.c index 0e46fb19a848..1517a7dcd6d9 100644 --- a/arch/score/kernel/traps.c +++ b/arch/score/kernel/traps.c | |||
@@ -117,6 +117,8 @@ static void show_code(unsigned int *pc) | |||
117 | */ | 117 | */ |
118 | void show_regs(struct pt_regs *regs) | 118 | void show_regs(struct pt_regs *regs) |
119 | { | 119 | { |
120 | show_regs_print_info(KERN_DEFAULT); | ||
121 | |||
120 | printk("r0 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", | 122 | printk("r0 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", |
121 | regs->regs[0], regs->regs[1], regs->regs[2], regs->regs[3], | 123 | regs->regs[0], regs->regs[1], regs->regs[2], regs->regs[3], |
122 | regs->regs[4], regs->regs[5], regs->regs[6], regs->regs[7]); | 124 | regs->regs[4], regs->regs[5], regs->regs[6], regs->regs[7]); |
@@ -149,16 +151,6 @@ static void show_registers(struct pt_regs *regs) | |||
149 | printk(KERN_NOTICE "\n"); | 151 | printk(KERN_NOTICE "\n"); |
150 | } | 152 | } |
151 | 153 | ||
152 | /* | ||
153 | * The architecture-independent dump_stack generator | ||
154 | */ | ||
155 | void dump_stack(void) | ||
156 | { | ||
157 | show_stack(current_thread_info()->task, | ||
158 | (long *) get_irq_regs()->regs[0]); | ||
159 | } | ||
160 | EXPORT_SYMBOL(dump_stack); | ||
161 | |||
162 | void __die(const char *str, struct pt_regs *regs, const char *file, | 154 | void __die(const char *str, struct pt_regs *regs, const char *file, |
163 | const char *func, unsigned long line) | 155 | const char *func, unsigned long line) |
164 | { | 156 | { |
diff --git a/arch/sh/kernel/dumpstack.c b/arch/sh/kernel/dumpstack.c index 7617dc4129ac..b959f5592604 100644 --- a/arch/sh/kernel/dumpstack.c +++ b/arch/sh/kernel/dumpstack.c | |||
@@ -158,9 +158,3 @@ void show_stack(struct task_struct *tsk, unsigned long *sp) | |||
158 | (unsigned long)task_stack_page(tsk)); | 158 | (unsigned long)task_stack_page(tsk)); |
159 | show_trace(tsk, sp, NULL); | 159 | show_trace(tsk, sp, NULL); |
160 | } | 160 | } |
161 | |||
162 | void dump_stack(void) | ||
163 | { | ||
164 | show_stack(NULL, NULL); | ||
165 | } | ||
166 | EXPORT_SYMBOL(dump_stack); | ||
diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c index 73eb66fc6253..ebd3933005b4 100644 --- a/arch/sh/kernel/process_32.c +++ b/arch/sh/kernel/process_32.c | |||
@@ -32,11 +32,7 @@ | |||
32 | void show_regs(struct pt_regs * regs) | 32 | void show_regs(struct pt_regs * regs) |
33 | { | 33 | { |
34 | printk("\n"); | 34 | printk("\n"); |
35 | printk("Pid : %d, Comm: \t\t%s\n", task_pid_nr(current), current->comm); | 35 | show_regs_print_info(KERN_DEFAULT); |
36 | printk("CPU : %d \t\t%s (%s %.*s)\n\n", | ||
37 | smp_processor_id(), print_tainted(), init_utsname()->release, | ||
38 | (int)strcspn(init_utsname()->version, " "), | ||
39 | init_utsname()->version); | ||
40 | 36 | ||
41 | print_symbol("PC is at %s\n", instruction_pointer(regs)); | 37 | print_symbol("PC is at %s\n", instruction_pointer(regs)); |
42 | print_symbol("PR is at %s\n", regs->pr); | 38 | print_symbol("PR is at %s\n", regs->pr); |
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c index e611c85144b1..174d124b419e 100644 --- a/arch/sh/kernel/process_64.c +++ b/arch/sh/kernel/process_64.c | |||
@@ -40,6 +40,7 @@ void show_regs(struct pt_regs *regs) | |||
40 | unsigned long long ah, al, bh, bl, ch, cl; | 40 | unsigned long long ah, al, bh, bl, ch, cl; |
41 | 41 | ||
42 | printk("\n"); | 42 | printk("\n"); |
43 | show_regs_print_info(KERN_DEFAULT); | ||
43 | 44 | ||
44 | ah = (regs->pc) >> 32; | 45 | ah = (regs->pc) >> 32; |
45 | al = (regs->pc) & 0xffffffff; | 46 | al = (regs->pc) & 0xffffffff; |
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c index c85241006e32..fdd819dfdacf 100644 --- a/arch/sparc/kernel/process_32.c +++ b/arch/sparc/kernel/process_32.c | |||
@@ -112,6 +112,8 @@ void show_regs(struct pt_regs *r) | |||
112 | { | 112 | { |
113 | struct reg_window32 *rw = (struct reg_window32 *) r->u_regs[14]; | 113 | struct reg_window32 *rw = (struct reg_window32 *) r->u_regs[14]; |
114 | 114 | ||
115 | show_regs_print_info(KERN_DEFAULT); | ||
116 | |||
115 | printk("PSR: %08lx PC: %08lx NPC: %08lx Y: %08lx %s\n", | 117 | printk("PSR: %08lx PC: %08lx NPC: %08lx Y: %08lx %s\n", |
116 | r->psr, r->pc, r->npc, r->y, print_tainted()); | 118 | r->psr, r->pc, r->npc, r->y, print_tainted()); |
117 | printk("PC: <%pS>\n", (void *) r->pc); | 119 | printk("PC: <%pS>\n", (void *) r->pc); |
@@ -142,11 +144,13 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) | |||
142 | struct reg_window32 *rw; | 144 | struct reg_window32 *rw; |
143 | int count = 0; | 145 | int count = 0; |
144 | 146 | ||
145 | if (tsk != NULL) | 147 | if (!tsk) |
146 | task_base = (unsigned long) task_stack_page(tsk); | 148 | tsk = current; |
147 | else | 149 | |
148 | task_base = (unsigned long) current_thread_info(); | 150 | if (tsk == current && !_ksp) |
151 | __asm__ __volatile__("mov %%fp, %0" : "=r" (_ksp)); | ||
149 | 152 | ||
153 | task_base = (unsigned long) task_stack_page(tsk); | ||
150 | fp = (unsigned long) _ksp; | 154 | fp = (unsigned long) _ksp; |
151 | do { | 155 | do { |
152 | /* Bogus frame pointer? */ | 156 | /* Bogus frame pointer? */ |
@@ -162,17 +166,6 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) | |||
162 | printk("\n"); | 166 | printk("\n"); |
163 | } | 167 | } |
164 | 168 | ||
165 | void dump_stack(void) | ||
166 | { | ||
167 | unsigned long *ksp; | ||
168 | |||
169 | __asm__ __volatile__("mov %%fp, %0" | ||
170 | : "=r" (ksp)); | ||
171 | show_stack(current, ksp); | ||
172 | } | ||
173 | |||
174 | EXPORT_SYMBOL(dump_stack); | ||
175 | |||
176 | /* | 169 | /* |
177 | * Note: sparc64 has a pretty intricated thread_saved_pc, check it out. | 170 | * Note: sparc64 has a pretty intricated thread_saved_pc, check it out. |
178 | */ | 171 | */ |
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c index 9fbf0d14a361..baebab215492 100644 --- a/arch/sparc/kernel/process_64.c +++ b/arch/sparc/kernel/process_64.c | |||
@@ -163,6 +163,8 @@ static void show_regwindow(struct pt_regs *regs) | |||
163 | 163 | ||
164 | void show_regs(struct pt_regs *regs) | 164 | void show_regs(struct pt_regs *regs) |
165 | { | 165 | { |
166 | show_regs_print_info(KERN_DEFAULT); | ||
167 | |||
166 | printk("TSTATE: %016lx TPC: %016lx TNPC: %016lx Y: %08x %s\n", regs->tstate, | 168 | printk("TSTATE: %016lx TPC: %016lx TNPC: %016lx Y: %08x %s\n", regs->tstate, |
167 | regs->tpc, regs->tnpc, regs->y, print_tainted()); | 169 | regs->tpc, regs->tnpc, regs->y, print_tainted()); |
168 | printk("TPC: <%pS>\n", (void *) regs->tpc); | 170 | printk("TPC: <%pS>\n", (void *) regs->tpc); |
@@ -292,7 +294,7 @@ static void sysrq_handle_globreg(int key) | |||
292 | 294 | ||
293 | static struct sysrq_key_op sparc_globalreg_op = { | 295 | static struct sysrq_key_op sparc_globalreg_op = { |
294 | .handler = sysrq_handle_globreg, | 296 | .handler = sysrq_handle_globreg, |
295 | .help_msg = "global-regs(Y)", | 297 | .help_msg = "global-regs(y)", |
296 | .action_msg = "Show Global CPU Regs", | 298 | .action_msg = "Show Global CPU Regs", |
297 | }; | 299 | }; |
298 | 300 | ||
@@ -362,7 +364,7 @@ static void sysrq_handle_globpmu(int key) | |||
362 | 364 | ||
363 | static struct sysrq_key_op sparc_globalpmu_op = { | 365 | static struct sysrq_key_op sparc_globalpmu_op = { |
364 | .handler = sysrq_handle_globpmu, | 366 | .handler = sysrq_handle_globpmu, |
365 | .help_msg = "global-pmu(X)", | 367 | .help_msg = "global-pmu(x)", |
366 | .action_msg = "Show Global PMU Regs", | 368 | .action_msg = "Show Global PMU Regs", |
367 | }; | 369 | }; |
368 | 370 | ||
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c index 8d38ca97aa23..b3f833ab90eb 100644 --- a/arch/sparc/kernel/traps_64.c +++ b/arch/sparc/kernel/traps_64.c | |||
@@ -2350,13 +2350,6 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) | |||
2350 | } while (++count < 16); | 2350 | } while (++count < 16); |
2351 | } | 2351 | } |
2352 | 2352 | ||
2353 | void dump_stack(void) | ||
2354 | { | ||
2355 | show_stack(current, NULL); | ||
2356 | } | ||
2357 | |||
2358 | EXPORT_SYMBOL(dump_stack); | ||
2359 | |||
2360 | static inline struct reg_window *kernel_stack_up(struct reg_window *rw) | 2353 | static inline struct reg_window *kernel_stack_up(struct reg_window *rw) |
2361 | { | 2354 | { |
2362 | unsigned long fp = rw->ins[6]; | 2355 | unsigned long fp = rw->ins[6]; |
diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile index 8410065f2862..dbe119b63b48 100644 --- a/arch/sparc/lib/Makefile +++ b/arch/sparc/lib/Makefile | |||
@@ -45,4 +45,3 @@ obj-y += iomap.o | |||
45 | obj-$(CONFIG_SPARC32) += atomic32.o ucmpdi2.o | 45 | obj-$(CONFIG_SPARC32) += atomic32.o ucmpdi2.o |
46 | obj-y += ksyms.o | 46 | obj-y += ksyms.o |
47 | obj-$(CONFIG_SPARC64) += PeeCeeI.o | 47 | obj-$(CONFIG_SPARC64) += PeeCeeI.o |
48 | obj-y += usercopy.o | ||
diff --git a/arch/sparc/lib/usercopy.c b/arch/sparc/lib/usercopy.c deleted file mode 100644 index 5c4284ce1c03..000000000000 --- a/arch/sparc/lib/usercopy.c +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #include <linux/module.h> | ||
2 | #include <linux/kernel.h> | ||
3 | #include <linux/bug.h> | ||
4 | |||
5 | void copy_from_user_overflow(void) | ||
6 | { | ||
7 | WARN(1, "Buffer overflow detected!\n"); | ||
8 | } | ||
9 | EXPORT_SYMBOL(copy_from_user_overflow); | ||
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig index 25877aebc685..0f712f4e1b33 100644 --- a/arch/tile/Kconfig +++ b/arch/tile/Kconfig | |||
@@ -19,6 +19,7 @@ config TILE | |||
19 | select HAVE_SYSCALL_WRAPPERS if TILEGX | 19 | select HAVE_SYSCALL_WRAPPERS if TILEGX |
20 | select VIRT_TO_BUS | 20 | select VIRT_TO_BUS |
21 | select SYS_HYPERVISOR | 21 | select SYS_HYPERVISOR |
22 | select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS | ||
22 | select ARCH_HAVE_NMI_SAFE_CMPXCHG | 23 | select ARCH_HAVE_NMI_SAFE_CMPXCHG |
23 | select GENERIC_CLOCKEVENTS | 24 | select GENERIC_CLOCKEVENTS |
24 | select MODULES_USE_ELF_RELA | 25 | select MODULES_USE_ELF_RELA |
@@ -114,13 +115,6 @@ config STRICT_DEVMEM | |||
114 | config SMP | 115 | config SMP |
115 | def_bool y | 116 | def_bool y |
116 | 117 | ||
117 | # Allow checking for compile-time determined overflow errors in | ||
118 | # copy_from_user(). There are still unprovable places in the | ||
119 | # generic code as of 2.6.34, so this option is not really compatible | ||
120 | # with -Werror, which is more useful in general. | ||
121 | config DEBUG_COPY_FROM_USER | ||
122 | def_bool n | ||
123 | |||
124 | config HVC_TILE | 118 | config HVC_TILE |
125 | depends on TTY | 119 | depends on TTY |
126 | select HVC_DRIVER | 120 | select HVC_DRIVER |
diff --git a/arch/tile/include/asm/uaccess.h b/arch/tile/include/asm/uaccess.h index 9ab078a4605d..8a082bc6bca5 100644 --- a/arch/tile/include/asm/uaccess.h +++ b/arch/tile/include/asm/uaccess.h | |||
@@ -395,7 +395,12 @@ _copy_from_user(void *to, const void __user *from, unsigned long n) | |||
395 | return n; | 395 | return n; |
396 | } | 396 | } |
397 | 397 | ||
398 | #ifdef CONFIG_DEBUG_COPY_FROM_USER | 398 | #ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS |
399 | /* | ||
400 | * There are still unprovable places in the generic code as of 2.6.34, so this | ||
401 | * option is not really compatible with -Werror, which is more useful in | ||
402 | * general. | ||
403 | */ | ||
399 | extern void copy_from_user_overflow(void) | 404 | extern void copy_from_user_overflow(void) |
400 | __compiletime_warning("copy_from_user() size is not provably correct"); | 405 | __compiletime_warning("copy_from_user() size is not provably correct"); |
401 | 406 | ||
diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c index 80b2a18deb87..8ac304484f98 100644 --- a/arch/tile/kernel/process.c +++ b/arch/tile/kernel/process.c | |||
@@ -573,8 +573,7 @@ void show_regs(struct pt_regs *regs) | |||
573 | int i; | 573 | int i; |
574 | 574 | ||
575 | pr_err("\n"); | 575 | pr_err("\n"); |
576 | pr_err(" Pid: %d, comm: %20s, CPU: %d\n", | 576 | show_regs_print_info(KERN_ERR); |
577 | tsk->pid, tsk->comm, smp_processor_id()); | ||
578 | #ifdef __tilegx__ | 577 | #ifdef __tilegx__ |
579 | for (i = 0; i < 51; i += 3) | 578 | for (i = 0; i < 51; i += 3) |
580 | pr_err(" r%-2d: "REGFMT" r%-2d: "REGFMT" r%-2d: "REGFMT"\n", | 579 | pr_err(" r%-2d: "REGFMT" r%-2d: "REGFMT" r%-2d: "REGFMT"\n", |
diff --git a/arch/tile/lib/uaccess.c b/arch/tile/lib/uaccess.c index f8d398c9ee7f..030abe3ee4f1 100644 --- a/arch/tile/lib/uaccess.c +++ b/arch/tile/lib/uaccess.c | |||
@@ -22,11 +22,3 @@ int __range_ok(unsigned long addr, unsigned long size) | |||
22 | is_arch_mappable_range(addr, size)); | 22 | is_arch_mappable_range(addr, size)); |
23 | } | 23 | } |
24 | EXPORT_SYMBOL(__range_ok); | 24 | EXPORT_SYMBOL(__range_ok); |
25 | |||
26 | #ifdef CONFIG_DEBUG_COPY_FROM_USER | ||
27 | void copy_from_user_overflow(void) | ||
28 | { | ||
29 | WARN(1, "Buffer overflow detected!\n"); | ||
30 | } | ||
31 | EXPORT_SYMBOL(copy_from_user_overflow); | ||
32 | #endif | ||
diff --git a/arch/um/kernel/sysrq.c b/arch/um/kernel/sysrq.c index e562ff80409a..7d101a2a1541 100644 --- a/arch/um/kernel/sysrq.c +++ b/arch/um/kernel/sysrq.c | |||
@@ -35,18 +35,6 @@ void show_trace(struct task_struct *task, unsigned long * stack) | |||
35 | } | 35 | } |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | /* | ||
39 | * stack dumps generator - this is used by arch-independent code. | ||
40 | * And this is identical to i386 currently. | ||
41 | */ | ||
42 | void dump_stack(void) | ||
43 | { | ||
44 | unsigned long stack; | ||
45 | |||
46 | show_trace(current, &stack); | ||
47 | } | ||
48 | EXPORT_SYMBOL(dump_stack); | ||
49 | |||
50 | /*Stolen from arch/i386/kernel/traps.c */ | 38 | /*Stolen from arch/i386/kernel/traps.c */ |
51 | static const int kstack_depth_to_print = 24; | 39 | static const int kstack_depth_to_print = 24; |
52 | 40 | ||
diff --git a/arch/um/sys-ppc/sysrq.c b/arch/um/sys-ppc/sysrq.c index f889449f9285..1ff1ad7f27da 100644 --- a/arch/um/sys-ppc/sysrq.c +++ b/arch/um/sys-ppc/sysrq.c | |||
@@ -11,6 +11,8 @@ | |||
11 | void show_regs(struct pt_regs_subarch *regs) | 11 | void show_regs(struct pt_regs_subarch *regs) |
12 | { | 12 | { |
13 | printk("\n"); | 13 | printk("\n"); |
14 | show_regs_print_info(KERN_DEFAULT); | ||
15 | |||
14 | printk("show_regs(): insert regs here.\n"); | 16 | printk("show_regs(): insert regs here.\n"); |
15 | #if 0 | 17 | #if 0 |
16 | printk("\n"); | 18 | printk("\n"); |
diff --git a/arch/unicore32/kernel/process.c b/arch/unicore32/kernel/process.c index 7fab86d7c5d4..c9447691bdac 100644 --- a/arch/unicore32/kernel/process.c +++ b/arch/unicore32/kernel/process.c | |||
@@ -144,11 +144,7 @@ void __show_regs(struct pt_regs *regs) | |||
144 | unsigned long flags; | 144 | unsigned long flags; |
145 | char buf[64]; | 145 | char buf[64]; |
146 | 146 | ||
147 | printk(KERN_DEFAULT "CPU: %d %s (%s %.*s)\n", | 147 | show_regs_print_info(KERN_DEFAULT); |
148 | raw_smp_processor_id(), print_tainted(), | ||
149 | init_utsname()->release, | ||
150 | (int)strcspn(init_utsname()->version, " "), | ||
151 | init_utsname()->version); | ||
152 | print_symbol("PC is at %s\n", instruction_pointer(regs)); | 148 | print_symbol("PC is at %s\n", instruction_pointer(regs)); |
153 | print_symbol("LR is at %s\n", regs->UCreg_lr); | 149 | print_symbol("LR is at %s\n", regs->UCreg_lr); |
154 | printk(KERN_DEFAULT "pc : [<%08lx>] lr : [<%08lx>] psr: %08lx\n" | 150 | printk(KERN_DEFAULT "pc : [<%08lx>] lr : [<%08lx>] psr: %08lx\n" |
diff --git a/arch/unicore32/kernel/traps.c b/arch/unicore32/kernel/traps.c index 0870b68d2ad9..c54e32410ead 100644 --- a/arch/unicore32/kernel/traps.c +++ b/arch/unicore32/kernel/traps.c | |||
@@ -170,12 +170,6 @@ static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) | |||
170 | c_backtrace(fp, mode); | 170 | c_backtrace(fp, mode); |
171 | } | 171 | } |
172 | 172 | ||
173 | void dump_stack(void) | ||
174 | { | ||
175 | dump_backtrace(NULL, NULL); | ||
176 | } | ||
177 | EXPORT_SYMBOL(dump_stack); | ||
178 | |||
179 | void show_stack(struct task_struct *tsk, unsigned long *sp) | 173 | void show_stack(struct task_struct *tsk, unsigned long *sp) |
180 | { | 174 | { |
181 | dump_backtrace(NULL, tsk); | 175 | dump_backtrace(NULL, tsk); |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 05b057dca4a7..5db2117ae288 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -20,6 +20,7 @@ config X86_64 | |||
20 | ### Arch settings | 20 | ### Arch settings |
21 | config X86 | 21 | config X86 |
22 | def_bool y | 22 | def_bool y |
23 | select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS | ||
23 | select HAVE_AOUT if X86_32 | 24 | select HAVE_AOUT if X86_32 |
24 | select HAVE_UNSTABLE_SCHED_CLOCK | 25 | select HAVE_UNSTABLE_SCHED_CLOCK |
25 | select ARCH_SUPPORTS_NUMA_BALANCING | 26 | select ARCH_SUPPORTS_NUMA_BALANCING |
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 16f738385dcb..c198b7e13e7b 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug | |||
@@ -292,20 +292,6 @@ config OPTIMIZE_INLINING | |||
292 | 292 | ||
293 | If unsure, say N. | 293 | If unsure, say N. |
294 | 294 | ||
295 | config DEBUG_STRICT_USER_COPY_CHECKS | ||
296 | bool "Strict copy size checks" | ||
297 | depends on DEBUG_KERNEL && !TRACE_BRANCH_PROFILING | ||
298 | ---help--- | ||
299 | Enabling this option turns a certain set of sanity checks for user | ||
300 | copy operations into compile time failures. | ||
301 | |||
302 | The copy_from_user() etc checks are there to help test if there | ||
303 | are sufficient security checks on the length argument of | ||
304 | the copy operation, by having gcc prove that the argument is | ||
305 | within bounds. | ||
306 | |||
307 | If unsure, or if you run an older (pre 4.4) gcc, say N. | ||
308 | |||
309 | config DEBUG_NMI_SELFTEST | 295 | config DEBUG_NMI_SELFTEST |
310 | bool "NMI Selftest" | 296 | bool "NMI Selftest" |
311 | depends on DEBUG_KERNEL && X86_LOCAL_APIC | 297 | depends on DEBUG_KERNEL && X86_LOCAL_APIC |
diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c index 03abf9b70011..81e94d972f1b 100644 --- a/arch/x86/ia32/ia32_aout.c +++ b/arch/x86/ia32/ia32_aout.c | |||
@@ -162,7 +162,6 @@ static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file, | |||
162 | fs = get_fs(); | 162 | fs = get_fs(); |
163 | set_fs(KERNEL_DS); | 163 | set_fs(KERNEL_DS); |
164 | has_dumped = 1; | 164 | has_dumped = 1; |
165 | current->flags |= PF_DUMPCORE; | ||
166 | strncpy(dump.u_comm, current->comm, sizeof(current->comm)); | 165 | strncpy(dump.u_comm, current->comm, sizeof(current->comm)); |
167 | dump.u_ar0 = offsetof(struct user32, regs); | 166 | dump.u_ar0 = offsetof(struct user32, regs); |
168 | dump.signal = signr; | 167 | dump.signal = signr; |
diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h index 11e1152222d0..2f03ff018d36 100644 --- a/arch/x86/include/asm/bug.h +++ b/arch/x86/include/asm/bug.h | |||
@@ -37,7 +37,4 @@ do { \ | |||
37 | 37 | ||
38 | #include <asm-generic/bug.h> | 38 | #include <asm-generic/bug.h> |
39 | 39 | ||
40 | |||
41 | extern void show_regs_common(void); | ||
42 | |||
43 | #endif /* _ASM_X86_BUG_H */ | 40 | #endif /* _ASM_X86_BUG_H */ |
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index c8797d55b245..deb6421c9e69 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c | |||
@@ -176,26 +176,20 @@ void show_trace(struct task_struct *task, struct pt_regs *regs, | |||
176 | 176 | ||
177 | void show_stack(struct task_struct *task, unsigned long *sp) | 177 | void show_stack(struct task_struct *task, unsigned long *sp) |
178 | { | 178 | { |
179 | show_stack_log_lvl(task, NULL, sp, 0, ""); | 179 | unsigned long bp = 0; |
180 | } | ||
181 | |||
182 | /* | ||
183 | * The architecture-independent dump_stack generator | ||
184 | */ | ||
185 | void dump_stack(void) | ||
186 | { | ||
187 | unsigned long bp; | ||
188 | unsigned long stack; | 180 | unsigned long stack; |
189 | 181 | ||
190 | bp = stack_frame(current, NULL); | 182 | /* |
191 | printk("Pid: %d, comm: %.20s %s %s %.*s\n", | 183 | * Stack frames below this one aren't interesting. Don't show them |
192 | current->pid, current->comm, print_tainted(), | 184 | * if we're printing for %current. |
193 | init_utsname()->release, | 185 | */ |
194 | (int)strcspn(init_utsname()->version, " "), | 186 | if (!sp && (!task || task == current)) { |
195 | init_utsname()->version); | 187 | sp = &stack; |
196 | show_trace(NULL, NULL, &stack, bp); | 188 | bp = stack_frame(current, NULL); |
189 | } | ||
190 | |||
191 | show_stack_log_lvl(task, NULL, sp, bp, ""); | ||
197 | } | 192 | } |
198 | EXPORT_SYMBOL(dump_stack); | ||
199 | 193 | ||
200 | static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED; | 194 | static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED; |
201 | static int die_owner = -1; | 195 | static int die_owner = -1; |
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c index 1038a417ea53..f2a1770ca176 100644 --- a/arch/x86/kernel/dumpstack_32.c +++ b/arch/x86/kernel/dumpstack_32.c | |||
@@ -86,11 +86,9 @@ void show_regs(struct pt_regs *regs) | |||
86 | { | 86 | { |
87 | int i; | 87 | int i; |
88 | 88 | ||
89 | show_regs_print_info(KERN_EMERG); | ||
89 | __show_regs(regs, !user_mode_vm(regs)); | 90 | __show_regs(regs, !user_mode_vm(regs)); |
90 | 91 | ||
91 | pr_emerg("Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)\n", | ||
92 | TASK_COMM_LEN, current->comm, task_pid_nr(current), | ||
93 | current_thread_info(), current, task_thread_info(current)); | ||
94 | /* | 92 | /* |
95 | * When in-kernel, we also print out the stack and code at the | 93 | * When in-kernel, we also print out the stack and code at the |
96 | * time of the fault.. | 94 | * time of the fault.. |
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c index b653675d5288..addb207dab92 100644 --- a/arch/x86/kernel/dumpstack_64.c +++ b/arch/x86/kernel/dumpstack_64.c | |||
@@ -249,14 +249,10 @@ void show_regs(struct pt_regs *regs) | |||
249 | { | 249 | { |
250 | int i; | 250 | int i; |
251 | unsigned long sp; | 251 | unsigned long sp; |
252 | const int cpu = smp_processor_id(); | ||
253 | struct task_struct *cur = current; | ||
254 | 252 | ||
255 | sp = regs->sp; | 253 | sp = regs->sp; |
256 | printk("CPU %d ", cpu); | 254 | show_regs_print_info(KERN_DEFAULT); |
257 | __show_regs(regs, 1); | 255 | __show_regs(regs, 1); |
258 | printk(KERN_DEFAULT "Process %s (pid: %d, threadinfo %p, task %p)\n", | ||
259 | cur->comm, cur->pid, task_thread_info(cur), cur); | ||
260 | 256 | ||
261 | /* | 257 | /* |
262 | * When in-kernel, we also print out the stack and code at the | 258 | * When in-kernel, we also print out the stack and code at the |
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 14fcf55a5c5b..607af0d4d5ef 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -121,30 +121,6 @@ void exit_thread(void) | |||
121 | drop_fpu(me); | 121 | drop_fpu(me); |
122 | } | 122 | } |
123 | 123 | ||
124 | void show_regs_common(void) | ||
125 | { | ||
126 | const char *vendor, *product, *board; | ||
127 | |||
128 | vendor = dmi_get_system_info(DMI_SYS_VENDOR); | ||
129 | if (!vendor) | ||
130 | vendor = ""; | ||
131 | product = dmi_get_system_info(DMI_PRODUCT_NAME); | ||
132 | if (!product) | ||
133 | product = ""; | ||
134 | |||
135 | /* Board Name is optional */ | ||
136 | board = dmi_get_system_info(DMI_BOARD_NAME); | ||
137 | |||
138 | printk(KERN_DEFAULT "Pid: %d, comm: %.20s %s %s %.*s %s %s%s%s\n", | ||
139 | current->pid, current->comm, print_tainted(), | ||
140 | init_utsname()->release, | ||
141 | (int)strcspn(init_utsname()->version, " "), | ||
142 | init_utsname()->version, | ||
143 | vendor, product, | ||
144 | board ? "/" : "", | ||
145 | board ? board : ""); | ||
146 | } | ||
147 | |||
148 | void flush_thread(void) | 124 | void flush_thread(void) |
149 | { | 125 | { |
150 | struct task_struct *tsk = current; | 126 | struct task_struct *tsk = current; |
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index b5a8905785e6..7305f7dfc7ab 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c | |||
@@ -84,8 +84,6 @@ void __show_regs(struct pt_regs *regs, int all) | |||
84 | savesegment(gs, gs); | 84 | savesegment(gs, gs); |
85 | } | 85 | } |
86 | 86 | ||
87 | show_regs_common(); | ||
88 | |||
89 | printk(KERN_DEFAULT "EIP: %04x:[<%08lx>] EFLAGS: %08lx CPU: %d\n", | 87 | printk(KERN_DEFAULT "EIP: %04x:[<%08lx>] EFLAGS: %08lx CPU: %d\n", |
90 | (u16)regs->cs, regs->ip, regs->flags, | 88 | (u16)regs->cs, regs->ip, regs->flags, |
91 | smp_processor_id()); | 89 | smp_processor_id()); |
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 0f49677da51e..355ae06dbf94 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
@@ -62,7 +62,6 @@ void __show_regs(struct pt_regs *regs, int all) | |||
62 | unsigned int fsindex, gsindex; | 62 | unsigned int fsindex, gsindex; |
63 | unsigned int ds, cs, es; | 63 | unsigned int ds, cs, es; |
64 | 64 | ||
65 | show_regs_common(); | ||
66 | printk(KERN_DEFAULT "RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip); | 65 | printk(KERN_DEFAULT "RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip); |
67 | printk_address(regs->ip, 1); | 66 | printk_address(regs->ip, 1); |
68 | printk(KERN_DEFAULT "RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, | 67 | printk(KERN_DEFAULT "RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 4689855c2f8a..56f7fcfe7fa2 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -996,6 +996,7 @@ void __init setup_arch(char **cmdline_p) | |||
996 | efi_init(); | 996 | efi_init(); |
997 | 997 | ||
998 | dmi_scan_machine(); | 998 | dmi_scan_machine(); |
999 | dmi_set_dump_stack_arch_desc(); | ||
999 | 1000 | ||
1000 | /* | 1001 | /* |
1001 | * VMware detection requires dmi to be available, so this | 1002 | * VMware detection requires dmi to be available, so this |
diff --git a/arch/x86/lib/usercopy_32.c b/arch/x86/lib/usercopy_32.c index f0312d746402..3eb18acd0e40 100644 --- a/arch/x86/lib/usercopy_32.c +++ b/arch/x86/lib/usercopy_32.c | |||
@@ -689,9 +689,3 @@ _copy_from_user(void *to, const void __user *from, unsigned long n) | |||
689 | return n; | 689 | return n; |
690 | } | 690 | } |
691 | EXPORT_SYMBOL(_copy_from_user); | 691 | EXPORT_SYMBOL(_copy_from_user); |
692 | |||
693 | void copy_from_user_overflow(void) | ||
694 | { | ||
695 | WARN(1, "Buffer overflow detected!\n"); | ||
696 | } | ||
697 | EXPORT_SYMBOL(copy_from_user_overflow); | ||
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c index 923db5c15278..458186dab5dc 100644 --- a/arch/xtensa/kernel/traps.c +++ b/arch/xtensa/kernel/traps.c | |||
@@ -383,6 +383,8 @@ void show_regs(struct pt_regs * regs) | |||
383 | { | 383 | { |
384 | int i, wmask; | 384 | int i, wmask; |
385 | 385 | ||
386 | show_regs_print_info(KERN_DEFAULT); | ||
387 | |||
386 | wmask = regs->wmask & ~1; | 388 | wmask = regs->wmask & ~1; |
387 | 389 | ||
388 | for (i = 0; i < 16; i++) { | 390 | for (i = 0; i < 16; i++) { |
@@ -481,14 +483,6 @@ void show_stack(struct task_struct *task, unsigned long *sp) | |||
481 | show_trace(task, stack); | 483 | show_trace(task, stack); |
482 | } | 484 | } |
483 | 485 | ||
484 | void dump_stack(void) | ||
485 | { | ||
486 | show_stack(current, NULL); | ||
487 | } | ||
488 | |||
489 | EXPORT_SYMBOL(dump_stack); | ||
490 | |||
491 | |||
492 | void show_code(unsigned int *pc) | 486 | void show_code(unsigned int *pc) |
493 | { | 487 | { |
494 | long i; | 488 | long i; |