From: Richard Weinberger <richard.weinberger@gmail.com>
To: none <ytrezq@sdf-eu.org>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
linux-x86_64@vger.kernel.org
Subject: Re: Getting the way a SIGSEGV append when catching a SIGSEGV from within
Date: Mon, 27 Mar 2017 17:30:32 +0200 [thread overview]
Message-ID: <CAFLxGvzC_63RkxgTNnG8g2Hw5CUW7SVLuUMuE7_13Dw1bqHUUA@mail.gmail.com> (raw)
In-Reply-To: <bce22a1c127bf19825637bcd326c6f00@mx.sdfeu.org>
On Mon, Mar 27, 2017 at 4:45 PM, none <ytrezq@sdf-eu.org> 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.
--
Thanks,
//richard
next prev parent reply other threads:[~2017-03-27 15:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-27 14:45 Getting the way a SIGSEGV append when catching a SIGSEGV from within none
2017-03-27 15:30 ` Richard Weinberger [this message]
2017-03-27 18:55 ` none
2017-03-27 19:20 ` Richard Weinberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFLxGvzC_63RkxgTNnG8g2Hw5CUW7SVLuUMuE7_13Dw1bqHUUA@mail.gmail.com \
--to=richard.weinberger@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-x86_64@vger.kernel.org \
--cc=ytrezq@sdf-eu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).