Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14444358pxu; Tue, 5 Jan 2021 01:30:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyolIu2HWTTY+SGtFiWmxNb7oByz41KAOsTQrskWH7QWstirid3qxPCSkUsNDi1WEemtl5L X-Received: by 2002:a17:906:edb2:: with SMTP id sa18mr67089392ejb.264.1609839027537; Tue, 05 Jan 2021 01:30:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609839027; cv=none; d=google.com; s=arc-20160816; b=Da1uf18RlRMdZjcwTa0pd5prqc3YB3xd4pO2p52PbdMtsYg2gEdk9IUZ0yCOa9xgx6 f5ubu68/tLX/FXCnibLrRu3SYYRMsRWtm+2MSuMj240Jzjj2F+q+qFnevpIhUwizRpF7 O7bF422kzUAhLPWne+YgC52mLRfmdBbuRhefjWycVKM0L9OGt9h+X9lLPnUObcDL27um j6y2dz7MeRwo8QFvZGQeaJ2yKdoRmypHm7fVnENvo4CI4L4pl80bJZ5AC3nSLUMOZm+z 7VVuNR593wkmT0s31/psLmeorrJ23/aDRjokF2lMP1f6Iuik4sus/kYU/q5KYfS3cODU H5mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HkAC+sQU2caKDXYpVORe5giEwVf8AvsRrkNW4cn2Lo0=; b=vUbhLI/pYgxWLuIXnV/Y6SBxtYW3SLgvnuejYefJtZz9p0sajZ3fUVQcqcamz/PkgQ 0i/L7GxOxvkSBFwMS/KVO/a4wW9rcdzGzqmUUz9LjxE1xTTdKS+/22+A0C2/7+RYda4p 05PS+T3N9xE8NX0FKouIHcPteo+3uL5rlkCmxXhigAl02zKQTjxzFD/b2nUA0+YyczKU NyiHLYGZUJ/SQVBKbET3VrXXMMphFFy44t68KUepKC+wDcIPbfdzJCXzfHuhVVTKwY41 WAwSnLNBLOuNgUyk0n7zOWpVNxi3w6CjgRxzKKKKGHas4i/1+dT+a2xhrB4BTcQpXmZf rtUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Z/71uaSm"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si35482681edq.488.2021.01.05.01.30.04; Tue, 05 Jan 2021 01:30:27 -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=@kernel.org header.s=k20201202 header.b="Z/71uaSm"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727957AbhAEJ0d (ORCPT + 99 others); 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-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