From patchwork Thu Dec 13 12:29:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 153641 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp741656ljp; Thu, 13 Dec 2018 04:29:53 -0800 (PST) X-Google-Smtp-Source: AFSGD/WuBXNk72H3jFX2xNnywZCpvV3PK5RfperypdkH4jYroBGZ4ub110sZ7L5YZb0aAQCQxxun X-Received: by 2002:a63:4456:: with SMTP id t22mr22277862pgk.0.1544704193166; Thu, 13 Dec 2018 04:29:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544704193; cv=none; d=google.com; s=arc-20160816; b=ODNAfA/wqr1mbbqRmx9Cr2wiYOj199cVLKu21I+rl5PKg4evDPUnryZsHhstf8CrRf cXnkyfBSwRwLtcpbG1rCav74gKuLHyLkOk4YzpikocLS5kwru8T4ZALviUjtP8mBnSGY GIgJ8zoWunhWJ7FoKUUKIvzRCcNtUL/SjcQSHtnZUWoROT0G/onULPag8dK0rgWzfXRy N0RqTYQsYQA7j3mig5gScstSA+jofngl6UX2FiDRTRDnr4d9Tg5a6DFqkg7HqV7Vfg5U G5MP70gWQypr0wMyXFCVlqfwhsEh2U3zF0P9WTr/VL2+8EWs5JsH65UdiFt7lBozo3dW c3uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dV/hTXIxVkiR8Pqom795rivE/QoTWKlVk+8ZPKo7nNc=; b=M5OtMyrueT6F43Sf37SH7f6LYSZqITx6AYQAP/bR6yLbI1fza11ApeJiSI2fsnLfjB dWnbFXJpfEZd5ooD+GNgz3LXxJOFBYRxJ/SPkarA4nKKhCHQyHyY1XiJjN8hHtVPT7Ac aqO13zRFNVzd2/pQ/bU0/RcoVGgUA/heEevm1rCpZVHDxfNxnjfZktgr0F7FXnPhTEvL MDPy1q5mius30N0GneOxNF8eiWrzMbSi6H1ZhN4fMo9JfNrz615wB+zOqBufyaGQ9+DM Cg8jVD5ZbjnFVavfefC52s9Xp8qnSKAcolQqc0MADEsfny95JRNo6kJv8W8/xj3JGQlq DEyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z+sCtSQI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s123si1438107pgs.93.2018.12.13.04.29.52; Thu, 13 Dec 2018 04:29:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z+sCtSQI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729046AbeLMM3w (ORCPT + 31 others); Thu, 13 Dec 2018 07:29:52 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:39682 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728517AbeLMM3u (ORCPT ); Thu, 13 Dec 2018 07:29:50 -0500 Received: by mail-lf1-f68.google.com with SMTP id n18so1419011lfh.6 for ; Thu, 13 Dec 2018 04:29:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dV/hTXIxVkiR8Pqom795rivE/QoTWKlVk+8ZPKo7nNc=; b=Z+sCtSQI6d1w2PyQTZN3DSOEeHe7h7NWF/mHHQ5hviG9BVIsKVRhe0TzIsW6hh54Oh 4aeDLIWayzBhy9/AO0Td3p7RTvtnUp2s0KLQtj1EYYICt+THa6dEROo4n8h2Mwwkc8hn 8tfeOSyVhTBGl/KxBge1amBG07ixCE7syRkHo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dV/hTXIxVkiR8Pqom795rivE/QoTWKlVk+8ZPKo7nNc=; b=Zm4/s+K/5JSUgBKy1gzS/bmcqOyw9fwR63CUk9LjbUt0l03zN3CVUfpjjK4a2fKZQ7 liPonwJ7odQ4SU6cjnX20NACd+hOpCwwHWPOS1DLR5h0eEhknDv2ZGNrWR6R1bkuH3PZ WvDYI356VPxPksazqvWJvABdYw8Uf8hkCrHPjcbQ9Q2DNPyAs+0+w00aB8mOoec8X64z B0BbsPQcMArZ/Yrjx4YgCQ/nlP8tg/2gy5Ci9EvrLnqCTNuQalCSEzn1zIBQuxPpQTR5 29XqwBgm4YUV/lDz0oqAP3NW8+ekN0fb1VgwvaHVayIsPk3Bco+UFEfqkZhP9g/wItGB sB4g== X-Gm-Message-State: AA+aEWaAuTqC+OMngLuoqzSaHl2UQsymN4n957HXnzZTrrdcaoDoUBNj ibB9tJVfMsYqeaVBBq00Fido1oug+Ci1kA== X-Received: by 2002:a19:a9d2:: with SMTP id s201mr13430696lfe.154.1544704188129; Thu, 13 Dec 2018 04:29:48 -0800 (PST) Received: from localhost (c-573670d5.07-21-73746f28.bbcust.telenor.se. [213.112.54.87]) by smtp.gmail.com with ESMTPSA id q67sm328120lfe.19.2018.12.13.04.29.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Dec 2018 04:29:47 -0800 (PST) From: Anders Roxell To: linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will.deacon@arm.com, arnd@arndb.de, mingo@redhat.com, rostedt@goodmis.org, akpm@linux-foundation.org, broonie@kernel.org, Anders Roxell Subject: [RFC PATCH 2/3] lib/ubsan: default UBSAN_ALIGNMENT to not set Date: Thu, 13 Dec 2018 13:29:09 +0100 Message-Id: <20181213122910.24193-3-anders.roxell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213122910.24193-1-anders.roxell@linaro.org> References: <20181213122910.24193-1-anders.roxell@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When booting an allmodconfig kernel, there are a lot of false-positives. With a message like this 'UBSAN: Undefined behaviour in...' with a call trace that follows. Reworked so that when building a allmodconfig kernel that turns everything into '=m' or '=y' will turn off UBSAN_ALIGNMENT. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Anders Roxell --- lib/Kconfig.ubsan | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) -- 2.19.2 diff --git a/lib/Kconfig.ubsan b/lib/Kconfig.ubsan index 98fa559ebd80..a2ae4a8e4fa6 100644 --- a/lib/Kconfig.ubsan +++ b/lib/Kconfig.ubsan @@ -27,15 +27,19 @@ config UBSAN_SANITIZE_ALL Enabling this option will get kernel image size increased significantly. -config UBSAN_ALIGNMENT - bool "Enable checking of pointers alignment" +config UBSAN_NO_ALIGNMENT + bool "Disable checking of pointers alignment" depends on UBSAN - default y if !HAVE_EFFICIENT_UNALIGNED_ACCESS + default y if HAVE_EFFICIENT_UNALIGNED_ACCESS help - This option enables detection of unaligned memory accesses. - Enabling this option on architectures that support unaligned + This option disables the check of unaligned memory accesses. + This option should be used when building allmodconfig. + Disabling this option on architectures that support unaligned accesses may produce a lot of false positives. +config UBSAN_ALIGNMENT + def_bool !UBSAN_NO_ALIGNMENT + config TEST_UBSAN tristate "Module for testing for undefined behavior detection" depends on m && UBSAN