From: Alexander Kleinsorge <aleks@physik.tu-berlin.de>
To: Tony Luck <tony.luck@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: proposal for meltdown-workaround with low overhead
Date: Fri, 05 Jan 2018 11:24:01 +0100 [thread overview]
Message-ID: <e6abec223ca77903615456ab203bd12b@physik.tu-berlin.de> (raw)
In-Reply-To: <CA+8MBbL_hW-RTqh2umb-u3nzo7P8B65=p+rhzjrTGrmtFe18Eg@mail.gmail.com>
Hi Tony,
at least in the original Paper ( meltdownattack.com/meltdown.pdf ) and
in Wikipedia ( en.wikipedia.org/wiki/Meltdown_(security_vulnerability) )
indicate, that the exception variant is the preferred choice (even if it
is also possible via branch prediction bending).
(I assume, that the exception variant is faster than the branch
prediction one.)
> "Hence there are no exceptions at all. " // Tony
--> Actually there are 2 variants: with and without exception! , while
the paper seems to tend to the exception one.
Perhaps splitting the 2 variants helps to find different (but more
specific and therefore easier) solutions for each of both.
At least the exception variant could be handled without any significant
performance loss (inside the OS exception handler only).
If Kernel would restrict high frequent forks or memory exceptions by
same user again+again, at least one variant is not a problem any more.
And even if we only slowed down this or any future attack, this is
already an improvement (at tiny implementation effort and no performance
cost).
meltdown.pdf :
Listing 1 "1 raise_exception(); 2 // the line below is never reached; 3
access(probe_array[data * 4096]);"
Figure 5: The Meltdown attack uses exception handling or suppression ..
Listing 2: The core instruction sequence of Meltdown.
An inaccessible kernel address is moved to a register,
raising an exception. The subsequent instructions are
already executed out of order before the exception is
raised, leaking the content of the kernel address through
the indirect memory access.
en.wikipedia.org :
"(this should be done with arithmetic instructions rather than branches
to avoid the branch predictor complicating matters)"
"and only annul their effects when the memory protection fault gets
detected some clock cycles later."
"So after the memory protection fault (which can be handled by a signal
handler, or allowed to crash the process if the attacker has previously
forked another process sharing the address space, or suppressed
altogether if the read attempt in step 2 is itself only speculative)"
Thanks for further comments,
Alexander
Am 2018-01-05 00:09, schrieb Tony Luck:
> On Thu, Jan 4, 2018 at 11:45 AM, Alexander Kleinsorge
> <aleks@physik.tu-berlin.de> wrote:
>> As Meltdown-Issue depends on allowing to cause many exceptions
>> (usually :
>> accessing an invalid address), we could restrict this misusage easy.
>
> The accesses to the invalid address are performed speculatively by the
> CPU in
> a code branch that is later found to be not taken. Hence there are no
> exceptions
> at all.
>
> -Tony
prev parent reply other threads:[~2018-01-05 10:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-04 19:45 Alexander Kleinsorge
2018-01-04 23:09 ` Tony Luck
2018-01-04 23:24 ` Alan Cox
2018-01-05 10:24 ` Alexander Kleinsorge [this message]
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=e6abec223ca77903615456ab203bd12b@physik.tu-berlin.de \
--to=aleks@physik.tu-berlin.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@gmail.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®