vm: add VM_FAULT_SIGSEGV handling support
The core VM already knows about VM_FAULT_SIGBUS, but cannot return a "you should SIGSEGV" error, because the SIGSEGV case was generally handled by the caller - usually the architecture fault handler. That results in lots of duplication - all the architecture fault handlers end up doing very similar "look up vma, check permissions, do retries etc" - but it generally works. However, there are cases where the VM actually wants to SIGSEGV, and applications _expect_ SIGSEGV. In particular, when accessing the stack guard page, libsigsegv expects a SIGSEGV. And it usually got one, because the stack growth is handled by that duplicated architecture fault handler. However, when the generic VM layer started propagating the error return from the stack expansion in commit fee7e49d ("mm: propagate error from stack expansion even for guard page"), that now exposed the existing VM_FAULT_SIGBUS result to user space. And user space really expected SIGSEGV, not SIGBUS. T...
Showing
- arch/alpha/mm/fault.c 2 additions, 0 deletionsarch/alpha/mm/fault.c
- arch/arc/mm/fault.c 2 additions, 0 deletionsarch/arc/mm/fault.c
- arch/avr32/mm/fault.c 2 additions, 0 deletionsarch/avr32/mm/fault.c
- arch/cris/mm/fault.c 2 additions, 0 deletionsarch/cris/mm/fault.c
- arch/frv/mm/fault.c 2 additions, 0 deletionsarch/frv/mm/fault.c
- arch/ia64/mm/fault.c 2 additions, 0 deletionsarch/ia64/mm/fault.c
- arch/m32r/mm/fault.c 2 additions, 0 deletionsarch/m32r/mm/fault.c
- arch/m68k/mm/fault.c 2 additions, 0 deletionsarch/m68k/mm/fault.c
- arch/metag/mm/fault.c 2 additions, 0 deletionsarch/metag/mm/fault.c
- arch/microblaze/mm/fault.c 2 additions, 0 deletionsarch/microblaze/mm/fault.c
- arch/mips/mm/fault.c 2 additions, 0 deletionsarch/mips/mm/fault.c
- arch/mn10300/mm/fault.c 2 additions, 0 deletionsarch/mn10300/mm/fault.c
- arch/nios2/mm/fault.c 2 additions, 0 deletionsarch/nios2/mm/fault.c
- arch/openrisc/mm/fault.c 2 additions, 0 deletionsarch/openrisc/mm/fault.c
- arch/parisc/mm/fault.c 2 additions, 0 deletionsarch/parisc/mm/fault.c
- arch/powerpc/mm/copro_fault.c 1 addition, 1 deletionarch/powerpc/mm/copro_fault.c
- arch/powerpc/mm/fault.c 2 additions, 0 deletionsarch/powerpc/mm/fault.c
- arch/s390/mm/fault.c 6 additions, 0 deletionsarch/s390/mm/fault.c
- arch/score/mm/fault.c 2 additions, 0 deletionsarch/score/mm/fault.c
- arch/sh/mm/fault.c 2 additions, 0 deletionsarch/sh/mm/fault.c
Please register or sign in to comment