Arbitrary RW means I can have a callchain that goes from C++FuncA -> JITedCodeB -> C++FuncC, and I can then make the JIT engine garbage-collect JITedCodeB and put different code there. Not violating any CFI constraints, but executing arbitrary code.
3
6
1
24
In short: CFI is bunk in an environment with a JIT that ever reuses +x address space.
3
1
7
Oh cool. You are right. I haven't thought about that attack. Thanks! :)
2
1
51%+ of credit for this needs to go to @ifsecure
1
1
Ah no, the return-after-free (as I like to call it) idea was entirely your own. My sole contribution was to drag you into a meeting.
1
2
I remember this being very much developed in ping-pong, so I will continue to attribute 51% to you :)
1
4
@grsecurity ROP attacks return flow. So saying that there is no effective mitigation against ROP might not be entirely wrong by Intel. CET shadow stack does address ROP in fine grained manner and deterministically. And assume arbitrary read/write primitive in attacker hands. /1
2
@grsecurity In your analysis you mentioned that attacker can use RELRO pages and perform writes to manufacture RO but dirty (thus shadow stack) pages. CET prevents that by faulting ; CR0.WP can't be cleared if CR4.CET = 1. Setting CR4.CET while CR0.WP=0 will fault. /2
3
RELRO pages have nothing whatsoever to do with CR0.WP. it's a pure sw construct that through syscalls ends up creating the exact pte rights that also mark shadow stacks (unless said sw construct takes care of preventing that, hw can't do anything about it).
1
Hmm. And s/w (kernel) marks Relro pages read and dirty, so that they get backed by swap space?
1
RELRO pages start out as normal writable file maps that then go through COW so after that they're treated as anonymous pages and would be backed by swap if they were to be swapped out.

Jun 17, 2020 路 8:35 PM UTC

1
Are you saying kernel already follows this logic of marking of readonly and dirty (even after it made the page was CoWed and made anonymous) or you are saying that error on kernel part would allow such inadvertent effects?
1
there's no 'error', it's what happens after a specific sequence of syscalls/memory access.