From patchwork Mon Dec 17 15:03:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 154003 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2567899ljp; Mon, 17 Dec 2018 07:03:38 -0800 (PST) X-Google-Smtp-Source: AFSGD/XYG/RYEkhtCr5x0Lcq48Bu0o4MLv81Dt9PEZIqLz33/qlCS1bZLR3wc/MLo7cikkv9nt4o X-Received: by 2002:a17:902:227:: with SMTP id 36mr13124917plc.140.1545059018654; Mon, 17 Dec 2018 07:03:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545059018; cv=none; d=google.com; s=arc-20160816; b=a3kRMu7M1zZO1uDhmyN2lhoQmMz/WjWerfEe0QxAy4A27sWhBrBXmcbdvwldrWHWjs +RgKF10II/dOzfSE5oxv4gQGdvhUiZRazUXVx0apgeKcqz0iWh4ikvR7SZ2xxhdIQbUV i3yk1G2xe9c+349rSiBR1uhBKy5eHh6xuTaLjZ2dWtPNZs8PNCd1G4hMP3Xudiouw5wb SYvxz5rtKTKeMIN2eTgrd2enMebbf2vXOyxsmj7qmOnB3fZmFCPQRxLGFMRh46na9AYl XBtgpwLY/BQc5nYkC1B/S2KHuZl4kTPcEX+StmKnHVQ9HwiCIn1ojKSORno79fCNWkLj zqQg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=PQMuRzWOBhHTvXfYtOTPGwd5FvN5/WsTMjmOY5C33tI=; b=sFUq+dbJ0PYnXeTLfDdrRWmG26hB9DN/OWkRO2ilyrrI8TC5JFjvDrtMky7oQYg62K kEhsJeAG09tEi0RfItyPUirA0WMnmpLw1HuIYHdSL/TkF6iVEOgjYJ1YXWlVG/ZEw9c9 L2x3xuxg6fTVstudnNSaAXt2kxHbDc4iINXWBK2dboIjY97NHecCe0/Xll7XLUk3jU2N ZRS7G44ZNR/04ei5iwJG0GcDVU1iNZVhsHzKRO3zfN6pbe3xtIE+ElTvFKbokfCeWW8y QwWbadi52ov6bw3hrlVusGLvt/QmHccBmmM162xFeebnrNe8dMzAyuwWmRxozgtIIWD1 qW5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Vw0Yios/"; 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 k22si10582610pls.14.2018.12.17.07.03.38; Mon, 17 Dec 2018 07:03:38 -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="Vw0Yios/"; 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 S2387827AbeLQPDh (ORCPT + 31 others); Mon, 17 Dec 2018 10:03:37 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:33258 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387771AbeLQPDe (ORCPT ); Mon, 17 Dec 2018 10:03:34 -0500 Received: by mail-lf1-f67.google.com with SMTP id i26so9695554lfc.0 for ; Mon, 17 Dec 2018 07:03:33 -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:mime-version :content-transfer-encoding; bh=PQMuRzWOBhHTvXfYtOTPGwd5FvN5/WsTMjmOY5C33tI=; b=Vw0Yios/NN0dTV584a1Qod/ElQP5ApqFVgTyy5SAdlZaDd6bIbsbv2W99RoZferYv/ IvoO165WLhANh8vvuZzBSvRRtqMKBE4a2eTcdkhQlBSgymQj+zftWz4mIH9oJUaU+H4j sdNbgXrjHP6DikeTuSjBrdWE02dsWtKj2QQ0s= 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:mime-version :content-transfer-encoding; bh=PQMuRzWOBhHTvXfYtOTPGwd5FvN5/WsTMjmOY5C33tI=; b=dO4tylhOG8DxIuWB+GLOy7Pk/SOZexmZPa1opQV9m4RPAIPTxWZ8yJZgZQhg94qr7Z 9IyDv8nZP+c6ZPy+aM4wD+cldsL/cwMfof0V2032qUDeg12/7b97joqkpJF5O7W0J9SV OcetJtxaZKz3kgvjquHedQeCwDltyY+RfHuUhqbeRi8IbH3AYb3j7k88OuLShIRy3qOR 7sb4QF31km9RYHJE/7HGvEdwyLaiY+cAYAA/isFm87YQyZD7zX9tpX2CLaI6bS8nz0TQ T4DhLalUqoRtFbkkbUPnU8Fd9hr/vsctLVo3cvZXhCHONXXK3FiLYuL0fkbXczUeiyN+ iC0g== X-Gm-Message-State: AA+aEWZcPPjBdElHyf/YRj6Aq4fU0juxjWlIdkVUwxY8pfv1kyuHZOEW 1VBoR1nhrb8USURV/uSzzws1Lw== X-Received: by 2002:a19:3809:: with SMTP id f9mr7249686lfa.148.1545059012077; Mon, 17 Dec 2018 07:03:32 -0800 (PST) Received: from localhost (c-573670d5.07-21-73746f28.bbcust.telenor.se. [213.112.54.87]) by smtp.gmail.com with ESMTPSA id z15-v6sm3030076ljb.9.2018.12.17.07.03.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Dec 2018 07:03:31 -0800 (PST) From: Anders Roxell To: aryabinin@virtuozzo.com Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, Anders Roxell Subject: [PATCH] lib/ubsan: default UBSAN_ALIGNMENT to not set Date: Mon, 17 Dec 2018 16:03:26 +0100 Message-Id: <20181217150326.30933-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.19.2 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. Suggested-by: Arnd Bergmann Signed-off-by: Anders Roxell --- lib/Kconfig.ubsan | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) -- 2.19.2 Acked-by: Andrey Ryabinin 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