summaryrefslogtreecommitdiff
path: root/arch/mips/loongson64
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2016-11-07 15:07:03 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-12 05:41:40 (GMT)
commitce449cbdcff78a383741bc79d66f2779a556735b (patch)
tree6686232a26f295e3d8b04cafe450b353ce0aa0dc /arch/mips/loongson64
parentd0eae5bbd1c3361659c3c0e349c14123f0aaba81 (diff)
downloadlinux-ce449cbdcff78a383741bc79d66f2779a556735b.tar.xz
MIPS: Prevent unaligned accesses during stack unwinding
commit a3552dace7d1d0cabf573e88fc3025cb90c4a601 upstream. During stack unwinding we call a number of functions to determine what type of instruction we're looking at. The union mips_instruction pointer provided to them may be pointing at a 2 byte, but not 4 byte, aligned address & we thus cannot directly access the 4 byte wide members of the union mips_instruction. To avoid this is_ra_save_ins() copies the required half-words of the microMIPS instruction to a correctly aligned union mips_instruction on the stack, which it can then access safely. The is_jump_ins() & is_sp_move_ins() functions do not correctly perform this temporary copy, and instead attempt to directly dereference 4 byte fields which may be misaligned and lead to an address exception. Fix this by copying the instruction halfwords to a temporary union mips_instruction in get_frame_info() such that we can provide a 4 byte aligned union mips_instruction to the is_*_ins() functions and they do not need to deal with misalignment themselves. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Fixes: 34c2f668d0f6 ("MIPS: microMIPS: Add unaligned access support.") Cc: Leonid Yegoshin <leonid.yegoshin@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/14529/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/mips/loongson64')
0 files changed, 0 insertions, 0 deletions