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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140408192600.GA6690@redhat.com>
Date:	Tue, 8 Apr 2014 21:26:00 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc:	Jim Keniston <jkenisto@...ux.vnet.ibm.com>,
	Ingo Molnar <mingo@...e.hu>,
	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
	Ananth N Mavinakayanahalli <ananth@...ibm.com>,
	Anton Arapov <aarapov@...hat.com>,
	David Long <dave.long@...aro.org>,
	Denys Vlasenko <dvlasenk@...hat.com>,
	"Frank Ch. Eigler" <fche@...hat.com>,
	Jonathan Lebon <jlebon@...hat.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 0/6] uprobes/x86: fix the reprel jmp/call handling

On 04/08, Oleg Nesterov wrote:
>
> OK... bu I'm afraid I'll ask a stupid question before I update this
> series accordinly.

And I guess I should also use insn_offset_immediate() in ttt_clear_displacement().
Which should be renamed, but I have no idea how.

OK. Unless I am totally confused (very possible) the necessary changes are
trivial. I do not want to spam lkml, so let me just show the cumulative diff
(1/6 and 4/6 should be trivially updated).

Anything else I missed?

Lets ignore j*cxz. I tried to read the intel docs and it seems that this
insn is always rel8, so we do not need to emulate it to fix the problem.
But I'll make the "Emulate j*cxz" later anyway, just for completeness.

Oleg.

diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
index dae02f9..f0a8afa 100644
--- a/arch/x86/kernel/uprobes.c
+++ b/arch/x86/kernel/uprobes.c
@@ -562,8 +562,8 @@ static void ttt_clear_displacement(struct arch_uprobe *auprobe, struct insn *ins
 	 * divorce ->insn[] and ->ixol[]. We need to preserve the 1st byte
 	 * of ->insn[] for set_orig_insn().
 	 */
-	memset(auprobe->insn + insn_offset_displacement(insn),
-		0, insn->moffset1.nbytes);
+	memset(auprobe->insn + insn_offset_immediate(insn),
+		0, insn->immediate.nbytes);
 }
 
 static struct uprobe_xol_ops ttt_xol_ops = {
@@ -602,10 +602,7 @@ static int ttt_setup_xol_ops(struct arch_uprobe *auprobe, struct insn *insn)
 	}
 
 	auprobe->ttt.ilen = insn->length;
-	auprobe->ttt.disp = insn->moffset1.value;
-	/* so far we assume that it fits into ->moffset1 */
-	if (WARN_ON_ONCE(insn->moffset2.nbytes))
-		return -ENOEXEC;
+	auprobe->ttt.disp = insn->immediate.value;
 
 	auprobe->ops = &ttt_xol_ops;
 	return 0;

--
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