Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1979583pxb; Mon, 13 Sep 2021 09:22:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlk6sW1Ma4qqgkh3QmSul0zatoDdcQpMAWx6Wi7ZlB+lfr71zpC/EgLS9NFUyRg0B88JnZ X-Received: by 2002:a17:906:1e97:: with SMTP id e23mr13342621ejj.336.1631550140723; Mon, 13 Sep 2021 09:22:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631550140; cv=none; d=google.com; s=arc-20160816; b=S4Ac3L4efd+VYOMWQyJq0+ZCacWmCqnvtoaKrZh3syjbAcQCBM0n4q+gWXjbFgU5zR 84NqXJ7Fv/R/a7ASi5Ov7bdji8B5tt4LAWjzu9If57EN4KVF6mxjf1RZEJH2bfVXy4O7 hW2RDJt88vYEtSwLDoI++z2Pc5YpasdajoiP/4tTQylW6/7SNbvagS23ARX8+/CMaWms klr5nRuivYj2NWyvCSDW4093OZ/W6CzpxqmStNGLf6BLK8n6hPz1YOWXhClW44txNep1 wk52UZZlA2v1D3Wc7JiTJZYmC9SEB4tcWXJDnE3yhTuzUkpeZ8Z9Q/mE7WcqUdAyh19j ad9w== 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=msy8N0GkHxRCMazso14Qqx2R9J2qwwNe7Lt82w0ANmc=; b=zAeJuLKhlrMOymELzZ+NGt40auxC2ro0111d5DfrQQLHfTcuPuYzCzrSmaPWBidR8J NLx8/8m0JohmLxF9WjZ1qzhvUm65pbdK39tIwJ7T6RMrZxZ1jv1SQktgCSDBceGwjKkW GdwcGZ5njWqVAmMvUCAaUF/6ahWUpM5viqYJOb8gaxzJmcVlyVQ5/3+HKSrafv8wr/ye C1/orLCx5UKDtROFhhCnt6uYXaJ9GiFD8tuRq5x7SQO/M/L7UW7OjfpzzB9PJAYTI/eH 0so4CtKu1ShmhHeqDg1NJmbtZ4g3LHJ0NhePiP80mCrBTeIw7bEquQWOz24MVC+BEEBB AWVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lley3eyu; 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 g3si8213726edk.324.2021.09.13.09.21.55; Mon, 13 Sep 2021 09:22:20 -0700 (PDT) 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=lley3eyu; 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 S230519AbhIMQVu (ORCPT + 99 others); Mon, 13 Sep 2021 12:21:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229614AbhIMQVp (ORCPT ); Mon, 13 Sep 2021 12:21:45 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3125C061574 for ; Mon, 13 Sep 2021 09:20:28 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id k23-20020a17090a591700b001976d2db364so414877pji.2 for ; Mon, 13 Sep 2021 09:20:28 -0700 (PDT) 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=msy8N0GkHxRCMazso14Qqx2R9J2qwwNe7Lt82w0ANmc=; b=lley3eyu4spj7H4dEjr8NFNnBCNc+3EQCeu7XpvXwZNYBUuMF9r6zukjuh0erOk5+p 31b4wC9bktr36kzNJ703H3MHTxvicyKhx1vHJGpb+YPjpCNUYvy8v72wP/EWSbH5M7P3 s1yFU2eyFFbdLldtfoq44XSHCY4Mcc62Y2Jds= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=msy8N0GkHxRCMazso14Qqx2R9J2qwwNe7Lt82w0ANmc=; b=PacGWzG5AyqYSfYC9uASM5P9sZuUzJ7xkY6NjCs/vfei5SmHtJoZ3ZOA/cUXYZ37ny PcfQ7JE6UhY7y9wFR9+we/r0SjcQ50F/XAl0HSvF3EuGh6EqfLvEhWMbwjUq9NSINDBs hENwiDy82OT2GSdJPJVVdirbsV4HQ35X4vusscuBQoT/1SiJW6LdcyR4H7UqS67amO/U LacHd3CUqgu034wF53T4j+/n4aOSgDJGcR9fPH5UM5hr4GgXOKQ3SpKrdxICF7eZ4uKT 7+AGC8jwwQfmo+rajXhlrryVuwaZEegO8qXSwQw+xxLWvXChvfUoMp2iwQXYecZ8EriS Lm1g== X-Gm-Message-State: AOAM533yfgpvkW5JN9vGYjFUtZ9cEXs/KfcF+nMZdZOChvTbNQBgJrVa 7n26CxvLwoudzT2Xw15izZg/BQ== X-Received: by 2002:a17:902:ab16:b0:13a:356c:6a03 with SMTP id ik22-20020a170902ab1600b0013a356c6a03mr11041877plb.38.1631550028483; Mon, 13 Sep 2021 09:20:28 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id t14sm8492195pga.62.2021.09.13.09.20.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 09:20:27 -0700 (PDT) Date: Mon, 13 Sep 2021 09:20:26 -0700 From: Kees Cook To: Pavel Machek Cc: Nick Desaulniers , Andrew Morton , Linus Torvalds , Rasmus Villemoes , Nathan Chancellor , Masahiro Yamada , Joe Perches , Arnd Bergmann , Stephen Rothwell , llvm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/10] raise minimum GCC version to 5.1 Message-ID: <202109130918.D359A43@keescook> References: <20210910234047.1019925-1-ndesaulniers@google.com> <20210913094947.GB12225@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210913094947.GB12225@amd> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 13, 2021 at 11:49:48AM +0200, Pavel Machek wrote: > Hi! > > > commit fad7cd3310db ("nbd: add the check to prevent overflow in > > __nbd_ioctl()") > > > > raised an issue from the fallback helpers added in > > > > commit f0907827a8a9 ("compiler.h: enable builtin overflow checkers and add fallback code") > > > > Specifically, the helpers for checking whether the results of a > > multiplication overflowed (__unsigned_mul_overflow, > > __signed_add_overflow) use the division operator when > > !COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW. This is problematic for 64b > > operands on 32b hosts. > > Please don't. gcc 4.9.2 is still in use here. > > Plus, someone will want to prevent overflow in -stable, too, and you > can't really raise gcc version there. These changes won't go to prior stable kernels. -- Kees Cook