linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: Andy Lutomirski <luto@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	"security@kernel.org" <security@kernel.org>,
	X86 ML <x86@kernel.org>, Borislav Petkov <bp@alien8.de>,
	Sasha Levin <sasha.levin@oracle.com>,
	linux-kernel@vger.kernel.org,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH v2 3/3] selftests/x86, x86/ldt: Add a selftest for modify_ldt
Date: Wed, 22 Jul 2015 01:36:53 +0200	[thread overview]
Message-ID: <20150721233653.GO1063@1wt.eu> (raw)
In-Reply-To: <d9ca450f3114a39e1287138cbbdb89d19ba896e3.1437508486.git.luto@kernel.org>

Hi Andy,

On Tue, Jul 21, 2015 at 12:59:31PM -0700, Andy Lutomirski wrote:
> This tests general modify_ldt behavior (only writes, so far) as
> well as synchronous updates via IPI.  It fails on old kernels.
> 
> I called this ldt_gdt because I'll add set_thread_area tests to
> it at some point.

Quick feedback : at two places you have this :

> +	} else if (errno == ENOSYS) {
> +		printf("[OK]\tmodify_ldt is returned -ENOSYS\n");

=> s/is //

Please add stdlib.h to avoid this warning I'm getting on 32-bit :

ldt_gdt.c:286:4: warning: incompatible implicit declaration of built-in function 'exit' [enabled by default]

And I had to remove xmmintrinsic as suggested by Boris as well.


FWIW here's what I'm getting here on 4.1.2 without CONFIG_X86_16BIT
(where nmi_espfix failed), the output is the same for a 32- and a 64-bit
process :

[OK]    LDT entry 0 has AR 0x0040FA00 and limit 0x0000000A
[OK]    LDT entry 0 has AR 0x00C0FA00 and limit 0x0000AFFF
[OK]    LDT entry 1 is invalid
[OK]    LDT entry 2 has AR 0x00C0FA00 and limit 0x0000AFFF
[OK]    LDT entry 1 is invalid
[OK]    LDT entry 2 has AR 0x00C0FA00 and limit 0x0000AFFF
[OK]    LDT entry 2 has AR 0x00D0FA00 and limit 0x0000AFFF
[OK]    LDT entry 2 has AR 0x00D07A00 and limit 0x0000AFFF
[OK]    modify_ldt rejected 16 bit segment
[OK]    LDT entry 2 has AR 0x00D07200 and limit 0x0000AFFF
[OK]    LDT entry 2 has AR 0x00D07000 and limit 0x0000AFFF
[OK]    LDT entry 2 has AR 0x00D07400 and limit 0x0000AFFF
[OK]    LDT entry 2 has AR 0x00507600 and limit 0x0000000A
[OK]    LDT entry 2 has AR 0x00507E00 and limit 0x0000000A
[OK]    LDT entry 2 has AR 0x00507C00 and limit 0x0000000A
[OK]    LDT entry 2 has AR 0x00507A00 and limit 0x0000000A
[OK]    LDT entry 2 has AR 0x00507800 and limit 0x0000000A
[OK]    LDT entry 2 has AR 0x00507800 and limit 0x0000000A
[RUN]   Test fork
[OK]    LDT entry 2 has AR 0x00507800 and limit 0x0000000A
[OK]    LDT entry 1 is invalid
[OK]    Child succeeded
[OK]    modify_ldt failure 22
[OK]    modify_ldt rejected 16 bit segment
[OK]    modify_ldt rejected 16 bit segment
[OK]    modify_ldt rejected 16 bit segment
[OK]    modify_ldt rejected 16 bit segment
[OK]    modify_ldt rejected 16 bit segment
[OK]    modify_ldt rejected 16 bit segment
[OK]    LDT entry 0 is invalid
[OK]    LDT entry 0 has AR 0x0040F200 and limit 0x00000000
[OK]    LDT entry 0 is invalid
[RUN]   Cross-CPU LDT invalidation
[FAIL]  5 of 5 iterations failed

Thanks,
Willy


  parent reply	other threads:[~2015-07-21 23:37 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-21 19:59 [PATCH v2 0/3] x86: modify_ldt improvement, test, and config option Andy Lutomirski
2015-07-21 19:59 ` [PATCH v2 1/3] x86/ldt: Make modify_ldt synchronous Andy Lutomirski
2015-07-21 21:53   ` Boris Ostrovsky
2015-07-21 23:38     ` Andrew Cooper
2015-07-22  0:07       ` Andy Lutomirski
2015-07-22  0:21         ` Andrew Cooper
2015-07-22  0:28           ` Andy Lutomirski
2015-07-22  0:49             ` Andrew Cooper
2015-07-22  1:06               ` Andy Lutomirski
2015-07-22  2:04               ` [Xen-devel] " Boris Ostrovsky
2015-07-22  2:13                 ` Andy Lutomirski
2015-07-22  2:01   ` Brian Gerst
2015-07-22  2:12     ` Andy Lutomirski
2015-07-22  2:53       ` Brian Gerst
2015-07-22  4:22         ` Andy Lutomirski
2015-07-21 19:59 ` [PATCH v2 2/3] x86/ldt: Make modify_ldt optional Andy Lutomirski
2015-07-21 20:20   ` Sasha Levin
2015-07-21 20:27     ` Andy Lutomirski
2015-07-21 20:28   ` Brian Gerst
2015-07-21 20:34     ` Andy Lutomirski
2015-07-21 20:54       ` Brian Gerst
2015-07-22  6:06       ` Ingo Molnar
2015-07-22  6:23         ` Andy Lutomirski
2015-07-22  6:27           ` Ingo Molnar
2015-07-22 18:49             ` Andy Lutomirski
2015-07-22 12:34           ` Willy Tarreau
2015-07-21 19:59 ` [PATCH v2 3/3] selftests/x86, x86/ldt: Add a selftest for modify_ldt Andy Lutomirski
2015-07-21 22:02   ` Boris Ostrovsky
2015-07-21 22:34     ` Andy Lutomirski
2015-07-21 23:36   ` Willy Tarreau [this message]
2015-07-21 23:40     ` Andy Lutomirski

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=20150721233653.GO1063@1wt.eu \
    --to=w@1wt.eu \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sasha.levin@oracle.com \
    --cc=security@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).