Attacking Branch Predictors to Bypass ASLR

Conrad Meyer cem at freebsd.org
Wed Oct 19 20:01:30 UTC 2016


On Wed, Oct 19, 2016 at 12:00 PM, Beach Geek <labeachgeek at gmail.com> wrote:
> This came across my tech news feed. It's a bit early and more testing is
> being done, but I wanted to start a discussion about it.
>
> Does this affect FreeBSD?
> If so, severity?
> Can this be countered/fixed in the OS?
>
> Link to 13 page paper:
> http://www.cs.ucr.edu/~nael/pubs/micro16.pdf

Hi,

FreeBSD doesn't have an ASLR implementation to bypass.  So the
straightforward answer is no.  It does not affect FreeBSD's existing
code.

There is an open question of whether it affects or obviates
Konstantin's userspace ASLR patch which is waiting to be merged.

The paper suggests a really lame and difficult software mitigation on
page 10.  On page 11 it suggests a possible HW mitigation, but that
does not yet exist in any CPU of course.

The userspace ASLR attack is somewhat limited.  Key quotes:

> Our prototype code tests 100 addresses in a second.

2^18 / 100 ~= 2^7 or ~2^11 seconds is about 35 minutes.

> Please note that current BTB addressing scheme (as used in Haswell processor used for our experiments) allows us to recover only a limited number of ASLR bits. The number of bits that are randomizes is implementation specific. However, according to [47], the full ASLR in Linux randomizes 12th to 40th bits of the virtual address. Since 30th and higher bits are not used in BTB addressing, only 18 bits can be recovered using the BTB attack on Haswell.

So it seems ASLR may still be somewhat useful on amd64, especially if
bits above 30 are randomized (Haswell anyway).  But it may be
completely useless on i386.

Best,
Conrad


More information about the freebsd-hackers mailing list