ring 0 to ring 3 without iret

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
clementttttttttt
Member
Member
Posts: 70
Joined: Tue Jul 14, 2020 4:01 am
Libera.chat IRC: clementttttttttt

ring 0 to ring 3 without iret

Post by clementttttttttt »

is there even a way?
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: ring 0 to ring 3 without iret

Post by iansjack »

sysret.
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Re: ring 0 to ring 3 without iret

Post by nullplan »

Why even try? IRET has worked satisfactorily for decades and is unlikely to be phased out anytime soon. SYSRET might be faster, though.
Carpe diem!
rdos
Member
Member
Posts: 3297
Joined: Wed Oct 01, 2008 1:55 pm

Re: ring 0 to ring 3 without iret

Post by rdos »

You can do it with hardware task switching, but then you must first load the register area of the TSS with the desired registers for ring 3. However, it has side effects since a new context is loaded, including a new TR and potentially CR3. When you return to kernel you will need to fixup the context by copying back the registers from ring 3 to the original TSS and then jmp back to it. I don't think this is a method that is practical for changing rings.
Post Reply