merlin2011
merlin2011

Reputation: 75575

Is there a list of errors will show up as `segfaults` when they are not really related to memory access?

In this question, I learned that attempting to run privileged instructions when not in ring 0 can cause what looks like a segfault in a user process, and I have two follow-up questions.

  1. Is this true of all privileged instructions?
  2. What other sorts of errors can cause a fake segfault but are not related to trying to read memory?

Upvotes: 2

Views: 195

Answers (1)

Jester
Jester

Reputation: 58772

Read through the instruction set reference and see where #GP is listed for a non-memory issue. Incomplete list: CLI, CLTS, HLT, IN, INT (with an invalid vector), INVD, INVLPG, IRET (under circumstances), LDMXCSR(setting reserved bits), LGDT, LIDT, LLDT, LMSW, LTR, MONITOR (with ECX != 0), MOV (to CRx or DRx), MWAIT (with invalid ECX), OUT, RDMSR, RDPMC, SWAPGS, SYSEXIT, SYSRET, WBINVD, WRMSR, XGETBV (invalid ECX), XRSTOR, XSETBV

Upvotes: 3

Related Questions