If I mprotect a segment with PROT_NONE and if a SIGSEGV occurs due to a write which gets handled by sigaction with sa_sigaction, We will be able to find the address where the fault occurs using siginfo_t's si_addr.
Is there a way to know the data that was tried to be over-written and the length to be over-written(that should be the length of the incoming data)?
I am trying to do this because I trying an approach close to copy-on-write mechanism for my project. Thanks.