• Helge Deller's avatar
    parisc: Fix unaligned-access crash in bootloader · c42813b7
    Helge Deller authored
    Kernel v5.14 has various changes to optimize unaligned memory accesses,
    e.g. commit 0652035a ("asm-generic: unaligned: remove byteshift helpers").
    
    Those changes triggered an unalignment-exception and thus crashed the
    bootloader on parisc because the unaligned "output_len" variable now suddenly
    was read word-wise while it was read byte-wise in the past.
    
    Fix this issue by declaring the external output_len variable as char which then
    forces the compiler to generate byte-accesses.
    Signed-off-by: default avatarHelge Deller <deller@gmx.de>
    Cc: Arnd Bergmann <arnd@kernel.org>
    Cc: John David Anglin <dave.anglin@bell.net>
    Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162
    Fixes: 8c031ba6 ("parisc: Unbreak bootloader due to gcc-7 optimizations")
    Fixes: 0652035a ("asm-generic: unaligned: remove byteshift helpers")
    Cc: <stable@vger.kernel.org> # v5.14+
    c42813b7
misc.c 7.11 KB