aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/Kconfig1
-rw-r--r--arch/x86/Kconfig.debug14
-rw-r--r--arch/x86/ia32/ia32_aout.c1
-rw-r--r--arch/x86/include/asm/bug.h3
-rw-r--r--arch/x86/kernel/dumpstack.c28
-rw-r--r--arch/x86/kernel/dumpstack_32.c4
-rw-r--r--arch/x86/kernel/dumpstack_64.c6
-rw-r--r--arch/x86/kernel/process.c24
-rw-r--r--arch/x86/kernel/process_32.c2
-rw-r--r--arch/x86/kernel/process_64.c1
-rw-r--r--arch/x86/kernel/setup.c1
-rw-r--r--arch/x86/lib/usercopy_32.c6
12 files changed, 15 insertions, 76 deletions
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
21config X86 21config 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
295config 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
309config DEBUG_NMI_SELFTEST 295config 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
41extern 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
177void show_stack(struct task_struct *task, unsigned long *sp) 177void 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 */
185void 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}
198EXPORT_SYMBOL(dump_stack);
199 193
200static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED; 194static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED;
201static int die_owner = -1; 195static 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
124void 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
148void flush_thread(void) 124void 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}
691EXPORT_SYMBOL(_copy_from_user); 691EXPORT_SYMBOL(_copy_from_user);
692
693void copy_from_user_overflow(void)
694{
695 WARN(1, "Buffer overflow detected!\n");
696}
697EXPORT_SYMBOL(copy_from_user_overflow);