Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14189027pxu; Mon, 4 Jan 2021 15:40:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxDkanpsUY77n8dJ4LtbKzNng+mNcqfUdAxxixQ3MEGFz+/ZBkhmLf4lPq52UKUXJH7j6S X-Received: by 2002:a05:6402:2da:: with SMTP id b26mr73710960edx.350.1609803608302; Mon, 04 Jan 2021 15:40:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609803608; cv=none; d=google.com; s=arc-20160816; b=AcNPiMERr39eHl5Cfda8QRMmxubsAG0C5r7OIGs7gxO7oB28Tcbmzw3zmmmHUqYjIp A9nwSUTWPfOSwCnEoOSVnJt2tWREmD8w2u/pOB84+oB2Xmomag6ObHiuEWJ4buloU4jI FjJ2IR2DTjE1pbe49jJJhYDgJlNIAwzLuLCwImktj5rHt2FWfixC1wrUIhOP4fuHFFxv uiLV35HbMNfgiGpnWu7sarS4L4C2YfoKrswnNrktBy/aPYbcfGFNhd3po5ZN0/d4ajgH UwAemh9ySXPiLNXwqTGD7z1K9DIUmnGWsULUjdYW7bzL4hNB1UmCEm7bnwwvDOw9E0x1 dXjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Uxg7zL2o2W1pUcEzcScyKfNn1LjA1ShXjqEgvTJLC0E=; b=LnwaCi5ivqZHbvJN39wu5Bz01MTKn6erdms4MNBoEw1U4xL03NfeBu3JNCAdscoOn/ HLTtbn6FtTilFR3BQyMy7AKuCHKwTJPTXE28sidCCs9ao78U3AmeUlO2Ixet0IYUjAvM kXuJY3GVglKyMM5BQQRFhwbvSGXqvGrZ1qj/HOfJU8DQgws42xtbr5p91XH0ghl7udeA 8jM1vRa7y8EsPaTAhVGV08KFr2r+w/xAMSPwAGif0URK/hhsGuVc4EQ7+2eR0XDeBDi9 vvyQ9mIxP49XMnmL04/9A2BrtY94pu7H1ywok8LGTmCMW1sScFtzo02Jfc4n2l5Pn0r5 0C3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=P6kivpFJ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gz21si29827360ejb.604.2021.01.04.15.39.44; Mon, 04 Jan 2021 15:40:08 -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=@gmail.com header.s=20161025 header.b=P6kivpFJ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727766AbhADXhq (ORCPT + 99 others); Mon, 4 Jan 2021 18:37:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727695AbhADXhq (ORCPT ); Mon, 4 Jan 2021 18:37:46 -0500 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98C3DC061793 for ; Mon, 4 Jan 2021 15:37:05 -0800 (PST) Received: by mail-io1-xd32.google.com with SMTP id t8so26604666iov.8 for ; Mon, 04 Jan 2021 15:37:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Uxg7zL2o2W1pUcEzcScyKfNn1LjA1ShXjqEgvTJLC0E=; b=P6kivpFJamY083IAC1lr8AMM6N3XqD7SYdgsJ25mjg95b3MCh7l+PDPM0jBgb/FgQK 3mBx+slDciyhEQJIJDKBElOSGt689rDwR0aQbfaKkjHMUjPaWuklCLCLOdVOzHGfTvdf tkMD6x7IXW7XOnGzcBMjKUjGnToyJE2+gYFWgLlgdF0juLojL2MWx+z4hf8CvMFti7fr h2fTymO9v2l1Vr1jveICCzCY032bixvyCe+402b8aNlFnopUm9Am37bZ164uXM0fhSQq ppxDb7RgoPzjCXVIPR3LiMve4x/ojEp6u8hKsahu58uxGY6mYHmJrwzUNmmtr/rYNgBd ayjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Uxg7zL2o2W1pUcEzcScyKfNn1LjA1ShXjqEgvTJLC0E=; b=cLMyZeiOhBYfG0YwYZzM8DFvVjvejdwAeA3aKLj9ozhKKxJNLxk4ANtZFnAkAcNFNl eaDzlf7PkqCmUP+Lhzoz2rR+ydPcb1WO4gqL5zlwWiMbvo+9BknUKTiSYroPoz/xGeqA W0rq+NvQ5EMGPbynWNZbODdGiz0+hrNKiceR+BwOWQ8CY7mD6iV5MxHGLc/23ZwxQsm5 JtUzd053MqSEjxAetzl4l9az4CxPOw244iB38KQRcQ58/675oolUXnV/JCOg77jYpPbt ErnhYV0t7cMEUGPx+R4zu+1UPjo03Pk/50MO4x9LX46nA8/WCXAZ5uh97dSRchvUtdYN scgw== X-Gm-Message-State: AOAM530u65dNJKTpHRcENM2uTEpXUhbQWKYYNgcLT4hz1oTjrjtLNgAe rMikqZVlhP0e1Nuo8qaP6B1StNg38WmpDg== X-Received: by 2002:ac8:5159:: with SMTP id h25mr41268979qtn.199.1609799618534; Mon, 04 Jan 2021 14:33:38 -0800 (PST) Received: from ubuntu-m3-large-x86 ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id 74sm37192516qko.59.2021.01.04.14.33.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jan 2021 14:33:37 -0800 (PST) Date: Mon, 4 Jan 2021 15:33:36 -0700 From: Nathan Chancellor To: Marco Elver Cc: Arnd Bergmann , Kees Cook , Arnd Bergmann , Nick Desaulniers , Andrew Morton , George Popescu , Stephen Rothwell , LKML , clang-built-linux Subject: Re: [PATCH] ubsan: disable unsigned-integer-overflow sanitizer with clang Message-ID: <20210104223336.GA2562866@ubuntu-m3-large-x86> References: <20201230154749.746641-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: ld.lld: error: undefined symbol: __bad_mask >>> referenced by gpi.c >>> dma/qcom/gpi.o:(gpi_update_reg) in archive >>> drivers/built-in.a >>> referenced by gpi.c >>> dma/qcom/gpi.o:(gpi_update_reg) in archive >>> drivers/built-in.a [1]: https://lore.kernel.org/lkml/20201230154104.522605-1-arnd@kernel.org/ Reviewed-by: Nathan Chancellor > > Fixes: d0a3ac549f38 ("ubsan: enable for all*config builds") > > Signed-off-by: Arnd Bergmann > > --- > > lib/Kconfig.ubsan | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/lib/Kconfig.ubsan b/lib/Kconfig.ubsan > > index 8b635fd75fe4..e23873282ba7 100644 > > --- a/lib/Kconfig.ubsan > > +++ b/lib/Kconfig.ubsan > > @@ -122,6 +122,8 @@ config UBSAN_SIGNED_OVERFLOW > > > > config UBSAN_UNSIGNED_OVERFLOW > > bool "Perform checking for unsigned arithmetic overflow" > > + # clang hugely expands stack usage with -fsanitize=object-size > > This is the first time -fsanitize=object-size is mentioned. Typo? Copy and paste issue from CONFIG_UBSAN_OBJECT_SIZE > > + depends on !CC_IS_CLANG > > depends on $(cc-option,-fsanitize=unsigned-integer-overflow) > > help > > This option enables -fsanitize=unsigned-integer-overflow which checks > > -- > > 2.29.2 > >