mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: [PATCH 4/7] update siginfo struct for linux v4.6
Date: Thu, 26 May 2016 22:06:10 +0200	[thread overview]
Message-ID: <d8526c67c3bf1efa6d7810ef8a685d90eeff29f3.1464291783.git.nsz@port70.net> (raw)
In-Reply-To: <cover.1464291783.git.nsz@port70.net>

x86 protection key faults are reported in the si_pkey field,
added in linux commit cd0ea35ff5511cde299a61c21a95889b4a71464e
---
 include/signal.h | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/include/signal.h b/include/signal.h
index c6323c6..a16094c 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -74,6 +74,7 @@ typedef struct sigaltstack stack_t;
 #define SEGV_MAPERR 1
 #define SEGV_ACCERR 2
 #define SEGV_BNDERR 3
+#define SEGV_PKUERR 4
 
 #define BUS_ADRALN 1
 #define BUS_ADRERR 2
@@ -123,10 +124,13 @@ typedef struct {
 		struct {
 			void *si_addr;
 			short si_addr_lsb;
-			struct {
-				void *si_lower;
-				void *si_upper;
-			} __addr_bnd;
+			union {
+				struct {
+					void *si_lower;
+					void *si_upper;
+				} __addr_bnd;
+				unsigned si_pkey;
+			} __first;
 		} __sigfault;
 		struct {
 			long si_band;
@@ -147,8 +151,9 @@ typedef struct {
 #define si_value   __si_fields.__si_common.__second.si_value
 #define si_addr    __si_fields.__sigfault.si_addr
 #define si_addr_lsb __si_fields.__sigfault.si_addr_lsb
-#define si_lower   __si_fields.__sigfault.__addr_bnd.si_lower
-#define si_upper   __si_fields.__sigfault.__addr_bnd.si_upper
+#define si_lower   __si_fields.__sigfault.__first.__addr_bnd.si_lower
+#define si_upper   __si_fields.__sigfault.__first.__addr_bnd.si_upper
+#define si_pkey    __si_fields.__sigfault.__first.si_pkey
 #define si_band    __si_fields.__sigpoll.si_band
 #define si_fd      __si_fields.__sigpoll.si_fd
 #define si_timerid __si_fields.__si_common.__first.__timer.si_timerid
-- 
2.8.1



  parent reply	other threads:[~2016-05-26 20:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-26 20:04 [PATCH 0/7] linux v4.6 update Szabolcs Nagy
2016-05-26 20:04 ` [PATCH 1/7] add preadv2 and pwritev2 syscall numbers for linux v4.6 Szabolcs Nagy
2016-05-26 20:05 ` [PATCH 2/7] add SO_CNX_ADVICE to sys/socket.h, new in " Szabolcs Nagy
2016-05-26 20:05 ` [PATCH 3/7] add ETH_P_MACSEC netinet/if_ether.h, " Szabolcs Nagy
2016-05-26 20:06 ` Szabolcs Nagy [this message]
2016-05-26 20:06 ` [PATCH 5/7] add CLONE_NEWCGROUP clone flag, " Szabolcs Nagy
2016-05-26 20:07 ` [PATCH 6/7] add new tcp_info fields from " Szabolcs Nagy
2016-05-26 20:07 ` [PATCH 7/7] update sys/socket.h to " Szabolcs Nagy

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=d8526c67c3bf1efa6d7810ef8a685d90eeff29f3.1464291783.git.nsz@port70.net \
    --to=nsz@port70.net \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).