A full technical explanation of, and sample code for, the RISC-V CPU-level privilege escalation flaw. This is exploitable in QEMU, and is vulnerable in the current stable implementation spec, though it is in the process of being solved by the RISC-V team:
http://blog.securitymouse.com/2017/04/the-risc-v-files-supervisor-machine.html