Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hardware-Bugs: meltdown und spectre, Architektur-Fehler
- Meltdown: Instruktion wird eigentlich immer in Cache geladen (-> kernel memory), grundsaetzlich gefaehrlich, OS-Patch NÖTIG!
- für: INTEL, ARM etc.
- drawAd();
- withStuffThatMemoryAlloc(); // 0 / Pipeline Stall
- //Spekulativ
- // Kernel Memory
- if(read((void*)(0x0345456f)) == 'S'); // Access Violation (dürfen wir eigentlich nicht, Tradeoff: Cache sonst nie ausführbar weil nondet.)
- readFirstPixelFromAd(); // Das ist uns eigentlich egal- Aber: dieser Decoy liegt nun eventuell Cache (S)
- //spekulativ: diese Instruktion read... ist nun im Cache, und nur deswegen, weil spekulativ (Heuristik/Statistik) 'S' drin sein sollte....
- ...
- ACCESS_VIOLATION -> Crash Exception
- Start stopwatch (Hardware timer)
- readFirstPixelFromAd();
- Stop stopwatch (Hardware timer)
- !!!wenn der aufruf ging wars ein s ansonsten nicht!!
- -----
- Spectre: hat eigentlich CPU-Protection bei Branching, aber User-Applications ermoeglichen Zugriff, OS-Patches UND Programm-Patches nötig
- für: eigentlich alle (seit ca 20 Jahren), also auch AMD, MIPS etc.
- // User Memory
- //Browser beispiel Online Banking Tab, durchbricht "aus versehen" den Memory Access Check
- // JS mit JIT
- [DisableSpeculative] (Compiler annotation aber schlechtere Performance)
- char accessMemory(position)
- {
- if(position >= end) // scheiße end is nich im cache... was mach ich jetzt? ach ich geh einfach mal davon aus dass das false wird aus performance gründen (spekulativ)
- throw error();
- return memory[position]; //Also laden wir memory position in den Cache (return)
- }
- if(accessMemory(100000000)=='B')
- x=readPixel(1);
- Start stopwatch (Hardware timer)
- readFirstPixelFromAd();
- Stop stopwatch (Hardware timer)
- ---------------------------------------------
- drawAd();
- withStuffThatMemoryAlloc(); // 0 / Pipeline Stall
- //Spekulativ
- if(read((void*)(0x0345456f)) == 'S'); // Access Violation (dürfen wir eigentlich nicht, Tradeoff: Cache sonst nie ausführbar weil nondet.)
- readFirstPixelFromAd(); // Das ist uns eigentlich egal- Aber: dieser Decoy liegt nun eventuell Cache (S)
- //spekulativ: diese Instruktion read... ist nun im Cache, und nur deswegen, weil spekulativ (Heuristik/Statistik) 'S' drin sein sollte....
- ...
- ACCESS_VIOLATION -> Crash Exception
- Start stopwatch (Hardware timer)
- readFirstPixelFromAd();
- Stop stopwatch (Hardware timer)
- wenn der aufruf ging wars ein s ansonsten nicht
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement