linux/include
Eric W. Biederman 8420f71943 signal: Correct the offset of si_pkey and si_lower in struct siginfo on m68k
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.  The fix for
_sigfault._addr_bnd._lower having pointer alignment failed to take
into account that m68k has a pointer alignment less than the size
of a pointer.  So simply making the padding members pointers changed
the location of later members in the structure.

Fix this by directly computing the needed size of the padding members,
and making the padding members char arrays of the needed size.  AKA
if __alignof__(void *) is 1 sizeof(short) otherwise __alignof__(void *).
Which should be exactly the same rules the compiler whould have
used when computing the padding.

I have tested this change by adding BUILD_BUG_ONs to m68k to verify
the offset of every member of struct siginfo, and with those testing
that the offsets of the fields in struct siginfo is the same before
I changed the generic _sigfault member and after the correction
to the _sigfault member.

I have also verified that the x86 with it's own BUILD_BUG_ONs to verify
the offsets of the siginfo members also compiles cleanly.

Cc: stable@vger.kernel.org
Reported-by: Eugene Syromiatnikov <esyr@redhat.com>
Fixes: 859d880cf5 ("signal: Correct the offset of si_pkey in struct siginfo")
Fixes: b68a68d3dc ("signal: Move addr_lsb into the _sigfault union for clarity")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2018-04-02 15:09:58 -05:00
..
acpi ACPICA: Update version to 20180105 2018-02-06 10:32:13 +01:00
asm-generic RISC-V changes for 4.16 2018-02-07 11:33:08 -08:00
clocksource
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2018-01-31 14:22:45 -08:00
drm drm/graphics pull request for v4.16-rc1 2018-02-01 17:48:47 -08:00
dt-bindings MIPS changes for 4.16 2018-02-07 11:22:44 -08:00
keys
kvm KVM changes for 4.16 2018-02-10 13:16:35 -08:00
linux signal: Correct the offset of si_pkey and si_lower in struct siginfo on m68k 2018-04-02 15:09:58 -05:00
math-emu
media vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
memory
misc powerpc updates for 4.16 2018-02-02 10:01:04 -08:00
net vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
pcmcia
ras
rdma IB/core: Map iWarp AH type to undefined in rdma_ah_find_type 2018-02-01 15:43:31 -07:00
scsi SCSI postmerge on 20180202 2018-02-03 13:07:56 -08:00
soc ARM: SoC driver updates for 4.16 2018-02-01 16:35:31 -08:00
sound ASoC: Updates for v4.16 2018-02-07 12:11:09 -08:00
target
trace Char/Misc driver patches for 4.16-rc1 2018-02-01 10:31:17 -08:00
uapi signal: Correct the offset of si_pkey and si_lower in struct siginfo on m68k 2018-04-02 15:09:58 -05:00
video fbdev changes for v4.16: 2018-02-07 13:10:43 -08:00
xen