aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2018-03-06 01:20:25 -0500
committerEric W. Biederman <ebiederm@xmission.com>2018-03-06 01:22:36 -0500
commit859d880cf544dbe095ce97534ef04cd88ba2f2b4 (patch)
treed4c2ff0121b6d3966518809be387538653503e63
parent9026e820cbd2ea39a06a129ecdddf2739bd3602b (diff)
signal: Correct the offset of si_pkey in struct siginfo
The change moving addr_lsb into the _sigfault union failed to take into account that _sigfault._addr_bnd._lower being a pointer forced the entire union to have pointer alignment. In practice this only mattered for the offset of si_pkey which is why this has taken so long to discover. To correct this change _dummy_pkey and _dummy_bnd to have pointer type. Reported-by: kernel test robot <shun.hao@intel.com> Fixes: b68a68d3dcc1 ("signal: Move addr_lsb into the _sigfault union for clarity") Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
-rw-r--r--include/linux/compat.h4
-rw-r--r--include/uapi/asm-generic/siginfo.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 8a9643857c4a..e16d07eb08cf 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -229,13 +229,13 @@ typedef struct compat_siginfo {
229 short int _addr_lsb; /* Valid LSB of the reported address. */ 229 short int _addr_lsb; /* Valid LSB of the reported address. */
230 /* used when si_code=SEGV_BNDERR */ 230 /* used when si_code=SEGV_BNDERR */
231 struct { 231 struct {
232 short _dummy_bnd; 232 compat_uptr_t _dummy_bnd;
233 compat_uptr_t _lower; 233 compat_uptr_t _lower;
234 compat_uptr_t _upper; 234 compat_uptr_t _upper;
235 } _addr_bnd; 235 } _addr_bnd;
236 /* used when si_code=SEGV_PKUERR */ 236 /* used when si_code=SEGV_PKUERR */
237 struct { 237 struct {
238 short _dummy_pkey; 238 compat_uptr_t _dummy_pkey;
239 u32 _pkey; 239 u32 _pkey;
240 } _addr_pkey; 240 } _addr_pkey;
241 }; 241 };
diff --git a/include/uapi/asm-generic/siginfo.h b/include/uapi/asm-generic/siginfo.h
index 85dc965afd89..99c902e460c2 100644
--- a/include/uapi/asm-generic/siginfo.h
+++ b/include/uapi/asm-generic/siginfo.h
@@ -102,13 +102,13 @@ typedef struct siginfo {
102 short _addr_lsb; /* LSB of the reported address */ 102 short _addr_lsb; /* LSB of the reported address */
103 /* used when si_code=SEGV_BNDERR */ 103 /* used when si_code=SEGV_BNDERR */
104 struct { 104 struct {
105 short _dummy_bnd; 105 void *_dummy_bnd;
106 void __user *_lower; 106 void __user *_lower;
107 void __user *_upper; 107 void __user *_upper;
108 } _addr_bnd; 108 } _addr_bnd;
109 /* used when si_code=SEGV_PKUERR */ 109 /* used when si_code=SEGV_PKUERR */
110 struct { 110 struct {
111 short _dummy_pkey; 111 void *_dummy_pkey;
112 __u32 _pkey; 112 __u32 _pkey;
113 } _addr_pkey; 113 } _addr_pkey;
114 }; 114 };