From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 1D8B7C433DB for ; Tue, 5 Jan 2021 09:27:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC1C520756 for ; Tue, 5 Jan 2021 09:27:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728004AbhAEJ0d (ORCPT ); Tue, 5 Jan 2021 04:26:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:48480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727952AbhAEJ0c (ORCPT ); Tue, 5 Jan 2021 04:26:32 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0E91D225AB for ; Tue, 5 Jan 2021 09:25:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609838751; bh=6YcEbyb0mWj5M2FEgdl7ah8B/CmHEaHYSdxmMoFXLk4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Z/71uaSm0zwFCN/MPDEALltHXlKLmxlduCv9AMIO8wRSJkLjCXP7xqKVs5+IH4xgq MB/WeU5sS+QVTomwOIDRkACs/a7Lgz//pnk7vddNy8Q4k7NrNPyMvMj1LGfjHq2BQ/ /hM00ZwBWBQEEzK4EFAKzYl4Heex0CnHByckwUWa9ZnBL+Oyw3XJy5/FcCx9xzpUIw ABh8FqRwro8JLcZ3umeAAaBj5Kt/yCgMPOa1tcQcCK8OZL++lAsnIlrMX75YfHY7PX YgAoZDCpy+Hh181P4eeZKN/sXB0hKwXyoswty8rRZbPT4OmzzsYk7sakMNgl6PEiDE mBgYcMPx8ePgg== Received: by mail-oi1-f182.google.com with SMTP id f132so35296165oib.12 for ; Tue, 05 Jan 2021 01:25:51 -0800 (PST) X-Gm-Message-State: AOAM5332JFNdqBDJPsdQ1fd0Hih0JcFAcP0dICJaYqwe3K0dilfVto7O 37My9woaOBibwB2dj6xe9xulubHZ2/fMs8GA1/0= X-Google-Smtp-Source: ABdhPJxG6BDEpmw49rUMPuoc6EceKxV9Srws+1fH28WqHYy0IyZzT6fUPTwjbJYpUluapDVt1eFdKl9hW/hsNv+9axc= X-Received: by 2002:aca:e103:: with SMTP id y3mr1948395oig.11.1609838750247; Tue, 05 Jan 2021 01:25:50 -0800 (PST) MIME-Version: 1.0 References: <20201230154749.746641-1-arnd@kernel.org> <20210104223336.GA2562866@ubuntu-m3-large-x86> In-Reply-To: <20210104223336.GA2562866@ubuntu-m3-large-x86> From: Arnd Bergmann Date: Tue, 5 Jan 2021 10:25:34 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] ubsan: disable unsigned-integer-overflow sanitizer with clang To: Nathan Chancellor Cc: Marco Elver , Kees Cook , Arnd Bergmann , Nick Desaulniers , Andrew Morton , George Popescu , Stephen Rothwell , LKML , clang-built-linux Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 4, 2021 at 11:33 PM Nathan Chancellor wrote: > On Wed, Dec 30, 2020 at 05:13:03PM +0100, Marco Elver wrote: > > On Wed, 30 Dec 2020 at 16:47, Arnd Bergmann wrote: > > > > > > From: Arnd Bergmann > > > > > > Building ubsan kernels even for compile-testing introduced these > > > warnings in my randconfig environment: > > > > > > crypto/blake2b_generic.c:98:13: error: stack frame size of 9636 bytes in function 'blake2b_compress' [-Werror,-Wframe-larger-than=] > > > static void blake2b_compress(struct blake2b_state *S, > > > crypto/sha512_generic.c:151:13: error: stack frame size of 1292 bytes in function 'sha512_generic_block_fn' [-Werror,-Wframe-larger-than=] > > > static void sha512_generic_block_fn(struct sha512_state *sst, u8 const *src, > > > lib/crypto/curve25519-fiat32.c:312:22: error: stack frame size of 2180 bytes in function 'fe_mul_impl' [-Werror,-Wframe-larger-than=] > > > static noinline void fe_mul_impl(u32 out[10], const u32 in1[10], const u32 in2[10]) > > > lib/crypto/curve25519-fiat32.c:444:22: error: stack frame size of 1588 bytes in function 'fe_sqr_impl' [-Werror,-Wframe-larger-than=] > > > static noinline void fe_sqr_impl(u32 out[10], const u32 in1[10]) > > > > > > Further testing showed that this is caused by > > > -fsanitize=unsigned-integer-overflow. > > > > > > The one in blake2b immediately overflows the 8KB stack area on 32-bit > > > architectures, so better ensure this never happens by making this > > > option gcc-only. > > This patch also fixes the failed BUILD_BUG issue in mm/mremap.c that you > sent a patch for [1], along with a couple of other issues I see such as: I'm fairly sure I still saw that BUILD_BUG() even after I had applied this patch, I would guess that one just depends on inlining decisions that are influenced by all kinds of compiler options including -fsanitize=unsigned-integer-overflow, so it becomes less likely. I'll revert my other patch in the randconfig tree to see if it comes back. Arnd