]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Apr 2017 10:42:04 +0000 (12:42 +0200)
commitb48b63d5f583f4e66f5efce4951679065b066c8a
treedc3c953d4d0832bea05c0e4024623edae61ad2ec
parent3d44ecc1206e4485f253da81da9f37da7502503a
arm64: mm: unaligned access by user-land should be received as SIGBUS

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>
arch/arm64/mm/fault.c