From: Dmitry Safonov <dsafonov@virtuozzo.com>
To: <linux-kernel@vger.kernel.org>
Cc: <0x7f454c46@gmail.com>, Shuah Khan <shuah@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
Andy Lutomirski <luto@kernel.org>, Borislav Petkov <bp@suse.de>,
<x86@kernel.org>, <linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH] x86/selftests: add clobbers for int80 on x86_64
Date: Fri, 10 Feb 2017 14:57:04 +0300 [thread overview]
Message-ID: <7a66c421-df7a-c3e5-c40d-a04a796cc545@virtuozzo.com> (raw)
In-Reply-To: <20170210115239.29256-1-dsafonov@virtuozzo.com>
On 02/10/2017 02:52 PM, Dmitry Safonov 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.
>
> Cc: Shuah Khan <shuah@kernel.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: Andy Lutomirski <luto@kernel.org>
> Cc: Borislav Petkov <bp@suse.de>
> Cc: x86@kernel.org
> Cc: linux-kselftest@vger.kernel.org
> Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
> ---
> tools/testing/selftests/x86/fsgsbase.c | 2 +-
> tools/testing/selftests/x86/iopl.c | 10 ++++++++--
Drop this one: iopl doesn't do int80 - it's my failure in grepping.
Will resend.
> tools/testing/selftests/x86/ldt_gdt.c | 16 +++++++++++-----
> tools/testing/selftests/x86/ptrace_syscall.c | 3 ++-
> tools/testing/selftests/x86/single_step_syscall.c | 5 ++++-
> 5 files changed, 26 insertions(+), 10 deletions(-)
>
--
Dmitry
next prev parent reply other threads:[~2017-02-10 12:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-10 11:52 Dmitry Safonov
2017-02-10 11:57 ` Dmitry Safonov [this message]
2017-02-10 16:13 ` Andy Lutomirski
2017-02-10 16:28 ` Dmitry Safonov
2017-02-10 16:45 ` Andy Lutomirski
2017-02-10 17:11 ` Dmitry Safonov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7a66c421-df7a-c3e5-c40d-a04a796cc545@virtuozzo.com \
--to=dsafonov@virtuozzo.com \
--cc=0x7f454c46@gmail.com \
--cc=bp@suse.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=shuah@kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®