Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp683566pxu; Wed, 6 Jan 2021 01:15:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKPwDf31KcNJqQaeDg1mTkBNTVuv8LPVCzcITY5ik7Mo6PYzukS0aiwCza8Tz+/d2gGNPb X-Received: by 2002:a17:906:d8a3:: with SMTP id qc3mr2226126ejb.443.1609924528115; Wed, 06 Jan 2021 01:15:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609924528; cv=none; d=google.com; s=arc-20160816; b=n7YZcOxUtzKJw9Oil5tfMe17lTyEgHiC/MQlNKEBqvrwaqku4chH2Y92KVg3/86auq XRijB3/VjMk7aVapasgvtwBIW9WP/5l0ufgS2XCM05Hwtmr65Rqcc4BJRWqVfteqTSa+ QuvfoP5DQIrXKX9dz3owWnhQzYOmg9cLcTPmzx4rl5deFDrXX44GY5UaQWZ6D2cfI5FR o03pOATklyiEyiychBC+VZv7bj6W1aRQ4d/r1U/S9v6O4K2SNMa9coXtvjP/8J+PCmyW E9/AgEUh2Et2uYCxpQBpahy0Pli3hv8IBrkGFhn0nXH3KxgW9nQxu6tKPGy9mp/mFBK0 dWsw== 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=ICMP2u3WRFc/tixGCdtSPzQuRGVhVQSpv0A6xqD2xqY=; b=aJZ32OJ7Af2+JqZtw98ErXXOJ4VQ2AId+oprbKPYHNj1SMC+hZjKFStEsv2Lxk9uZz 9ugBXRBm/F10hpcNmDsnCG7tgSEHjh1ZCNnLGntbNjqUtcmgtRXqwSet9fQu0M6beY56 zHbQJjelRgHvuJpZNMJkFo6e8huXkPJ6h35Cx2uySL40/jDIrsNBgonye7WkPe9MdRtr 2VgJo8MgxngRh9rfJG39GuztIZd+9a+ZxewBRuJBopHFKsUchT0SZvLXYUP4YE2FmBHb E4K0iiddRm0he5Mkcly0Y2fDLM+c+PVhsayqKXs/Lm81yKgse3MGqsRIJKLwKgIBNXk5 1Adg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qAVGSrCc; 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 d18si696736ejd.342.2021.01.06.01.15.04; Wed, 06 Jan 2021 01:15:28 -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=qAVGSrCc; 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 S1726481AbhAFJNu (ORCPT + 99 others); Wed, 6 Jan 2021 04:13:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:49234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726452AbhAFJNt (ORCPT ); Wed, 6 Jan 2021 04:13:49 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A16952310E for ; Wed, 6 Jan 2021 09:13:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609924388; bh=89h6d3JjXgl+2ZZ2ym/iV3agjZBNxZHYntIUZYADwas=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=qAVGSrCcZj+K7cq/UdOHdhkBY3bf5f6ubRULXHtafdGpwROSDQ0NbB6QU8/i9YANm Even0WrA3wsxhlE7eWo/eAnMVKdeCX00OqkhW/prqKx2usFwgVfy5jYEBe2KLKvlZJ wjKDjglnunDvX7gsqydfQgYqpYQlQ3A00d2P5fThSoVZNAM6+YQz7+FNb+9XjRZ46z iwKZ2zq3pEwFfFGraQav91zXKzNxD2izBmToZdxfki3B476OCVVMZJXWwoO5EoB0Pe 2yfQHG+nI+pDMNXHbbqCWfIw8LRloEyAspl6GwtvpELsU0ohMu7MwYJMYdCThjUQPD apKDuGSseQBGw== Received: by mail-oi1-f179.google.com with SMTP id l200so2744960oig.9 for ; Wed, 06 Jan 2021 01:13:08 -0800 (PST) X-Gm-Message-State: AOAM533eOmKCCLkqOUXWK7K5hqXfXdHQ83pVf1JRt53JOACcF9AysooV i4IBBc2wgOFxMHOvBFcQnmEaR98kq55wTd9NiJk= X-Received: by 2002:aca:44d:: with SMTP id 74mr2623761oie.4.1609924387851; Wed, 06 Jan 2021 01:13:07 -0800 (PST) MIME-Version: 1.0 References: <20201230154749.746641-1-arnd@kernel.org> <20210104223336.GA2562866@ubuntu-m3-large-x86> In-Reply-To: From: Arnd Bergmann Date: Wed, 6 Jan 2021 10:12:51 +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 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