Advertisement
Guest User

Untitled

a guest
Jan 12th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. Hardware-Bugs: meltdown und spectre, Architektur-Fehler
  2.  
  3. Meltdown: Instruktion wird eigentlich immer in Cache geladen (-> kernel memory), grundsaetzlich gefaehrlich, OS-Patch NÖTIG!
  4. für: INTEL, ARM etc.
  5.  
  6. drawAd();
  7. withStuffThatMemoryAlloc(); // 0 / Pipeline Stall
  8. //Spekulativ
  9. // Kernel Memory
  10. if(read((void*)(0x0345456f)) == 'S'); // Access Violation (dürfen wir eigentlich nicht, Tradeoff: Cache sonst nie ausführbar weil nondet.)
  11. readFirstPixelFromAd(); // Das ist uns eigentlich egal- Aber: dieser Decoy liegt nun eventuell Cache (S)
  12. //spekulativ: diese Instruktion read... ist nun im Cache, und nur deswegen, weil spekulativ (Heuristik/Statistik) 'S' drin sein sollte....
  13. ...
  14.  
  15. ACCESS_VIOLATION -> Crash Exception
  16.  
  17. Start stopwatch (Hardware timer)
  18. readFirstPixelFromAd();
  19. Stop stopwatch (Hardware timer)
  20.  
  21. !!!wenn der aufruf ging wars ein s ansonsten nicht!!
  22.  
  23. -----
  24. Spectre: hat eigentlich CPU-Protection bei Branching, aber User-Applications ermoeglichen Zugriff, OS-Patches UND Programm-Patches nötig
  25. für: eigentlich alle (seit ca 20 Jahren), also auch AMD, MIPS etc.
  26.  
  27. // User Memory
  28. //Browser beispiel Online Banking Tab, durchbricht "aus versehen" den Memory Access Check
  29. // JS mit JIT
  30. [DisableSpeculative] (Compiler annotation aber schlechtere Performance)
  31. char accessMemory(position)
  32. {
  33. 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)
  34. throw error();
  35. return memory[position]; //Also laden wir memory position in den Cache (return)
  36. }
  37.  
  38.  
  39. if(accessMemory(100000000)=='B')
  40. x=readPixel(1);
  41.  
  42. Start stopwatch (Hardware timer)
  43. readFirstPixelFromAd();
  44. Stop stopwatch (Hardware timer)
  45.  
  46. ---------------------------------------------
  47.  
  48. drawAd();
  49. withStuffThatMemoryAlloc(); // 0 / Pipeline Stall
  50. //Spekulativ
  51. if(read((void*)(0x0345456f)) == 'S'); // Access Violation (dürfen wir eigentlich nicht, Tradeoff: Cache sonst nie ausführbar weil nondet.)
  52. readFirstPixelFromAd(); // Das ist uns eigentlich egal- Aber: dieser Decoy liegt nun eventuell Cache (S)
  53. //spekulativ: diese Instruktion read... ist nun im Cache, und nur deswegen, weil spekulativ (Heuristik/Statistik) 'S' drin sein sollte....
  54. ...
  55.  
  56. ACCESS_VIOLATION -> Crash Exception
  57.  
  58.  
  59. Start stopwatch (Hardware timer)
  60. readFirstPixelFromAd();
  61. Stop stopwatch (Hardware timer)
  62.  
  63. wenn der aufruf ging wars ein s ansonsten nicht
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement