From patchwork Wed Sep 28 17:47:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12992637 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A0A39C04A95 for ; Wed, 28 Sep 2022 17:48:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=5dVKqNP/hSPCnZrMRR99Ig+25efRKIcuMLcWhOHz70I=; b=4fT3GnJB0+eV5x 3oExGF/w+h55X7J5e3Kk3MhIrTJLsNp7D+xWKJofqkd5RObMYAh9aN/jMfelpcfHT/JACuKc8t2+j zLwVjrNJcjgWS64X+F8MMXhafhRmnfCAZ2zM41ZKj9XMKZsXmrY1TrdZbRjyMpU0zfgv7YInXoBIj +TfSrP5tCyJanEzlJqFTJf8sHxtxyglWWOiVZPbFQ7rET93a99NHGQp99s+HOEa2zMbVBc2n+VOu4 4ApIuQ5EOFrxC7uPBuuRkDELOFmWNV3PbSddtqzq+61w98HPVRcdLPYqgp3f+HUTUKIuvTC6g7a2Q yHlKIpGhpj855ZBnF8YA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1odbA0-00HRPW-Ce; Wed, 28 Sep 2022 17:47:52 +0000 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1odb9x-00HROM-It for linux-arm-kernel@lists.infradead.org; Wed, 28 Sep 2022 17:47:50 +0000 Received: by mail-qk1-x72e.google.com with SMTP id y2so8314238qkl.11 for ; Wed, 28 Sep 2022 10:47:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=aA3qVwDfXk6gW3N9gfO3b8QmZQDBhWPw3YeAgQkYfwk=; b=Xt66a5RMHJ0ao0Cd4AzI7ZuexcX0+6IVNNW7P7uC/Xew/iC+lAk/vR31HaXK5rkLni SJUqJCS2D9UiHL9AVArzhPKwKZzIueHl5SZxl+geV4I8SPat50IjTEWr8EI//i9ZCrs7 +1QB4YUQBMCHjgG+JWIS5NcqDOb1zXG/7i20OHevZ16sQkkLF0OXv15Vj3avp1+ChjQX 8zmg25tlP4IAhT9QKEadyduEigVT/wE4cKo+h5YIkpIXq8P858DhNqfPi3rSNrCevxU7 7RYiTdjOLQffEfsiXwhShvWmYOaSmzmlJjUlU0+Fn/f6JX6zL+9UtqowlhguFOWB8gMU lG+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=aA3qVwDfXk6gW3N9gfO3b8QmZQDBhWPw3YeAgQkYfwk=; b=Tv6JJ+61aN0uCHOTIng2USvfpM7h6+PF9dc1ESoF3I0snLd7MFk+ua7kbFK4JoOo/z 0VO6WdUKuUEFbCgGQgQVXhO2xpjmKFmF8lozjWv3YIdYbCvObOYZOUnt8HEE+7IlLAvb 4fRf7YsOmLS2M6Vy5IpxYyFkgDFSq9MGjpkbFPYDymOLHrlNwgHBPxUreBblepogsEQr BxUOJOy6o4rVQVHYQdsWzdIk4psjXN5u+nOcs4MSbeUOaqz9JDBvUibKlbUNMCc2aUlm dm2jmkzLKFSUScOPfUHwSkSqqY82nzoTHGFY+3Rel3HxgfQLqOBoCTO6CEDn7V+wzd+t wx2Q== X-Gm-Message-State: ACrzQf0I279+16vuIgZZM68uoFOnLXmqzpy6tDvSbC3HCrMcyyL9Vcq1 2TdLFnPfM4g51j70w5boBinxHbmFPKA= X-Google-Smtp-Source: AMsMyM6xP437moLPf6m7CNUHbTWnkEWBM8cY6GdSmMeceQYwjFhYL9mh+tPZDb+xpl1HrLBR7f6v5w== X-Received: by 2002:a05:620a:458a:b0:6ce:be36:a1f8 with SMTP id bp10-20020a05620a458a00b006cebe36a1f8mr22643075qkb.525.1664387267896; Wed, 28 Sep 2022 10:47:47 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id bl18-20020a05620a1a9200b006ce30a5f892sm3375945qkb.102.2022.09.28.10.47.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 10:47:47 -0700 (PDT) From: Florian Fainelli To: linux-arm-kernel@lists.infradead.org Cc: Seung-Woo Kim , Florian Fainelli , Russell King , Arnd Bergmann , Linus Walleij , Ard Biesheuvel , "Russell King (Oracle)" , "Steven Rostedt (Google)" , Nick Hawkins , John Crispin , Masahiro Yamada , Nicolas Schier , Nick Desaulniers , Kees Cook , linux-kernel@vger.kernel.org (open list), bcm-kernel-feedback-list@broadcom.com, anand.gore@broadcom.com, william.zhang@broadcom.com Subject: [PATCH] ARM: ubsan: select ARCH_HAS_UBSAN_SANITIZE_ALL Date: Wed, 28 Sep 2022 10:47:39 -0700 Message-Id: <20220928174739.802806-1-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220928_104749_648731_1A16A433 X-CRM114-Status: GOOD ( 12.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Seung-Woo Kim To enable UBSAN on ARM, this patch enables ARCH_HAS_UBSAN_SANITIZE_ALL from arm confiuration. Basic kernel bootup test is passed on arm with CONFIG_UBSAN_SANITIZE_ALL enabled. Signed-off-by: Seung-Woo Kim [florian: rebased against v6.0-rc7] Signed-off-by: Florian Fainelli Tested-by: William Zhang --- arch/arm/Kconfig | 1 + arch/arm/boot/compressed/Makefile | 1 + arch/arm/vdso/Makefile | 1 + 3 files changed, 3 insertions(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 87badeae3181..c90aa58eab7f 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -27,6 +27,7 @@ config ARM select ARCH_HAVE_NMI_SAFE_CMPXCHG if CPU_V7 || CPU_V7M || CPU_V6K select ARCH_HAS_GCOV_PROFILE_ALL select ARCH_KEEP_MEMBLOCK + select ARCH_HAS_UBSAN_SANITIZE_ALL select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_NO_SG_CHAIN if !ARM_HAS_SG_CHAIN select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 41bcbb460fac..2cc2af13779e 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -27,6 +27,7 @@ KASAN_SANITIZE := n # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in. KCOV_INSTRUMENT := n +UBSAN_SANITIZE := n # # Architecture dependencies diff --git a/arch/arm/vdso/Makefile b/arch/arm/vdso/Makefile index 8ca1c9f262a2..a7ec06ce3785 100644 --- a/arch/arm/vdso/Makefile +++ b/arch/arm/vdso/Makefile @@ -37,6 +37,7 @@ endif # Disable gcov profiling for VDSO code GCOV_PROFILE := n +UBSAN_SANITIZE := n # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in. KCOV_INSTRUMENT := n