Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1090184imm; Wed, 26 Sep 2018 11:27:18 -0700 (PDT) X-Google-Smtp-Source: ACcGV63+b5eGNLjJivf+71YVnzn9GTDLdso87BlJia63NNgVByl0txdu0DWLJjPHZpD0a10DbObk X-Received: by 2002:a63:d806:: with SMTP id b6-v6mr6682177pgh.347.1537986438238; Wed, 26 Sep 2018 11:27:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537986438; cv=none; d=google.com; s=arc-20160816; b=swBdpyuPHzKlyvy4XEGPLcn+yAwiFgz8XpdtC01VJMpewTzL2FHYyDKKM308XP7eGr i+8e64PSWE45fNUz4uit0hFGSM5+0JpXf+qS2TSkZ+B/M+JcM7z36sSxh8hjCKI3oCsY 0dtjkzM9/uSwQFSQN6NBlo+kR7MPNPt8IWxw3PB5SswupK/0dz+XyumWneHkjqx7IjHi zMP++GAjiwj7SfVz9EihdZQid54BVguCK88YN/w07OlJx7iD3f6Xr/O6qB0zMQ/CbECC gYX9uiZhFbE35LUTi/kLyv2/xdhMxZBv1vlLxYiKQ1KYUkCoxvyx+5CD3bwzBh9gP2qA O62Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=Pn8eFJkeUpbV0DIAXKeU8bGiN1TDQW2pfyny7zKQXMw=; b=JfcfFGSmy3AhudqHFn5vEQtRERmw1RCRX/l/M0ICMMmswqrHgWzFgxw09atU0al79s uFF7pmstuUWL53gsaRABjekOz4WPoMqBXH7AqiT1nfA9lOc6DN2+jBtaxu17KHLyDKGd F5WE7u2f0mNClWeq2jr1M2/rgvhv2jtc0mnp8f7kuzgEW4roGUQAWENI0+LJf+eqVFw/ g0lxhA1/mfbbhEmNroto+4+XhZ9I+oa6tK61osPECo3mLfFuIJpO3yYDRdXbDUJ+Upes WrgKmQb3tk6G+cQlj+eQFvbziIpXSuXwDRb8Ux93XjQJIdJbsz3jF39Sn6nBIbY9HtEi eK2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nJIPAfOG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id 88-v6si6329592plc.515.2018.09.26.11.27.03; Wed, 26 Sep 2018 11:27:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nJIPAfOG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727786AbeI0AlG (ORCPT + 99 others); Wed, 26 Sep 2018 20:41:06 -0400 Received: from mail-yb1-f193.google.com ([209.85.219.193]:35081 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726107AbeI0AlG (ORCPT ); Wed, 26 Sep 2018 20:41:06 -0400 Received: by mail-yb1-f193.google.com with SMTP id o63-v6so11752755yba.2 for ; Wed, 26 Sep 2018 11:26:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Pn8eFJkeUpbV0DIAXKeU8bGiN1TDQW2pfyny7zKQXMw=; b=nJIPAfOGEmKpy0cKWBQgT1m/li4+lKaiARn9/46ky0dnZbLN6mr3VSoBp++HkVicyf o+R5c9rGZOOpnAyrYLeJQxdF5ACn3O+AGkRE1w7s7yE7so7SwhI3tAqi9HND8svnshuW Qdw2sIQnZXRGglRXjq1aWvXMEb43KrY4TXXFI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Pn8eFJkeUpbV0DIAXKeU8bGiN1TDQW2pfyny7zKQXMw=; b=kuQJ7GIWWUO2QvXSDGwJj72LCbsjY2ImftUQJBj1T74mfqEBlSQR1gC5O7rADOo/wW DU17mTOeq3NBriqbBY9nB7iY20kY/nOOj7fTyvzsygVtI4hhiK5VyWKlDUF7X6ychJIH ydNb0XJzg2dDrf5a9XH2HHS+K/dmZOru/nSk0rYQRDvp3/b7mTm8zZQaxT0tR7fL0n8T QGxTgOm7sFV0KG3qE5v6kp2UV015nb0yfdMquECtikwsMwnSPDzV8fiXHAldSdpfU1JY CTOI7HU48Wp5dQhwlXWA4w6hNGURib8RsGXCdp9nTRDqjeCxToFWGtRk/U9LOwILHgzc yyDQ== X-Gm-Message-State: ABuFfohV5hRPyAi6nLdzOWRoBHHga0ZFReIXVTo/bzfVk2gs66jo58+Q t6PzmW/xSmlqP6JBsbHnBxHKhECpYM8= X-Received: by 2002:a25:a189:: with SMTP id a9-v6mr3886838ybi.345.1537986411961; Wed, 26 Sep 2018 11:26:51 -0700 (PDT) Received: from mail-yw1-f46.google.com (mail-yw1-f46.google.com. [209.85.161.46]) by smtp.gmail.com with ESMTPSA id j8-v6sm3287964ywj.6.2018.09.26.11.26.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Sep 2018 11:26:50 -0700 (PDT) Received: by mail-yw1-f46.google.com with SMTP id q129-v6so11206704ywg.8 for ; Wed, 26 Sep 2018 11:26:49 -0700 (PDT) X-Received: by 2002:a81:9b83:: with SMTP id s125-v6mr1131482ywg.47.1537986409442; Wed, 26 Sep 2018 11:26:49 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:cf05:0:0:0:0:0 with HTTP; Wed, 26 Sep 2018 11:26:46 -0700 (PDT) In-Reply-To: References: <1535220989-27645-1-git-send-email-yamada.masahiro@socionext.com> <84cf6ae0-97c8-6b73-ca86-b3d3b3daba5b@pobox.com> <8d5cf8c6-556a-96a1-610d-c92355783a9f@pobox.com> <20180926180019.GD22824@google.com> From: Kees Cook Date: Wed, 26 Sep 2018 11:26:46 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] compiler.h: give up __compiletime_assert_fallback() To: Greg KH Cc: Nick Desaulniers , Matthias Kaehlcke , Linus Torvalds , Masahiro Yamada , Christopher Li , Sparse Mailing-list , LKML , Daniel Santos , Chris Wilson , Jani Nikula Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 26, 2018 at 11:03 AM, Nick Desaulniers wrote: > On Wed, Sep 26, 2018 at 11:00 AM Matthias Kaehlcke wrote: >> >> On Fri, Aug 31, 2018 at 09:46:02AM -0700, Nick Desaulniers wrote: >> > On Tue, Aug 28, 2018 at 4:00 PM Nick Desaulniers >> > wrote: >> > > >> > > On Mon, Aug 27, 2018 at 1:42 PM Daniel Santos wrote: >> > > > >> > > > Hello Nick, >> > > > >> > > > On 08/27/2018 03:09 PM, Nick Desaulniers wrote: >> > > > >>> Let's give up __compiletime_assert_fallback(). This commit does not >> > > > >>> change the current behavior since it just rips off the useless code. >> > > > >> Clang is not the only target audience of >> > > > >> __compiletime_assert_fallback(). Instead of ripping out something that >> > > > >> may benefit builds with gcc 4.2 and earlier, why not override its >> > > > > Note that with commit cafa0010cd51 ("Raise the minimum required gcc >> > > > > version to 4.6") that gcc < 4.6 is irrelevant. >> > > > >> > > > Ah, I guess I'm not keeping up, that's wonderful news! Considering that >> > > > I guess I would be OK with its removal, but I still think it would be >> > > > better if a similar mechanism to break the Clang build could be found. >> > > >> > > I'm consulting with our best language lawyers to see what combinations >> > > of _Static_assert and __builtin_constant_p would do the trick. >> > >> > Linus, >> > Can this patch be merged in the meantime? >> >> friendly ping :) >> >> With c5c2b11894f4 ("drm/i915: Warn against variable length arrays") >> clang raises plenty of vla warnings about >> __compiletime_error_fallback() in the i915 driver. Would be great to >> get rid of those without having to revert that commit. > > I've been meaning to follow up on this, thanks Matthias. I too would > really like this patch. Adding Greg to the thread. Between Masahiro's detailed commit log and the Clang-familiar reviewers, I think this should land for 4.19 (as part of the other Clang-sanity patches that are already in 4.19). This has no impact on gcc now that we're requiring 4.6+. https://lore.kernel.org/patchwork/patch/977668/ -Kees -- Kees Cook Pixel Security