Synthetic Memory Protections: An update on ROP mitigations [pdf]
&gt; iOS is execute-only; Android tried a few years ago (abandoned)<p>Wonder if the author is aware of the reasons why this was disabled (it&#x27;s functionally gone on both platforms). On iOS newer processors have PAC which provides much stronger guarantees against ROP and Linux disabled it because execute-only mappings bypass PAN: <a href="https:&#x2F;&#x2F;blog.siguza.net&#x2F;PAN&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.siguza.net&#x2F;PAN&#x2F;</a>.<p>&gt; Dumb applications that invent their own ABI (very few)<p>I mean I know this is meant to be bait but I&#x27;ll take it, applications that use their own internal ABI are valid programs.<p>&gt; On every kernel entry, if the RPKU register has been changed kill the process<p>&gt; When a process does a system call, the SP register MUST point to stack memory!<p>Has <a href="https:&#x2F;&#x2F;xerub.github.io&#x2F;ios&#x2F;kpp&#x2F;2017&#x2F;04&#x2F;13&#x2F;tick-tock.html" rel="nofollow">https:&#x2F;&#x2F;xerub.github.io&#x2F;ios&#x2F;kpp&#x2F;2017&#x2F;04&#x2F;13&#x2F;tick-tock.html</a> vibes<p>&gt; Stack and Syscall Protection detect a variety of easier exploit patterns, pushing the ROP programmer to explore more challenging schemes, which may not be viable<p>&gt; Increasing exploitation difficulty is a valid strategy<p>Ok so this is the actual interesting part of the paper, because it seems like they are trying to shore up their syscall-origin protections which are not very strong in the presence on ROP, except trying to do so on hardware that doesn&#x27;t really have CFI protections.<p>As far as I can tell, this Xonly protection only attempts to disrupt blind ROP (&quot;you can&#x27;t read the code anymore&quot;), rather than construction of a full ROP chain. There are some attempts to validate things on entry to the kernel (pc, sp) but they are under control of userspace so what probably will happen here is that they get switched back to sane values prior to kernel entry and then adjusted to attacker-controlled values again. I expect this to require some cleverness on the side of attackers but this is typically how such checks are bypassed, assuming that there is not some other overlooked way to get around it.<p>This brings us to OpenBSD&#x27;s strategy for exploit mitigation, which is in my eyes has far too much tunnel vision: it tries to match on individual exploit strategies, rather than trying to protect against more general problems. The policy of &quot;let&#x27;s make exploitation harder&quot; is actually very close to something I&#x27;m working on right now and it has a number of important caveats that I don&#x27;t see addressed here.<p>These things are true:<p>* Reducing the reliability of an exploit makes it far less attractive.<p>* Adding non-perfect mitigations against common exploitation strategies makes it so that people can&#x27;t just throw a proof-of-concept against another platform against your system.<p>However, these are also true:<p>* Attackers are very, very good at turning &quot;we made this 99% secure!&quot; into &quot;this will basically never work&quot;.<p>* Attackers will construct new strategies that you didn&#x27;t think of to attack the same underlying problem if you don&#x27;t fix it, if given adequate time.<p>I am not an exploit author, so take this with a grain of salt, but I would guess that an experienced team could probably come up with a way to do either of the above in maybe a year. And at that point, once it&#x27;s broken, the cost from the OpenBSD side to improve upon this protection is high, because they will break the entire design of this thing, which requires a human to revisit this and create a new clever design to keep attackers at bay. In that way it will become just a routine step in an exploit to evade the protection, as opposed to say NX, which completely killed the ability to ever do shellcode execution from the stack, necessitating the development of ROP over multiple years. Good mitigations are highly asymmetric in terms of effort required to design them versus how long an attacker needs to take to fully bypass them. Usually this means that if you&#x27;re spending significant time designing something it will probably want to be sound rather than reducing the window of opportunity for an exploit.