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]
Message-ID: <CALCETrXuN3zOTKTScas+Tj=7Xzm_DTEDyuL-toxp=4+i-=HX6w@mail.gmail.com>
Date:   Mon, 13 Feb 2017 11:06:04 -0800
From:   Andy Lutomirski <luto@...capital.net>
To:     Dmitry Safonov <dsafonov@...tuozzo.com>
Cc:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Dmitry Safonov <0x7f454c46@...il.com>,
        Shuah Khan <shuah@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        Andy Lutomirski <luto@...nel.org>,
        Borislav Petkov <bp@...e.de>, X86 ML <x86@...nel.org>,
        "open list:KERNEL SELFTEST FRAMEWORK" 
        <linux-kselftest@...r.kernel.org>
Subject: Re: [PATCHv3] x86/selftests: add clobbers for int80 on x86_64

On Mon, Feb 13, 2017 at 2:13 AM, Dmitry Safonov <dsafonov@...tuozzo.com> wrote:
> Kernel erases R8..R11 registers prior returning to userspace
> from int80: https://lkml.org/lkml/2009/10/1/164
>
> GCC can reuse this registers and doesn't expect them to change
> during syscall invocation. I met this kind of bug in CRIU once
> gcc 6.1 and clang stored local variables in those registers
> and the kernel zerofied them during syscall:
> https://github.com/xemul/criu/commit/990d33f1a1cdd17bca6c2eb059ab3be2564f7fa2
>
> By that reason I suggest to add those registers to clobbers
> in selftests.  Also, as notted by Andy - removed unneeded clobber
> for flags in int 0x80 inline asm.

Acked-by: Andy Lutomirski <luto@...nel.org>

Although these days we could preserve these regs in the kernel at the
cost of (I think) 4 bytes of text and zero runtime overhead.

--Andy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ