Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3960055pxb; Mon, 8 Feb 2021 04:43:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyGntPB8jjhnZGSRAzyt95zu/zHvYVVFkro5zSWZDbKfIzK1DeqV9fR085ysIAOzsPdGX0T X-Received: by 2002:a17:906:e104:: with SMTP id gj4mr16570738ejb.349.1612788191233; Mon, 08 Feb 2021 04:43:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612788191; cv=none; d=google.com; s=arc-20160816; b=bP0Ep3fALvcdseNjbDzgtEAccug8vnve4wGlwCCp9FS1lMm/85FMV0sdSnunf9zMpj SW6A1KyK5YOi6c/wYJ9LZnzxY36UGiXP4WjuSJpI43k0z3IIi2MIqdur9SGVgR1T1SnP U73qNkDeAYxVj+/EbO+jqS4YnXccDvjtlAXXvy03+Lcw1ZUad/mPQPqgdoA4DCdPkt8n Y5RTgPUgxP22x08G0Z3LPrMuvTtk/gfjgEVV5idxUQkicRG3I5kgFbKnK0nit/4b7+zu CpPTAjJ/piBwStpKUUVFWs82ZVK/DqeRvR4qD5u7Mm0kjJvGqgu+9vRACYdL0ct0z7Fs oj2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:subject:reply-to:cc:from:to:dkim-signature:date; bh=koAMeATYJYWKmkFiz3wj+nM7gDgJYPD0x5UJ1gcespo=; b=oTisrSwnqbCMmbGKPrh/cYSbHTYpxKH0iErNwKsfbHDobi2L/l6QGYu/mOo9DE8Jpy hcKAZB4/xidrr3V50TVBp5Qsyt9XuLNTo9ztBGPByX618BsNGNaYXQ+KBeHknWtSa+Y4 yxlDe2CN04jKh6gc9iEuAkCP1r6KQiQ6uZJRKks4E8aOBxq2I41exoaXk/smRjEY/HQz NKrJIcclY1L7I4l+oNAhaQ7vIoZ7jOYTqb2ieyQdK4AgAqzTbs/2YOTDPHI9KFm2plSG X/aVjB/rL+VbdSBhQYk6sJYZutjoH+A60763jYXH5cOfUB+wuu9ppsVbp8uUI6Ow9NB2 BAZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=a6WMNoFm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q8si11759997edg.566.2021.02.08.04.42.47; Mon, 08 Feb 2021 04:43:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=a6WMNoFm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232008AbhBHMlc (ORCPT + 99 others); Mon, 8 Feb 2021 07:41:32 -0500 Received: from mail-40133.protonmail.ch ([185.70.40.133]:17558 "EHLO mail-40133.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231756AbhBHMit (ORCPT ); Mon, 8 Feb 2021 07:38:49 -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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 :=3D 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 :=3D $(KBUILD_AFLAGS) -D__ASSEMBLY__ \ # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in. KCOV_INSTRUMENT=09=09:=3D n GCOV_PROFILE :=3D n +UBSAN_SANITIZE :=3D n =20 # decompressor objects (linked with vmlinuz) vmlinuzobjs-y :=3D $(obj)/head.o $(obj)/decompress.o $(obj)/string.o --=20 2.30.0