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:   Thu, 14 May 2020 14:33:02 +0200
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Andy Lutomirski <luto@...nel.org>
Cc:     LKML <linux-kernel@...r.kernel.org>, X86 ML <x86@...nel.org>,
        "Paul E. McKenney" <paulmck@...nel.org>,
        Andy Lutomirski <luto@...nel.org>,
        Alexandre Chartre <alexandre.chartre@...cle.com>,
        Frederic Weisbecker <frederic@...nel.org>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Sean Christopherson <sean.j.christopherson@...el.com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Petr Mladek <pmladek@...e.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Joel Fernandes <joel@...lfernandes.org>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        Juergen Gross <jgross@...e.com>,
        Brian Gerst <brgerst@...il.com>,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Will Deacon <will@...nel.org>
Subject: Re: [patch V4 part 3 17/29] x86/entry: Convert Invalid Opcode exception to IDTENTRY

Andy Lutomirski <luto@...nel.org> writes:

> On Tue, May 5, 2020 at 7:15 AM Thomas Gleixner <tglx@...utronix.de> wrote:
>>
>> From: Thomas Gleixner <tglx@...utronix.de>
>>
>> Convert #UD to IDTENTRY:
>>   - Implement the C entry point with DEFINE_IDTENTRY
>>   - Emit the ASM stub with DECLARE_IDTENTRY
>>   - Remove the ASM idtentry in 64bit
>>   - Remove the open coded ASM entry code in 32bit
>>   - Fixup the XEN/PV code
>>   - Fixup the FOOF bug call in fault.c
>>   - Remove the old prototyoes
>>
>> No functional change.
>
> I think there *is* a functional change:
>
>
>> --- a/arch/x86/mm/fault.c
>> +++ b/arch/x86/mm/fault.c
>> @@ -567,7 +567,7 @@ static int is_f00f_bug(struct pt_regs *r
>>                 nr = (address - idt_descr.address) >> 3;
>>
>>                 if (nr == 6) {
>> -                       do_invalid_op(regs, 0);
>> +                       handle_invalid_op(regs);
>
> I suspect the old code was wrong and no one noticed because no one has
> a F00F-buggy machine any more.

I don't think so. It's really just the same thing. The old #UD C
function was:

void do_invalid_op(struct pt_regs *regs, long error_code)
{
	do_error_trap(regs, error_code, "invalid opcode", X86_TRAP_UD,
                      SIGILL, ILL_ILLOPN, (void __user *)uprobe_get_trap_addr(regs));
}

after expanding the DO_ERROR() muck.

The new one does:

void handle_invalid_op(struct pt_regs *regs)
{
	do_error_trap(regs, 0, "invalid opcode", X86_TRAP_UD, SIGILL,
		      ILL_ILLOPN, error_get_trap_addr(regs));
}

which is exactly the same except for the error code being hardcoded to
zero in handle_invalid_op() because #UD does not have one.

> So maybe document that you fixed up the F00F bug, too.  Otherwise:

Not sure what to document :)

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ