[Devel] [PATCH RHEL7 COMMIT] ms/x86/asm/traps: Disable tracing and kprobes in fixup_bad_iret and sync_regs
Konstantin Khorenko
khorenko at virtuozzo.com
Tue Oct 16 15:29:42 MSK 2018
The commit is pushed to "branch-rh7-3.10.0-862.14.4.vz7.72.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.14.4.vz7.72.8
------>
commit 97d01ebf575f2d544bc81efa32c28c0386c75b67
Author: Andy Lutomirski <luto at amacapital.net>
Date: Tue Oct 16 15:29:39 2018 +0300
ms/x86/asm/traps: Disable tracing and kprobes in fixup_bad_iret and sync_regs
These functions can be executed on the int3 stack, so kprobes
are dangerous. Tracing is probably a bad idea, too.
Fixes: b645af2d5905 ("x86_64, traps: Rework bad_iret")
Signed-off-by: Andy Lutomirski <luto at amacapital.net>
Cc: <stable at vger.kernel.org> # Backport as far back as it would apply
Cc: Linus Torvalds <torvalds at linux-foundation.org>
Cc: Steven Rostedt <rostedt at goodmis.org>
Link: http://lkml.kernel.org/r/50e33d26adca60816f3ba968875801652507d0c4.1416870125.git.luto@amacapital.net
Signed-off-by: Ingo Molnar <mingo at kernel.org>
(cherry picked from commit 7ddc6a2199f1da405a2fb68c40db8899b1a8cd87)
Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
arch/x86/kernel/traps.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index ec2bafb12afa..0f57b2a3ddc9 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -444,7 +444,7 @@ dotraplinkage void __kprobes notrace do_int3(struct pt_regs *regs, long error_co
* for scheduling or signal handling. The actual stack switch is done in
* entry.S
*/
-asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs)
+asmlinkage __kprobes notrace struct pt_regs *sync_regs(struct pt_regs *eregs)
{
struct pt_regs *regs = eregs;
/* Did already sync */
@@ -469,7 +469,7 @@ struct bad_iret_stack {
struct pt_regs regs;
};
-asmlinkage __visible
+asmlinkage __visible __kprobes notrace
struct bad_iret_stack *fixup_bad_iret(struct bad_iret_stack *s)
{
/*
More information about the Devel
mailing list