Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp43607pxb; Tue, 12 Jan 2021 19:30:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1URcDW3Y2pLtgHDoyeZBZlDdjykG7Ci9Ntd0HpCcZA5qRb/C/EbEeqLUIQx74s4wvynKu X-Received: by 2002:a05:6402:c1c:: with SMTP id co28mr134142edb.287.1610508652050; Tue, 12 Jan 2021 19:30:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610508652; cv=none; d=google.com; s=arc-20160816; b=H5U3+ptFsMwxttJZwt8XK4o+I+KyX6SgYneogPV01HcXdxUu+PFa8MHiCwhehuuX+O VvjeKhvDzjnPzlkf1lZd4LysH8y8VxAMdJRAlGs11Gf+BuyMywuBWWSlGjTtrm3Svgfj 0ROTkjFgI3YIGWhmjYWvGNWrcs0HrkpFbo4csEazA+3jeZQDfOdpUELgP4uxc8/kGWD8 qQUw0lee/fYPkkRnhtKBk5SqysRnVAYlpsglJBd9+9qIfZ2DcB35gYN+ocJc3MEXexHU HtZopwStzTW0uhCdXjw3H/52ISgT2iKRYACgS+4N1r61rbPaOPiExW/nyEIQxTQSuH1N y/Gw== 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=XeBDJRibr1ouaq233G4wwpyDOJDmBO5yojbVUYPMv1E=; b=KecrodbcYGYzqLuSXJY0FOAiD8PdI3goDkR+7jd/XDtj0jPPfryTEc0yNr83kep7Sg X3J8NtMNN20IpnJQO2w6h7Q0fxz41jg8VNp2lPVLKnKn/ZuNea+fXVWS1kPhbMIB/7XV /bxZmliPTCyz19AWVjt9nr1vsbYH0vsisR0hRnAZhrcagFnZFgbhf+BbJnCGqMzpXXLt ptwAg+AQDrQB92LTZAAXo2Hi0B0OkvGmErD/s+rxyTRs69IhNfzD74xwjDBTrMqDTkIa Sixew0GEFx5kPr0v+cGIwuElnSa35waeSaZ/P4iyyxLDrc1JaJ70Mv840TOO7wHliZ6Y 7HIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OdmEPx3t; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k23si376261ejk.337.2021.01.12.19.30.28; Tue, 12 Jan 2021 19:30:52 -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=@chromium.org header.s=google header.b=OdmEPx3t; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404377AbhAMAm4 (ORCPT + 99 others); Tue, 12 Jan 2021 19:42:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392021AbhALXyd (ORCPT ); Tue, 12 Jan 2021 18:54:33 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E36DC061575 for ; Tue, 12 Jan 2021 15:53:53 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id w1so2204279pjc.0 for ; Tue, 12 Jan 2021 15:53:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=XeBDJRibr1ouaq233G4wwpyDOJDmBO5yojbVUYPMv1E=; b=OdmEPx3tjMv+nYuUOrb5L41awBIdb+WpTFqUBYqea0EbMGIBmb6SbVBggV867v1I0T +Zx/F4isyRClevSEpCt4PJjnYA4BQReK8ISW96uNLNVN+JdkpzVSo07Jhy4d6DvP57UY g/8RyuoSgy27smDMXgVKVytkyI7rhFYbrk5uc= 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=XeBDJRibr1ouaq233G4wwpyDOJDmBO5yojbVUYPMv1E=; b=l1D+z38eeDlNE6FtOfNDtU+cHs0yMixvDZ9HNUkiSmY4at6kQ4Jv1nyHAtOGkO38cG sseHhkwBA+x5PEWWQOXJ1EnsyAcaDUxBSrVPCZcIJk0hrXMBDRqd8ghKNIZCaaX4+wOW zszuTlz95Sdf8HeR2vdmRIkvwWZMTxwRj74k40mskw24TiUM4AxvKmXVMDJF7mcyATCF kLcWFXIWZi75dtAValBarPv+YxkCdJxOx0zE57GTXCO0xhmX51lSNba1URtkv0S2+fLh maeFwfwLTz64wDfQL7THScKwcvWdIJ1p9nO5r+5/71xyf7fFTsyY7jCH1FlEwc7KL++V dxug== X-Gm-Message-State: AOAM532BZ80yUdTtTm/v/NS2YPqmYdjTI1d8m3zd8bHoB9J5xzj8vMlF AJCCBVnbwTADs2uWRLS5qYizVA== X-Received: by 2002:a17:90b:1213:: with SMTP id gl19mr151155pjb.232.1610495633212; Tue, 12 Jan 2021 15:53:53 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id n4sm229667pfu.150.2021.01.12.15.53.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 15:53:52 -0800 (PST) Date: Tue, 12 Jan 2021 15:53:51 -0800 From: Kees Cook To: Arnd Bergmann Cc: Nathan Chancellor , Nick Desaulniers , Stephen Rothwell , Andrew Morton , Arnd Bergmann , Marco Elver , George Popescu , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH] [v2] ubsan: disable unsigned-overflow check for i386 Message-ID: <202101121553.D0C3B87D5@keescook> References: <20210112202922.2454435-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210112202922.2454435-1-arnd@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 12, 2021 at 09:29:15PM +0100, 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, but is isolated to the 32-bit > x86 architecture. > > The one in blake2b immediately overflows the 8KB stack area architectures, > so better ensure this never happens by disabling the option for 32-bit > x86. > > Fixes: d0a3ac549f38 ("ubsan: enable for all*config builds") > Link: https://lore.kernel.org/lkml/20201230154749.746641-1-arnd@kernel.org/ > Signed-off-by: Arnd Bergmann Acked-by: Kees Cook -- Kees Cook