Skip to content

Commit 859d880

Browse files
committed
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: b68a68d ("signal: Move addr_lsb into the _sigfault union for clarity") Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
1 parent 9026e82 commit 859d880

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/linux/compat.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,13 @@ typedef struct compat_siginfo {
229229
short int _addr_lsb; /* Valid LSB of the reported address. */
230230
/* used when si_code=SEGV_BNDERR */
231231
struct {
232-
short _dummy_bnd;
232+
compat_uptr_t _dummy_bnd;
233233
compat_uptr_t _lower;
234234
compat_uptr_t _upper;
235235
} _addr_bnd;
236236
/* used when si_code=SEGV_PKUERR */
237237
struct {
238-
short _dummy_pkey;
238+
compat_uptr_t _dummy_pkey;
239239
u32 _pkey;
240240
} _addr_pkey;
241241
};

include/uapi/asm-generic/siginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ typedef struct siginfo {
102102
short _addr_lsb; /* LSB of the reported address */
103103
/* used when si_code=SEGV_BNDERR */
104104
struct {
105-
short _dummy_bnd;
105+
void *_dummy_bnd;
106106
void __user *_lower;
107107
void __user *_upper;
108108
} _addr_bnd;
109109
/* used when si_code=SEGV_PKUERR */
110110
struct {
111-
short _dummy_pkey;
111+
void *_dummy_pkey;
112112
__u32 _pkey;
113113
} _addr_pkey;
114114
};

0 commit comments

Comments
 (0)