]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
arm64: mm: unaligned access by user-land should be received as SIGBUS
authorVictor Kamensky <kamensky@cisco.com>
Tue, 4 Apr 2017 05:51:01 +0000 (22:51 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 21 Apr 2017 08:12:03 +0000 (10:12 +0200)
commiteec2e726fd16fc585fc7b3d8bfd3d88b22ae2ff9
treef32b3670d5b6eb123db56065c0b20794e8aa5e56
parent829ddbdf98a38c15728e67285a629518327b6503
arm64: mm: unaligned access by user-land should be received as SIGBUS

BugLink: http://bugs.launchpad.net/bugs/1682130
commit 09a6adf53d42ca3088fa3fb41f40b768efc711ed upstream.

After 52d7523 (arm64: mm: allow the kernel to handle alignment faults on
user accesses) commit user-land accesses that produce unaligned exceptions
like in case of aarch32 ldm/stm/ldrd/strd instructions operating on
unaligned memory received by user-land as SIGSEGV. It is wrong, it should
be reported as SIGBUS as it was before 52d7523 commit.

Changed do_bad_area function to take signal and code parameters out of esr
value using fault_info table, so in case of do_alignment_fault fault
user-land will receive SIGBUS. Wrapped access to fault_info table into
esr_to_fault_info function.

Fixes: 52d7523 (arm64: mm: allow the kernel to handle alignment faults on user accesses)
Signed-off-by: Victor Kamensky <kamensky@cisco.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
arch/arm64/mm/fault.c