Getting the way a SIGSEGV append when catching a SIGSEGV from within

From: none
Date: Mon Mar 27 2017 - 10:55:53 EST


Hello,

Thereâs three way to perform an invalid memory access :

The attempt to execute/jump at an invalid address.
The attempt to read at an invalid address.
The attempt to write at an invalid address.

Determining the execute case with rt_sigaction is easyÂ: the last value of eip match the value of the address which caused the segfault.

But how to know if the SIGSEGV occurred by a read or by a write attempt ? In the same time shouldnât that information belong in the mmu ?