The purpose of this thesis work is an in-depth analysis of the phenomenon named Rowhammer. Rowhammer manifests itself as a selective corruption of data inside SDRAM memories, following the execution of a particular access pattern to that same memory. Rowhammer manifests itself even with read-only accesses, therefore the phenomenon may cause modification of data inside read-only memory regions. This eventuality can undermine the solidity of a large number of security mechanisms which rely on read-only permissions, such as userspace-kernelspace separation, sandboxing processes or the use of asymmetric cryptographic keys. To reproduce the Rowhammer phenomenon on a system susceptible to this attack, it is necessary to have a deep knowledge of how processes'virtual addresses map onto the internal structures of the DRAM modules in use on the system. In this thesis a complete and correct method for obtaining the mapping function of the system on which a process is executed is described. Finally two countermeasures are shown: a software one and a hardware one, to mitigate the Rowhammer phenomenon until it becomes harmless. Rowhammering happens only on physically adjacent rows of memory, a mapping function determines which virtual addresses are geometrically adjacent in a DRAM chip. The software countermeasure consists of a modification of the OS'memory allocator to make it so that the various entities (individual processes and the kernel), be physically isolated by a sufficient number of rows. Consequently, even if a process caused disturbance errors, the latter would affect only the data structures of said process. Hence impeding any type of privilege escalation. On the hardware side, we propose a DRAM modules architectural modification, such that everytime the module is initialized, a random permutation of row index is generated. This way, the mapping function will change at every machine boot, drastically reducing the feasibility of a Rowhammer-based attack.

Lo scopo di questo lavoro di tesi è un'analisi approfondita del fenomeno denominato Rowhammer, esso si manifesta con una corruzione selettiva dei dati contenuti in una memoria SDRAM, a seguito dell'esecuzione di un determinato pattern di accessi alla memoria stessa. Rowhammer si verifica anche con accessi in sola lettura, di conseguenza il fenomeno può causare la modifica dei dati all'interno di zone di memoria marcate come read-only. Questa eventualità è in grado di minare la solidità di un gran numero di meccanismi di sicurezza che si affidano a permessi di sola lettura, come la separazione userspace-kernelspace, le azioni di sandboxing o l'impiego di coppie di chiavi crittografiche asimmetriche. Per poter riprodurre il fenomeno di Rowhammer su un sistema suscettibile all'attacco è necessario conoscere approfonditamente come gli indirizzi virtuali dei processi in esecuzione nel sistema si mappano sulle strutture interne dei moduli DRAM del sistema stesso. In questa tesi si descrive un metodo completo e corretto per ricavare la funzione di mapping del sistema su cui un processo è in esecuzione. Infine si espongono due contromisure, una software e l'altra hardware per mitigare il fenomeno di Rowhammer fino a renderlo inoffensivo. Il Rowhammering si verifica solo su righe di memoria fisicamente adiacenti, la funzione di mapping determina quali indirizzi virtuali sono geometricamente adiacenti in un determinato chip di memoria DRAM. La contromisura software consiste nel modificare l'allocatore di memoria del sistema operativo, per far si che le varie entità (singoli processi e kernel) siano fisicamente isolate nella loro allocazione in memoria da un numero sufficiente di row. Di conseguenza ogni processo, se anche riuscisse a causare errori di disturbo, essi avrebbero effetto solo sulle sue strutture dati, impedendo qualsiasi tipo di privilege escalation. Invece dal lato hardware si propone una modifica dell'architettura dei moduli DRAM, di modo che ad ogni inizializzazione del modulo, sia generata una permutazione casuale dei row index. In questo modo la funzione di mapping cambierà ad ogni avvio della macchina , riducendo drasticamente la fattibilità di un attacco basato su Rowhammer.

Reliably achieving and efficiently preventing Rowhammer attacks

IZZO, NICCOLO'
2017/2018

Abstract

The purpose of this thesis work is an in-depth analysis of the phenomenon named Rowhammer. Rowhammer manifests itself as a selective corruption of data inside SDRAM memories, following the execution of a particular access pattern to that same memory. Rowhammer manifests itself even with read-only accesses, therefore the phenomenon may cause modification of data inside read-only memory regions. This eventuality can undermine the solidity of a large number of security mechanisms which rely on read-only permissions, such as userspace-kernelspace separation, sandboxing processes or the use of asymmetric cryptographic keys. To reproduce the Rowhammer phenomenon on a system susceptible to this attack, it is necessary to have a deep knowledge of how processes'virtual addresses map onto the internal structures of the DRAM modules in use on the system. In this thesis a complete and correct method for obtaining the mapping function of the system on which a process is executed is described. Finally two countermeasures are shown: a software one and a hardware one, to mitigate the Rowhammer phenomenon until it becomes harmless. Rowhammering happens only on physically adjacent rows of memory, a mapping function determines which virtual addresses are geometrically adjacent in a DRAM chip. The software countermeasure consists of a modification of the OS'memory allocator to make it so that the various entities (individual processes and the kernel), be physically isolated by a sufficient number of rows. Consequently, even if a process caused disturbance errors, the latter would affect only the data structures of said process. Hence impeding any type of privilege escalation. On the hardware side, we propose a DRAM modules architectural modification, such that everytime the module is initialized, a random permutation of row index is generated. This way, the mapping function will change at every machine boot, drastically reducing the feasibility of a Rowhammer-based attack.
PELOSI, GERARDO
ING - Scuola di Ingegneria Industriale e dell'Informazione
21-dic-2017
2017/2018
Lo scopo di questo lavoro di tesi è un'analisi approfondita del fenomeno denominato Rowhammer, esso si manifesta con una corruzione selettiva dei dati contenuti in una memoria SDRAM, a seguito dell'esecuzione di un determinato pattern di accessi alla memoria stessa. Rowhammer si verifica anche con accessi in sola lettura, di conseguenza il fenomeno può causare la modifica dei dati all'interno di zone di memoria marcate come read-only. Questa eventualità è in grado di minare la solidità di un gran numero di meccanismi di sicurezza che si affidano a permessi di sola lettura, come la separazione userspace-kernelspace, le azioni di sandboxing o l'impiego di coppie di chiavi crittografiche asimmetriche. Per poter riprodurre il fenomeno di Rowhammer su un sistema suscettibile all'attacco è necessario conoscere approfonditamente come gli indirizzi virtuali dei processi in esecuzione nel sistema si mappano sulle strutture interne dei moduli DRAM del sistema stesso. In questa tesi si descrive un metodo completo e corretto per ricavare la funzione di mapping del sistema su cui un processo è in esecuzione. Infine si espongono due contromisure, una software e l'altra hardware per mitigare il fenomeno di Rowhammer fino a renderlo inoffensivo. Il Rowhammering si verifica solo su righe di memoria fisicamente adiacenti, la funzione di mapping determina quali indirizzi virtuali sono geometricamente adiacenti in un determinato chip di memoria DRAM. La contromisura software consiste nel modificare l'allocatore di memoria del sistema operativo, per far si che le varie entità (singoli processi e kernel) siano fisicamente isolate nella loro allocazione in memoria da un numero sufficiente di row. Di conseguenza ogni processo, se anche riuscisse a causare errori di disturbo, essi avrebbero effetto solo sulle sue strutture dati, impedendo qualsiasi tipo di privilege escalation. Invece dal lato hardware si propone una modifica dell'architettura dei moduli DRAM, di modo che ad ogni inizializzazione del modulo, sia generata una permutazione casuale dei row index. In questo modo la funzione di mapping cambierà ad ogni avvio della macchina , riducendo drasticamente la fattibilità di un attacco basato su Rowhammer.
Tesi di laurea Magistrale
File allegati
File Dimensione Formato  
rowhammer_reviewed.pdf

accessibile in internet per tutti

Descrizione: Thesis text
Dimensione 11.71 MB
Formato Adobe PDF
11.71 MB Adobe PDF Visualizza/Apri

I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/10589/137667