CS FundamentalsHardGATE CS

Which statement about user-mode and kernel-mode stacks is correct?

  1. A. All threads share one kernel stack
  2. B. The kernel uses the caller's user stack for system calls
  3. C. Each thread has a user stack and a separate kernel stack used when it enters the kernel, so a corrupted user stack cannot crash the kernel's handling of a system call
  4. D. Kernel stacks are swapped out with the process

Correct answer: C. Each thread has a user stack and a separate kernel stack used when it enters the kernel, so a corrupted user stack cannot crash the kernel's handling of a system call

On a trap the CPU switches to the thread's kernel stack (from the task state). Keeping it separate protects the kernel from user stack corruption and lets each blocked thread keep its kernel context.

More Operating Systems questions

Exams that ask this topic