File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 11//! Provides functions to read and write segment registers.
22
33#[ cfg( docsrs) ]
4- use crate :: { registers:: control:: Cr4Flags , structures:: gdt:: GlobalDescriptorTable } ;
4+ use crate :: {
5+ registers:: control:: Cr4Flags ,
6+ structures:: gdt:: { Descriptor , GlobalDescriptorTable } ,
7+ } ;
58use crate :: {
69 registers:: model_specific:: { FsBase , GsBase , Msr } ,
710 structures:: gdt:: SegmentSelector ,
@@ -152,7 +155,11 @@ impl Segment for CS {
152155/// Stack Segment
153156///
154157/// Entirely unused in 64-bit mode; setting the segment register does nothing.
155- /// However, this register is often set by the `syscall`/`sysret` and
158+ /// However, in ring 3, the SS register still has to point to a valid
159+ /// [`Descriptor`] (it cannot be zero). This means a user-mode read/write
160+ /// segment descriptor must be present in the GDT.
161+ ///
162+ /// This register is also set by the `syscall`/`sysret` and
156163/// `sysenter`/`sysexit` instructions (even on 64-bit transitions). This is to
157164/// maintain symmetry with 32-bit transitions where setting SS actually will
158165/// actually have an effect.
You can’t perform that action at this time.
0 commit comments