Skip to content

Commit 4f61f84

Browse files
committed
Merge tag 'perf-urgent-2022-08-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 kprobes fix from Ingo Molnar: "Fix a kprobes bug in JNG/JNLE emulation when a kprobe is installed at such instructions, possibly resulting in incorrect execution (the wrong branch taken)" * tag 'perf-urgent-2022-08-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/kprobes: Fix JNG/JNLE emulation
2 parents 7fb312d + 8924779 commit 4f61f84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/kprobes/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ static void kprobe_emulate_jcc(struct kprobe *p, struct pt_regs *regs)
505505
match = ((regs->flags & X86_EFLAGS_SF) >> X86_EFLAGS_SF_BIT) ^
506506
((regs->flags & X86_EFLAGS_OF) >> X86_EFLAGS_OF_BIT);
507507
if (p->ainsn.jcc.type >= 0xe)
508-
match = match && (regs->flags & X86_EFLAGS_ZF);
508+
match = match || (regs->flags & X86_EFLAGS_ZF);
509509
}
510510
__kprobe_emulate_jmp(p, regs, (match && !invert) || (!match && invert));
511511
}

0 commit comments

Comments
 (0)