1
0
Fork 0
alistair23-linux/arch
Frédéric Weisbecker ac2b86fdef x86/ftrace: use uaccess in atomic context
With latest -tip I get this bug:

[   49.439988] in_atomic():0, irqs_disabled():1
[   49.440118] INFO: lockdep is turned off.
[   49.440118] Pid: 2814, comm: modprobe Tainted: G        W 2.6.27-rc7 #4
[   49.440118]  [<c01215e1>] __might_sleep+0xe1/0x120
[   49.440118]  [<c01148ea>] ftrace_modify_code+0x2a/0xd0
[   49.440118]  [<c01148a2>] ? ftrace_test_p6nop+0x0/0xa
[   49.440118]  [<c016e80e>] __ftrace_update_code+0xfe/0x2f0
[   49.440118]  [<c01148a2>] ? ftrace_test_p6nop+0x0/0xa
[   49.440118]  [<c016f190>] ftrace_convert_nops+0x50/0x80
[   49.440118]  [<c016f1d6>] ftrace_init_module+0x16/0x20
[   49.440118]  [<c015498b>] load_module+0x185b/0x1d30
[   49.440118]  [<c01767a0>] ? find_get_page+0x0/0xf0
[   49.440118]  [<c02463c0>] ? sprintf+0x0/0x30
[   49.440118]  [<c034e012>] ? mutex_lock_interruptible_nested+0x1f2/0x350
[   49.440118]  [<c0154eb3>] sys_init_module+0x53/0x1b0
[   49.440118]  [<c0352340>] ? do_page_fault+0x0/0x740
[   49.440118]  [<c0104012>] syscall_call+0x7/0xb
[   49.440118]  =======================

It is because ftrace_modify_code() calls copy_to_user and
copy_from_user.
These functions have been inserted after guessing that there
couldn't be any race condition but copy_[to/from]_user might
sleep and __ftrace_update_code is called with local_irq_saved.

These function have been inserted since this commit:
d5e92e8978fd2574e415dc2792c5eb592978243d:
"ftrace: x86 use copy from user function"

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-10-14 10:38:16 +02:00
..
alpha kernel/cpu.c: create a CPU_STARTING cpu_chain notifier 2008-09-08 19:25:24 +02:00
arm Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog 2008-10-12 11:51:32 -07:00
avr32 avr32: Fix build failures in board code 2008-10-12 16:13:28 +02:00
blackfin Blackfin Serial Driver: Fix bug - request UART2/3 peripheral mapped interrupts in PIO mode 2008-10-13 09:51:38 -07:00
cris kernel/cpu.c: create a CPU_STARTING cpu_chain notifier 2008-09-08 19:25:24 +02:00
frv FRV: Wire up new system calls 2008-08-01 13:03:49 -07:00
h8300 [h8300] move include/asm-h8300 to arch/h8300/include/asm 2008-08-13 14:26:32 -07:00
ia64 Merge branch 'x86/urgent' into core/signal 2008-10-12 11:32:17 +02:00
m32r Merge branches 'sched/devel', 'sched/cpu-hotplug', 'sched/cpusets' and 'sched/urgent' into sched/core 2008-10-08 11:31:02 +02:00
m68k m68k: Update defconfigs for 2.6.27-rc6 2008-09-10 14:15:29 -07:00
m68knommu m68k{,nommu}: Wire up new system calls 2008-08-11 10:37:34 -07:00
mips MIPS: RB532: provide GPIO_BUILTIN_NR and irq_to_gpio/gpio_to_irq 2008-10-11 16:18:57 +01:00
mn10300 MN10300: Fix IRQ handling 2008-10-01 09:40:43 -07:00
parisc lib: Correct printk %pF to work on all architectures 2008-09-09 11:51:15 -07:00
powerpc Merge branch 'x86/urgent' into core/signal 2008-10-12 11:32:17 +02:00
s390 Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2008-10-11 08:50:01 -07:00
sh kernel/cpu.c: create a CPU_STARTING cpu_chain notifier 2008-09-08 19:25:24 +02:00
sparc serial: allow 8250 to be used on sparc 2008-10-13 09:51:40 -07:00
sparc64 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 2008-10-11 12:39:35 -07:00
um uml: small cleanups and note bugs to be dealt with by uml authors... 2008-10-13 09:51:40 -07:00
x86 x86/ftrace: use uaccess in atomic context 2008-10-14 10:38:16 +02:00
xtensa remove unneeded #include <linux/ide.h>'s 2008-08-05 18:17:00 +02:00
.gitignore
Kconfig Merge branch 'linus' into oprofile-v2 2008-10-13 11:05:51 +02:00