Re:Inception: DMA Attack Against Linux, Windows, and Mac
by java-man on Monday March 30, 2015 @07:35PM
(#9293372)
I agree, there should exists explicit OS mechanisms to prevent leakage, be it via DMA, paging, or any other way.
In the absence of such mechanisms, especially when mlock() is unavailable (if running a Java app, for example), the app designer can use tricks like one described above to increase the level of difficulty for an attacker. It is not a solution, but an additional countermeasure.
Re:Inception: DMA Attack Against Linux, Windows, and Mac
by potatosareok on Tuesday March 31, 2015 @03:29AM
(#9294822)
You can disable paging if you really care about that but setting swapiness to 0.
Or use something like https://github.com/LucidWorks/mlockall-agent
`mlock()` can be used to prevent the memory from being paged out, but the DMA issue itself isn't something that can be (or should be) solved in userspace; if someone can do DMA reads/writes, rewriting any code or data, there's nothing an application can do.