From: Andrew Cooper <andrew.cooper3@citrix.com>
To: xin@zytor.com
Cc: bp@alien8.de, brgerst@gmail.com, dave.hansen@linux.intel.com,
ebiederm@xmission.com, hpa@zytor.com,
linux-kernel@vger.kernel.org, mingo@redhat.com,
tglx@linutronix.de, x86@kernel.org,
Andy Lutomirski <luto@kernel.org>
Subject: Re: [PATCH v2 1/1] x86/ia32: Normalize any null selector value to 0
Date: Wed, 20 Nov 2024 09:33:41 +0000 [thread overview]
Message-ID: <3680972b-1871-4c92-9f61-c28ef7c10a4c@citrix.com> (raw)
In-Reply-To: <20241120081721.2838905-1-xin@zytor.com>
> The first GDT descriptor is reserved as 'null descriptor'. As bits 0
> and 1 of a segment selector, i.e., the DPL bits, are NOT used to index
That's RPL in segment selector, not DPL. Same correction is needed in
the code comments.
> GDT, selector values 0~3 all point to the null descriptor, thus values
> 0, 1, 2 and 3 are all valid null selector values.
>
> Furthermore IRET zeros ES, FS, GS, and DS segment registers if any of
> them is found to have any null selector value, essentially making 0 a
> preferred null selector value.
Zeroing of RPL in null selectors is an information leak in pre-FRED
systems. Userspace can spot any interrupt/exception by loading a
nonzero NULL selector, and waiting for it to drop to zero.
Userspace should not be able to do this; Andy and I lobbied for this
during the design of FRED, and Intel agreed.
Right now, this change is codifying the problem behaviour we were trying
to fix out under FRED.
Under FRED, if userspace loads e.g. 2 into a selector, it should remain
2 until userspace changes it to something else.
~Andrew
next prev parent reply other threads:[~2024-11-20 9:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-20 8:17 Xin Li (Intel)
2024-11-20 9:33 ` Andrew Cooper [this message]
2024-11-20 19:09 ` Xin Li
2024-11-20 19:34 ` Andrew Cooper
2024-11-21 3:54 ` Xin Li
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=3680972b-1871-4c92-9f61-c28ef7c10a4c@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dave.hansen@linux.intel.com \
--cc=ebiederm@xmission.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xin@zytor.com \
/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®