lkml.org 
[lkml]   [2017]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCHv3] x86/selftests: add clobbers for int80 on x86_64
From
On February 13, 2017 11:06:04 AM PST, Andy Lutomirski <luto@amacapital.net> wrote:
>On Mon, Feb 13, 2017 at 2:13 AM, Dmitry Safonov
><dsafonov@virtuozzo.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@kernel.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

If we can do so that cheaply I think we should.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

\
 
 \ /
  Last update: 2017-02-13 23:19    [W:0.130 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site