]> git.baikalelectronics.ru Git - kernel.git/commit
x86, vm86: fix preemption bug
authorThomas Gleixner <tglx@linutronix.de>
Tue, 13 Jan 2009 22:36:34 +0000 (23:36 +0100)
committerIngo Molnar <mingo@elte.hu>
Sun, 15 Feb 2009 09:46:13 +0000 (10:46 +0100)
commit8a2585db648317c6b094ddb46866cb199748094c
treeb814b0298bf34c0ee59db1bc29192f55c7e59bdd
parentea2ac0099e35a5565e71f477f1470c4660187aa9
x86, vm86: fix preemption bug

Commit 1740dfd5381181d3d86e89e9006766807d0bfed9 ("x86, traps: converge
do_debug handlers") changed the preemption disable logic of do_debug()
so vm86_handle_trap() is called with preemption disabled resulting in:

 BUG: sleeping function called from invalid context at include/linux/kernel.h:155
 in_atomic(): 1, irqs_disabled(): 0, pid: 3005, name: dosemu.bin
 Pid: 3005, comm: dosemu.bin Tainted: G        W  2.6.29-rc1 #51
 Call Trace:
  [<c050d669>] copy_to_user+0x33/0x108
  [<c04181f4>] save_v86_state+0x65/0x149
  [<c0418531>] handle_vm86_trap+0x20/0x8f
  [<c064e345>] do_debug+0x15b/0x1a4
  [<c064df1f>] debug_stack_correct+0x27/0x2c
  [<c040365b>] sysenter_do_call+0x12/0x2f
 BUG: scheduling while atomic: dosemu.bin/3005/0x10000001

Restore the original calling convention and reenable preemption before
calling handle_vm86_trap().

Reported-by: Michal Suchanek <hramrach@centrum.cz>
Cc: stable@kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/traps.c