提交 c56716af 编写于 作者: A Andy Lutomirski 提交者: Ingo Molnar

x86/asm/entry, perf: Fix incorrect TIF_IA32 check in code_segment_base()

We want to check whether user code is in 32-bit mode, not
whether the task is nominally 32-bit.
Signed-off-by: NAndy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brad Spengler <spender@grsecurity.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/33e5107085ce347a8303560302b15c2cadd62c4c.1426728647.git.luto@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 d31bf07f
...@@ -2161,10 +2161,9 @@ static unsigned long code_segment_base(struct pt_regs *regs) ...@@ -2161,10 +2161,9 @@ static unsigned long code_segment_base(struct pt_regs *regs)
if (user_mode(regs) && regs->cs != __USER_CS) if (user_mode(regs) && regs->cs != __USER_CS)
return get_segment_base(regs->cs); return get_segment_base(regs->cs);
#else #else
if (test_thread_flag(TIF_IA32)) { if (user_mode(regs) && !user_64bit_mode(regs) &&
if (user_mode(regs) && regs->cs != __USER32_CS) regs->cs != __USER32_CS)
return get_segment_base(regs->cs); return get_segment_base(regs->cs);
}
#endif #endif
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册