diff options
author | Borislav Petkov <bp@suse.de> | 2020-11-17 15:26:12 +0100 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2021-03-15 12:05:03 +0100 |
commit | 88afc23922137cd3efdb0f0b6722785c9f6a35eb (patch) | |
tree | c05b5e83c8f6380fc92b83453a10829d78a2f5a6 /arch/x86/kernel/uprobes.c | |
parent | x86/traps: Convert to insn_decode() (diff) | |
download | linux-88afc23922137cd3efdb0f0b6722785c9f6a35eb.tar.xz linux-88afc23922137cd3efdb0f0b6722785c9f6a35eb.zip |
x86/uprobes: Convert to insn_decode()
Simplify code, no functional changes.
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210304174237.31945-16-bp@alien8.de
Diffstat (limited to 'arch/x86/kernel/uprobes.c')
-rw-r--r-- | arch/x86/kernel/uprobes.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c index a2b413394917..b63cf8f7745e 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)) |