lkml.org 
[lkml]   [2018]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 2/2] x86/ibpb: Prevent missed IBPB flush
From
Date
On Wed, 2018-01-24 at 16:36 -0800, Tim Chen wrote:
> It is possible that the last uesr mm that we recorded for a cpu was
> released, and a new mm with identical address was allocated when we
> check it again.  We could skip IBPB flush here for the process with
> the new mm.
>
> It is a difficult to exploit case as we have to exit() a process on a
> cpu, free the mm, and fork() the victim to use the mm pointer on that
> cpu. The exploiter needs the old mm to get recycled to the
> newly forked process and no other processes run on the target cpu.

That's what it takes to have the victim process leak information into
the cache. In order to *harvest* that information, the attacker must
then get run on the same CPU again? And since her first process had to
exits, as described above, she needs a new process for that?

I confess, with all the other wildly theoretical loopholes that exist,
I wasn't losing much sleep over this one.

> Nevertheless, the patch below is one way to close this hole by
> adding a ref count to prevent the last user mm from being released.
> It does add ref counting overhead, and extra memory cost of keeping an mm
> (though not the VMAs and most of page tables) around longer than we will
> otherwise need to. Any better solutions are welcomed.

This has no upper bound on the amount of time the user mm gets held,
right? If a given CPU remains idle for ever (and what happens if it's
taken offline?) we'll never do that mmdrop() ?[unhandled content-type:application/x-pkcs7-signature]
\
 
 \ /
  Last update: 2018-01-25 09:20    [W:0.097 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site