[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <161582326565.398.12323407900667724874.tip-bot2@tip-bot2>
Date: Mon, 15 Mar 2021 15:47:45 -0000
From: "tip-bot2 for Borislav Petkov" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Borislav Petkov <bp@...e.de>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: x86/core] x86/uprobes: Convert to insn_decode()
The following commit has been merged into the x86/core branch of tip:
Commit-ID: 88afc23922137cd3efdb0f0b6722785c9f6a35eb
Gitweb: https://git.kernel.org/tip/88afc23922137cd3efdb0f0b6722785c9f6a35eb
Author: Borislav Petkov <bp@...e.de>
AuthorDate: Tue, 17 Nov 2020 15:26:12 +01:00
Committer: Borislav Petkov <bp@...e.de>
CommitterDate: Mon, 15 Mar 2021 12:05:03 +01:00
x86/uprobes: Convert to insn_decode()
Simplify code, no functional changes.
Signed-off-by: Borislav Petkov <bp@...e.de>
Link: https://lkml.kernel.org/r/20210304174237.31945-16-bp@alien8.de
---
arch/x86/kernel/uprobes.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
index a2b4133..b63cf8f 100644
--- a/arch/x86/kernel/uprobes.c
+++ b/arch/x86/kernel/uprobes.c
@@ -276,12 +276,12 @@ static bool is_prefix_bad(struct insn *insn)
static int uprobe_init_insn(struct arch_uprobe *auprobe, struct insn *insn, bool x86_64)
{
+ enum insn_mode m = x86_64 ? INSN_MODE_64 : INSN_MODE_32;
u32 volatile *good_insns;
+ int ret;
- insn_init(insn, auprobe->insn, sizeof(auprobe->insn), x86_64);
- /* has the side-effect of processing the entire instruction */
- insn_get_length(insn);
- if (!insn_complete(insn))
+ ret = insn_decode(insn, auprobe->insn, sizeof(auprobe->insn), m);
+ if (ret < 0)
return -ENOEXEC;
if (is_prefix_bad(insn))
Powered by blists - more mailing lists