1

I've been looking into rowhammer attacks and mitigations and there are two (what seem to be) mitigations that I've seen that are actually implemented in currently available hardware and software, but aren't mentioned in any studies I've seen, even recent ones, on this subject.

The first is Intel's Total Memory Encryption, which has been available since the Intel generations Ivy Bridge for servers and Alder Lake for desktops. It would seem to me that this would render rowhammer privilege escalation/remote code execution impossible (although denial of service still would be possible) as it would be impossible to predict the effects of any bit flip as all memory is encrypted with an AES-128 key that changes per boot and AES is not homomorphic, hence regardless of the fact that said encryption is transparent to software and a local attacking program could, say, determine the location of page tables and come up with a hammering pattern to flip bits to grant privilege escalation, the actual change that would occur in physical memory would, when decrypted and read by the processor, be radically different and impossible to predict.

In spite of this, I have seen no mention of memory encryption at all in any literature regarding rowhammer (including a fairly comprehensive study at https://arxiv.org/pdf/2201.02986.pdf), and the Intel page on Total Memory Encryption mentions cold boot attacks, malicious hardware attacks, and malicious hypervisor attacks but doesn't even mention rowhammer once. This would indicate to me that this is not a good defense against rowhammer, but I'm not sure how - could someone please elaborate on this matter?

The second potential defense I've seen is Windows Memory Integrity. This isn't a defense against rowhammer in general, but seems to be a defense against rowhammer attacks against page tables, which seems to be the standard method of rowhammer privilege escalation. From what I can tell, memory integrity involves maintaining shadow page tables in a hidden location via ASLR and the fact there are few, if any pointers to the page tables that could be leaked to reveal the location. Any attempt at bit flipping the page tables would therefore be detected as the change would not be present in the shadow page tables. Again though, Microsoft doesn't mention rowhammer in any documentation regarding memory integrity, which leads me to believe I might be wrong.

Are either of these defenses/mitigations effective against rowhammer?; if not - in the general sense then at the very least against privilege escalation attacks?

Also, given that DDR5 memory is now rolling out, are there any known rowhammer mitigations integrated into the hardware? I haven't heard of any, but given the attention given to hardware attacks recently it would seem strange to me that such an attack wasn't considered in a new generation of memory.

0

1 Answer 1

1
  • Memory encryption sounds like a nice counter measure against this attack. Your reasoning sounds solid. This attack could be used to cause a denial of service though but as soon as it's detected the bad code could be detected and terminated.
  • DDR5 has mandated built-in ECC which theoretically should also protect against this attack though there's a research which refutes this. Personally I don't like this research paper because it's far from easy to flip so many bits simultaneously and reliably.
  • I cannot comment on "Windows memory integrity" 'cause I don't fully understand how it works.

Still in order to carry out this attack you need local access to the system, so it's a concern mostly for shared hosting providers - that's why you don't hear much about it. Everyone else is not affected.

4
  • From what I've heard ECC reduces the rate of bit flips but not to an insurmountable degree. Regarding local attacks, from what I've seen new methods have been found which can find bit flips with eviction based attacks from javascript even on DDR4 systems (download.vusec.net/papers/smash_sec21.pdf). Haven't heard of any attacks yet, presumably because there are easier methods of remote access and privilege escalation, but given the timeframe for fixing hardware issues it seems like something that should be looked into. Commented Jan 22, 2023 at 19:03
  • @JenkinsEar Transient execution CPU vulnerabilities and raw hammer attacks continue to be something the industry spends a ton of money to mitigate yet to this date we've had zero malware in the wild which uses either of it. But we surely have a ton of research papers and experimental exploits. All of them require local presence and if you gain one, there are easier targets to exploit considering server systems despite being mostly x86 based are still different enough both in terms of HW configuration and software to write universal hacks targeting them all which means they must be specific. Commented Jan 22, 2023 at 19:06
  • I can imagine that hackers from enemy states such as North Korea, Iran, Russia, etc. when gaining persistence and not finding any further vulnerabilities could abuse these HW vulnerabilities them but so far I've heard nothing, nothing at all. Commented Jan 22, 2023 at 19:08
  • "so it's a concern mostly for shared hosting providers" - Or everyone else running a VM.
    – secfren
    Commented Jan 22, 2023 at 20:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .