Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1159704pxu; Wed, 6 Jan 2021 14:09:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwU6YhCcfF41RKFb/rKH6uU8/C0dnFKY3vrhQVQ+a7J940+ltrbst8Wq9iEfOD1t54EyHtx X-Received: by 2002:a05:6402:2292:: with SMTP id cw18mr5442015edb.336.1609970969981; Wed, 06 Jan 2021 14:09:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609970969; cv=none; d=google.com; s=arc-20160816; b=uqQ+9eOB1W1Mg5bC7Sxf6+T30iu78pAx25vLodFN0DSRogTY7wvN9TSbrdTREDRLUC 6maAiuCtXXPoJYcNXjn5ZMlAV1wgrOJEZkrVD2n6WkqsRqrA53Bk0s//WRIGzcCPD58z q3JnMBhJY5Vyy1hqZ9Ial9EiRyz+TcGQRIP5oU/XV7uHaFwq9QmMz1H31s+DOMaHmcvF jB3KLnphKCPs2h3uhRXsFm5IPduS9BUFBTP6CaAQfVMObQfR7UmJZLsaFK3XadUCUg6O 0OACxVR+alvQ3D+R3qussBU0MOqiXCrVEkfZrAht6rnHN+S2tC736AxIWpXafCCDgfTO LxYQ== 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=FiARm78NP8eDMpMf+nbOEpVbv/lSgXGRF3g3hoPBOF4=; b=GTKZ9XJFJnTpByac3b3Q0YqgEybLlU1Pd++6ZnrQzDSHS32EV5jKKVw3jmcVPtmeaA 3PWMoudT7uQqkmTC9DtfVsnGu2xkCaNb+yyTG+1IsxE8XIBMvEVp6bcUlAAj93BP2RS6 gmIddTvJU3/2GvYaKwfbEVQimMMHm0WXc27wBNFldrJqe+nNqKESVxTzTu9pGCCW8oUV sOE/0/U6kFQffSBku1b77L9eP+GCFtyMhAuZ7lUrI1Do+8jNmCllKKEZZ17PVB79a428 wZagdHOyvGQTVp9cJT5aNRxYl36aPmRpkMPaUfqo2Dh+IHggAgMI7i9UeqXhxpQg8UKY gthg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s4kUfmRS; 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 m6si1264354edr.532.2021.01.06.14.09.02; Wed, 06 Jan 2021 14:09:29 -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=s4kUfmRS; 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 S1727558AbhAFWHi (ORCPT + 99 others); Wed, 6 Jan 2021 17:07:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:41732 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727150AbhAFWHh (ORCPT ); Wed, 6 Jan 2021 17:07:37 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BCEA123331 for ; Wed, 6 Jan 2021 22:06:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609970816; bh=Ixc+goeMvYqUDQiLxNgX+122s0AjmJqZ7wbVeiF+/pw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=s4kUfmRSy2kqOn63TsGBzxFkeYfc0040WS8cDg4sIKsvPCj4NwOvUWb5qshIv5Ovm uE134PQRFTidMRFTL56+keSsVo6nIp1gmaOjXb+n0WI52VPCUCIKcInoPcL+7xvsfG 0D7GgiI1Xcjm6tgynUzV0YE8d6VbEUmpt4FxbDws0dE5nhLZSuX6Qyi+Xiv4ZS4G1L yqJ+1W40BE2/c89kPF4CYKco9jotiOAkrnsDRtGJj79D8XeDQI7oDhuakjjnuoBWp9 Cw7DOEYygTMgMiCvUKyx7UBH9Uz73RjxhNHIyR0dKZq1JN/5gqqftkx5SP0QGfh9/t D78LmVFMGuDxQ== Received: by mail-ot1-f44.google.com with SMTP id w3so4449476otp.13 for ; Wed, 06 Jan 2021 14:06:56 -0800 (PST) X-Gm-Message-State: AOAM532VKMqTN5Oen7uk5D8THCNjAgj6yeAAEpw19wPFX99o0VKQ3sth UwLpLpuG37fLkefPzPb0GaL0nJDnFbX9tg7h0Mg= X-Received: by 2002:a05:6830:2413:: with SMTP id j19mr4857998ots.251.1609970816014; Wed, 06 Jan 2021 14:06:56 -0800 (PST) MIME-Version: 1.0 References: <20201230154749.746641-1-arnd@kernel.org> <20210104223336.GA2562866@ubuntu-m3-large-x86> <20210106213853.GA3617315@ubuntu-m3-large-x86> In-Reply-To: <20210106213853.GA3617315@ubuntu-m3-large-x86> From: Arnd Bergmann Date: Wed, 6 Jan 2021 23:06:39 +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 Wed, Jan 6, 2021 at 10:38 PM Nathan Chancellor wrote: > On Wed, Jan 06, 2021 at 10:12:51AM +0100, Arnd Bergmann wrote: > > On Tue, Jan 5, 2021 at 10:25 AM Arnd Bergmann wrote: > > > > > > 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. > > > > The qcom/gpi.c failure still happens with this patch applied: > > > > In file included from /git/arm-soc/drivers/dma/qcom/gpi.c:8: > > In function 'field_multiplier', > > inlined from 'gpi_update_reg' at > > /git/arm-soc/include/linux/bitfield.h:124:17: > > /git/arm-soc/include/linux/bitfield.h:119:3: error: call to > > '__bad_mask' declared with attribute error: bad bitfield mask > > 119 | __bad_mask(); > > | ^~~~~~~~~~~~ > > In function 'field_multiplier', > > inlined from 'gpi_update_reg' at > > /git/arm-soc/include/linux/bitfield.h:154:1: > > /git/arm-soc/include/linux/bitfield.h:119:3: error: call to > > '__bad_mask' declared with attribute error: bad bitfield mask > > 119 | __bad_mask(); > > | ^~~~~~~~~~~~ > > > > See https://pastebin.com/8UH6x4A2 for the .config > > > > Arnd > > That config does not build for me, am I holding it wrong? > > $ curl -LSso .config https://pastebin.com/raw/8UH6x4A2 Sorry about that, you ran into a bug that I have applied a local fix for. You could enable CONFIG_EPOLL, or apply this patch: https://lore.kernel.org/linux-arm-kernel/20200429132349.1294904-1-arnd@arndb.de/ Arnd