From: Andi Kleen Date: Fri, 28 Jul 2006 12:44:42 +0000 (+0200) Subject: [PATCH] i386/x86-64: Add user_mode checks to profile_pc for oprofile X-Git-Tag: v2.6.18-rc3~22 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5a2601734bcc740ee78dc4cb0c56b5687da7bd9;p=pandora-kernel.git [PATCH] i386/x86-64: Add user_mode checks to profile_pc for oprofile Fixes a obscure user space triggerable crash during oprofiling. Oprofile calls profile_pc from NMIs even when user_mode(regs) is not true and the program counter is inside the kernel lock section. This opens a race - when a user program jumps to a kernel lock address and a NMI happens before the illegal page fault exception is raised and the program has a unmapped esp or ebp then the kernel could oops. NMIs have a higher priority than exceptions so that could happen. Add user_mode checks to i386/x86-64 profile_pc to prevent that. Cc: John Levon Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed