• Victor Kamensky's avatar
    arm64: mm: unaligned access by user-land should be received as SIGBUS · 09a6adf5
    Victor Kamensky authored
    After 52d7523d (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 52d7523d 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.
    
    Cc: <stable@vger.kernel.org>
    Fixes: 52d7523d (arm64: mm: allow the kernel to handle alignment faults on user accesses)
    Signed-off-by: default avatarVictor Kamensky <kamensky@cisco.com>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    09a6adf5
fault.c 19.5 KB