From patchwork Mon Feb 8 12:37:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 379284 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B69C4C433E9 for ; Mon, 8 Feb 2021 12:39:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 68FDA64E82 for ; Mon, 8 Feb 2021 12:39:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230249AbhBHMjX (ORCPT ); Mon, 8 Feb 2021 07:39:23 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:15053 "EHLO mail-40131.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232599AbhBHMiv (ORCPT ); Mon, 8 Feb 2021 07:38:51 -0500 Date: Mon, 08 Feb 2021 12:37:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1612787866; bh=koAMeATYJYWKmkFiz3wj+nM7gDgJYPD0x5UJ1gcespo=; h=Date:To:From:Cc:Reply-To:Subject:From; b=a6WMNoFmMqa0DSoaxn/SdvYQwTY+MQyEcCVxUJ00mURZdp8lg2LUC7OPODuhmmXGw loPJv2L0iKeN7nZQCcXqQ233p7LPNLyZkahtEbf53ALNVmJ4ajiqq1J0KAvgCFTIMN OHbUQy3DQBDTFP6GphtqZFnfex1HhaqFTA5zxrQGangF6SFSn2mIx7K4mv19BeVxzV dSoqb3RvhIn7q/zY1kwVD0/bx1oSLP1zEjt8t35Kbu7YWLTxjxP+mk47YunuCq60wK lDb3wsEzvPpfydmHELCTmQUqHWZiVNTv9GwGP84tH71hIvHY/+w6lRC3B/w4cmmdxT 3lDpVmzqX8X7w== To: Thomas Bogendoerfer From: Alexander Lobakin Cc: Paul Cercueil , Alexander Lobakin , Youling Tang , Jiaxun Yang , Xingxing Su , Huacai Chen , Paul Burton , Hassan Naveed , linux-mips@vger.kernel.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: [PATCH mips-fixes] MIPS: compressed: fix build with enabled UBSAN Message-ID: <20210208123645.101354-1-alobakin@pm.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Commit 1e35918ad9d1 ("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: 1e35918ad9d1 ("MIPS: Enable Undefined Behavior Sanitizer UBSAN") Cc: stable@vger.kernel.org # 5.0+ Signed-off-by: Alexander Lobakin --- arch/mips/boot/compressed/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile index 47cd9dc7454a..f93f72bcba97 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile @@ -37,6 +37,7 @@ KBUILD_AFLAGS := $(KBUILD_AFLAGS) -D__ASSEMBLY__ \ # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in. KCOV_INSTRUMENT := n GCOV_PROFILE := n +UBSAN_SANITIZE := n # decompressor objects (linked with vmlinuz) vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o