Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
General protection fault
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Technical causes for faults== General protection faults are raised by the processor when a protected instruction is encountered which exceeds the permission level of the currently executing task, either because a user-mode program is attempting a protected instruction, or because the operating system has issued a request which would put the processor into an undefined state. General protection faults are caught and handled by modern operating systems. Generally, if the fault originated in a user-mode program, the user-mode program is terminated. If, however, the fault originated in a core system driver or the operating system itself, the operating system usually saves diagnostic information either to a file or to the screen and stops operating. It either restarts the computer or displays an [[error screen]], such as a [[Blue Screen of Death]] or [[kernel panic]]. ===Segment limits exceeded=== Segment limits can be exceeded: * with [[code segment]] (CS), [[data segment]] (DS), or ES, FS, or GS (extra segment) registers; or * accessing descriptor tables such as the [[Global Descriptor Table]] (GDT), the [[Interrupt descriptor table]] (IDT) and the [[Local Descriptor Table]] (LDT). ===Segment permissions violated=== Segment permissions can be violated by: * jumping to non-executable segments * writing to code segments, or read only segments * reading execute-only segments ===Segments illegally loaded=== This can occur when: * a stack segment (SS) is loaded with a segment selector for a read only, executable, null segment, or segment with descriptor privilege not matching the current privilege in CS * a code segment (CS) loaded with a segment selector for a data, system, or null segment * SS, DS, ES, FS, or GS are segments loaded with a segment selector for a system segment * SS, DS, ES, FS, or GS are segments loaded with a segment selector for an execute-only code segment * accessing memory using DS, ES, FS, or GS registers, when they contain a null selector ===Switching=== Faults can occur in the [[task state segment]] (TSS) structure when: * switching to a busy task during a call or jump instruction * switching to an available task during an interrupt return (IRET) instruction * using a segment selector on a switch pointing to a TSS descriptor in the LDT{{clarify|note=What does this mean?|date=May 2017}} ===Miscellaneous=== Other causes of general protection faults are: * attempting to access an interrupt/exception handler from [[virtual 8086 mode]] when the handler's code segment descriptor [[privilege level]] (DPL) is greater than zero * attempting to write a one into the reserved bits of [[control register|CR4]] * attempting to execute [[privilege (computing)|privileged]] instructions when the current privilege level (CPL) is not zero * attempting to execute a single instruction with a length greater than 15 bytes (possibly by prepending the instruction with superfluous prefixes)<ref>{{cite web|url=https://xem.github.io/minix86/manual/intel-x86-and-64-manual-vol3/o_fe12b1e2a880e0ce-223.html|title=Page 223|access-date=2023-09-24}}</ref> * writing to a reserved bit in an [[model-specific register|MSR]] instruction * accessing a gate containing a null segment selector * executing a software interrupt when the CPL is greater than the DPL set for the interrupt gate * the segment selector in a call, interrupt or trap gate does not point to a code segment * violating privilege rules * enabling paging whilst disabling protection * referencing the interrupt descriptor table following an interrupt or exception that is not an interrupt, trap, or a task gate * Legacy [[Streaming SIMD Extensions|SSE]]: Memory operand is not 16-byte aligned.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)