• A
    MIPS: compressed: fix build with enabled UBSAN · 3513e23f
    Alexander Lobakin 提交于
    stable inclusion
    from stable-5.10.26
    commit 559b842a64ffb34390cf1545c9843affdb23535d
    bugzilla: 51363
    
    --------------------------------
    
    [ Upstream commit fc4cac4c ]
    
    Commit 1e35918a ("MIPS: Enable Undefined Behavior Sanitizer
    UBSAN") added a possibility to build the entire kernel with UBSAN
    instrumentation for MIPS, with the exception for VDSO.
    However, self-extracting head wasn't been added to exceptions, so
    this occurs:
    
    mips-alpine-linux-musl-ld: arch/mips/boot/compressed/decompress.o:
    in function `FSE_buildDTable_wksp':
    decompress.c:(.text.FSE_buildDTable_wksp+0x278): undefined reference
    to `__ubsan_handle_shift_out_of_bounds'
    mips-alpine-linux-musl-ld: decompress.c:(.text.FSE_buildDTable_wksp+0x2a8):
    undefined reference to `__ubsan_handle_shift_out_of_bounds'
    mips-alpine-linux-musl-ld: decompress.c:(.text.FSE_buildDTable_wksp+0x2c4):
    undefined reference to `__ubsan_handle_shift_out_of_bounds'
    mips-alpine-linux-musl-ld: arch/mips/boot/compressed/decompress.o:
    decompress.c:(.text.FSE_buildDTable_raw+0x9c): more undefined references
    to `__ubsan_handle_shift_out_of_bounds' follow
    
    Add UBSAN_SANITIZE := n to mips/boot/compressed/Makefile to exclude
    it from instrumentation scope and fix this issue.
    
    Fixes: 1e35918a ("MIPS: Enable Undefined Behavior Sanitizer UBSAN")
    Cc: stable@vger.kernel.org # 5.0+
    Signed-off-by: NAlexander Lobakin <alobakin@pm.me>
    Signed-off-by: NThomas Bogendoerfer <tsbogend@alpha.franken.de>
    Signed-off-by: NSasha Levin <sashal@kernel.org>
    Signed-off-by: NChen Jun <chenjun102@huawei.com>
    Acked-by: N  Weilong Chen <chenweilong@huawei.com>
    Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
    3513e23f
Makefile 4.5 KB