From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752181AbdC0SzS (ORCPT ); Mon, 27 Mar 2017 14:55:18 -0400 Received: from odin.sdf-eu.org ([178.63.35.194]:54409 "EHLO sdfeu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751634AbdC0SzK (ORCPT ); Mon, 27 Mar 2017 14:55:10 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Mon, 27 Mar 2017 20:55:00 +0200 From: none To: Richard Weinberger Cc: Linux Kernel , linux-x86_64@vger.kernel.org Subject: Re: Getting the way a SIGSEGV append when catching a SIGSEGV from within In-Reply-To: References: X-Priority: 1 (Highest) Message-ID: User-Agent: Roundcube Webmail/1.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 2017-03-27 17:30, Richard Weinberger a écrit : > On Mon, Mar 27, 2017 at 4:45 PM, none wrote: >> 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 ? > > Did you look at the machine specific context of SIGSEGV? > It will give you access to the error code and the trap number. Sorry but so, in the case of x86_64, which is the struct member I need to look at ?