Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10662430pxu; Wed, 30 Dec 2020 08:15:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJzIjARIpZd6T9QCuucdOvkzFx0n2jNNWoxilTr7XtMqMWiLWVIHzSZGxLUka9kVHKqfXjSu X-Received: by 2002:a50:e719:: with SMTP id a25mr50983531edn.12.1609344946257; Wed, 30 Dec 2020 08:15:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609344946; cv=none; d=google.com; s=arc-20160816; b=XaYGHXtPYVtUTcr/DjzhWv1QdHEIDdaTs0f0qv/QnkISkV8ZQXa22c8KawivCN7DXm oVT2iEGtjGOzVhxuRrQalQ1E5++IqA9I4jn4SdHtGwSVNUcH7UlN6EdS+al70k4b7G7h SfHOB2rqb911xN2FrxcvVkmfj/0qXFU5uP5n0Z3roBbRMCKTHZNzEFKRj3hoNcS8ATTB yPGeQJqYGviX+L+IxSj2GRo54zqk1fL0MHYO7Q/oE7790O7RKJjknn6ET2MMXMk+Cw+N x8BBSuI0j59P3qpSliZ9GbrJAlys+aVWlBit1urC2yZhWu6Ofn9eaOW62wh5Akvl+TB2 bBWg== 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=myv7LmSMKbOAYNp52XCR2AQFXn1fM0PNSnfXWuCsuQU=; b=kj+o7FatFEt/cujv+NvNuM35ykHs2mlIPCuSCeeO1zj67JQIPU5NLguKzY1kMZ/WPS BcwHVjMP5wJ4ocDYs/8JWvkSdzvnMyhwAEVbXQ4a/tgvEL/MoFqKG6kzEsc1G4oztI5B GHSH9Kv1r7KnRwITUg2W2uE4thOgg2qn9pZit/1YdK7WAy41BN+4mbE33gAPPMn6Qnlg 05l24xd3jULlZ4ok0cZIO4tLV7mZwGYwNrrjMqfgTNw2FAXFId/jd8sXglNT6OutUqcq 0hlEUvDFGV94E98Rmx+QMZxyG3c+N2xEMsZnE4+jcuU+SDTOjWJYCmE6VsshAPTzZ+B+ +YRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=wJJqpDxk; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t21si29133083edi.2.2020.12.30.08.15.24; Wed, 30 Dec 2020 08:15:46 -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=@google.com header.s=20161025 header.b=wJJqpDxk; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726673AbgL3QN5 (ORCPT + 99 others); Wed, 30 Dec 2020 11:13:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726620AbgL3QN4 (ORCPT ); Wed, 30 Dec 2020 11:13:56 -0500 Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C94C0C06179E for ; Wed, 30 Dec 2020 08:13:15 -0800 (PST) Received: by mail-ot1-x330.google.com with SMTP id d8so15737526otq.6 for ; Wed, 30 Dec 2020 08:13:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=myv7LmSMKbOAYNp52XCR2AQFXn1fM0PNSnfXWuCsuQU=; b=wJJqpDxk89FhrSdmeRRbpDpDnzMbDjNxSou/9hUgyYmZtF66AkrGCGkODZCR2Kc1+D pxW5SXZl3ATkIAfVNzEFeIoXJJ/XOnDUqc3uWjgRAE7OIvSEQgWRQhtldoxi5NNTCOlv nOKWHemXzn2Ryt+hESGzEfuf/nG4U5zGKG7QLzjy36JaCAm8F4+5rNiuiWR2fr4oQ8uT 3uvGjTTD/wXEUvFQ8KASxQhRfeK/QEVUNPil0N5bEWFdPHkHEA/8lvyFLX887qKgCbUj NrWchj6NYB0RLqIEDfjiel0JIAFJVC3xc9rMdztkh5xqix9GQcJVpg8jF2BkRietMZXM 625Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=myv7LmSMKbOAYNp52XCR2AQFXn1fM0PNSnfXWuCsuQU=; b=A1qn5voWtTQiSchryG5G+srTrqxpobB8DoMgtLGj8CcXYNjpz2a1FXa+cD1AOAbVpv 7IhdXTimGEf8/pSmSrg0+OzgXVry3WQnQL+VWswpQ7Hg9351gDtcQ4SEMm+RvCJFOrNM yL4MV6vCCTk0UkNb7mhhzzd/Skfk+wyBZ3hO5pN0TU/4t598bPk9eXod3CvMFFlEFyYG CHB0BsBG251FCl5CzkcPsLYJvYygus1ZlFJaWVgcb6zM1NAxKJQbEiz8ozZ+a9+7Tk3G DiILqr494sdbHpNJh84nolVTQNBQxaDQe8H9ZAf/K+N0UVANS28/+2cVM3GtORfA2IMG aPlQ== X-Gm-Message-State: AOAM533mq4yS4/5hExr3wbRxgd7ZK0mv6L2ylnvqJ9zC/r/GC4cAXynS F6P2CJTEtSi2mpduRk/tfy2ZZ2loaCF6sVyojEGyYQ== X-Received: by 2002:a05:6830:2413:: with SMTP id j19mr41075229ots.251.1609344795027; Wed, 30 Dec 2020 08:13:15 -0800 (PST) MIME-Version: 1.0 References: <20201230154749.746641-1-arnd@kernel.org> In-Reply-To: <20201230154749.746641-1-arnd@kernel.org> From: Marco Elver Date: Wed, 30 Dec 2020 17:13:03 +0100 Message-ID: Subject: Re: [PATCH] ubsan: disable unsigned-integer-overflow sanitizer with clang To: Arnd Bergmann Cc: Kees Cook , Arnd Bergmann , Nathan Chancellor , 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 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. > > 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? > + 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 >