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]
Date:   Tue, 2 Mar 2021 14:58:01 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Masami Hiramatsu <mhiramat@...nel.org>
Cc:     Andy Lutomirski <luto@...nel.org>, Ingo Molnar <mingo@...nel.org>,
        Oleg Nesterov <oleg@...hat.com>,
        LKML <linux-kernel@...r.kernel.org>,
        Anil S Keshavamurthy <anil.s.keshavamurthy@...el.com>,
        "David S . Miller" <davem@...emloft.net>, X86 ML <x86@...nel.org>,
        Andrew Cooper <andrew.cooper3@...rix.com>,
        Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [RFC PATCH 1/1] x86/kprobes: Use int3 instead of debug trap for
 single-step

On Tue, Mar 02, 2021 at 09:54:43AM +0100, Peter Zijlstra wrote:


> +static void kprobe_emulate_jcc(struct kprobe *p, struct pt_regs *regs)
> +{
> +	bool invert = p->ainsn.jcc.type & 1;
> +	bool match;
> +
> +	if (p->ainsn.jcc.type < 0xc) {
> +		match = regs->flags & jcc_mask[p->ainsn.jcc.type >> 1];
> +	} else {
> +		match = ((regs->flags & X86_EFLAGS_SF) >> X86_EFLAGS_SF_BIT) ^
> +			((regs->flags & X86_EFLAGS_OF) >> X86_EFLAGS_OF_BIT);
> +		if (p->ainsn.jcc.type >= 0xe)
> +			match = match && (regs->flags & X86_EFLAGS_ZF);
> +	}
> +	__kprobe_emulate_jmp(p, regs, (match && !invert) || (!match && invert));

Also, isn't that: 'match ^ invert' ?

> +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ