check_cs(0x2b): not a valid code segment (0x2b is a TSS)

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

check_cs(0x2b): not a valid code segment (0x2b is a TSS)

Post by clementttttttttt »

Why can't the interrupt handler iret with this? I thought you can far jump into TSSs.
rdos
Member
Member
Posts: 3297
Joined: Wed Oct 01, 2008 1:55 pm

Re: check_cs(0x2b): not a valid code segment (0x2b is a TSS)

Post by rdos »

clementttttttttt wrote:Why can't the interrupt handler iret with this? I thought you can far jump into TSSs.
Having a TSS in ring 3 seems a bit strange. I think you would normally have TSSes in kernel with ring = 0 as the privilege level (RPL field of selector). Also, what DPL does the TSS have?

Also, the processor changes the TSS type to busy and if you iret to an TSS I think NT flag must be set and the TSS must be busy. Normal task switching with TSS will use far jmps and TSS RPL & DPL set to 0.

Since it is an interrupt, if interrupts can happen in ring 0, then the TSS must have RPL of 0.
Post Reply