lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Mon, 17 Dec 2007 13:27:01 -0800
From:	Harvey Harrison <harvey.harrison@...il.com>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Ananth N Mavinakayanahalli <ananth@...ibm.com>,
	Jim Keniston <jkenisto@...ibm.com>,
	Roland McGrath <roland@...hat.com>,
	Arjan van de Ven <arjan@...radead.org>,
	prasanna@...ibm.com, anil.s.keshavamurthy@...el.com,
	davem@...emloft.net, systemtap-ml <systemtap@...rces.redhat.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH 2/4] x86: kprobe cleanup resume_execution

This patch cleans up and fixes bugs in resume_execution on x86-64.
Kprobes for x86-64 may cause a kernel crash if it inserted on "iret"
instruction.

"call absolute" case 0x9a is invalid on x86-64, so we don't need
treat it, leave it ifdef X86_32.

 - Add "iret"(0xcf) case.to X86_64
 - Fold jmp absolute (0xea) handling into iret/ret/lret handling

Based on patch from Masami Hiramatsu <mhiramat@...hat.com>

Signed-off-by: Harvey Harrison <harvey.harrison@...il.com>
---
 arch/x86/kernel/kprobes.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index 9130c01..64c702c 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -748,12 +748,13 @@ static void __kprobes resume_execution(struct kprobe *p,
 		*tos &= ~(TF_MASK | IF_MASK);
 		*tos |= kcb->kprobe_old_flags;
 		break;
-	case 0xc2:		/* ret/lret */
+	case 0xc2:		/* iret/ret/lret */
 	case 0xc3:
 	case 0xca:
 	case 0xcb:
+	case 0xcf:
+	case 0xea:		/* jmp absolute -- ip is correct */
 #ifdef CONFIG_X86_32
-	case 0xcf:		/* iret */
 		/* ip is already adjusted, no more changes required */
 		p->ainsn.boostable = 1;
 #endif
@@ -783,12 +784,6 @@ static void __kprobes resume_execution(struct kprobe *p,
 			goto no_change;
 		}
 		break;
-	case 0xea:		/* jmp absolute -- ip is correct */
-#ifdef CONFIG_X86_32
-		/* ip is already adjusted, no more changes required */
-		p->ainsn.boostable = 1;
-#endif
-		goto no_change;
 	default:
 		break;
 	}
-- 
1.5.4.rc0.1083.gf568


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ