CS FundamentalsVery hardGATE CS

A process gets SIGSEGV writing to a page marked read-only that belongs to a copy-on-write mapping after fork(). Why is this NOT what normally happens?

  1. A. COW pages are never marked read-only
  2. B. The kernel recognises the protection fault as a COW fault (the region is writable in its VMA), copies the page, makes it writable, and restarts the instruction
  3. C. The parent always handles the write
  4. D. Writes to COW pages are ignored

Correct answer: B. The kernel recognises the protection fault as a COW fault (the region is writable in its VMA), copies the page, makes it writable, and restarts the instruction

The PTE is read-only but the area's permissions allow writing; the mismatch tells the fault handler to break sharing. Only a write to a truly read-only region results in SIGSEGV.

More Operating Systems questions

Exams that ask this topic