(i386) ring3 data segments used by ring0 just fine??
Posted: Tue Aug 12, 2025 4:15 pm
The other day, I accidentally left out the code to save and restore DS, ES, etc from an interrupt service routine. Imagine my surprise when the ISR still functioned as normal - no faults at all. This is despite accessing memory marked "supervisor" in the page tables, and despite running privilleged instructions like INVLPG
From what I can understand of the latest Intel manual, this is normal: "When the CPL is 0, data segments at all privillege levels are accessible" - section 6.6 of the Intel Software Developer Manuals Volume 3 (2025)
All of this causes me to question: in a flat memory model, are seperate data segments truly needed for both ring0 and ring3? Is the processor actually checking or using the privillege level of these segment descriptors at any point?
I understand that for thread-local storage etc it's useful to save and reload FS or GS - but appart from that, is loading ring0 data segment selectors into the relevant registers actually doing anything useful?
Thanks for your help
From what I can understand of the latest Intel manual, this is normal: "When the CPL is 0, data segments at all privillege levels are accessible" - section 6.6 of the Intel Software Developer Manuals Volume 3 (2025)
All of this causes me to question: in a flat memory model, are seperate data segments truly needed for both ring0 and ring3? Is the processor actually checking or using the privillege level of these segment descriptors at any point?
I understand that for thread-local storage etc it's useful to save and reload FS or GS - but appart from that, is loading ring0 data segment selectors into the relevant registers actually doing anything useful?
Thanks for your help