From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD816C2D0E4 for ; Tue, 24 Nov 2020 21:26:04 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7466020857 for ; Tue, 24 Nov 2020 21:26:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="oKmDT/E0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7466020857 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.37008.69137 (Exim 4.92) (envelope-from ) id 1khfoo-0008G0-Bm; Tue, 24 Nov 2020 21:25:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 37008.69137; Tue, 24 Nov 2020 21:25:46 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1khfoo-0008Ft-8m; Tue, 24 Nov 2020 21:25:46 +0000 Received: by outflank-mailman (input) for mailman id 37008; Tue, 24 Nov 2020 21:25:45 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1khfon-0008Fo-Ay for xen-devel@lists.xenproject.org; Tue, 24 Nov 2020 21:25:45 +0000 Received: from mail-pf1-x443.google.com (unknown [2607:f8b0:4864:20::443]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 858a5b60-34e4-436e-8314-247b42b0274e; Tue, 24 Nov 2020 21:25:44 +0000 (UTC) Received: by mail-pf1-x443.google.com with SMTP id 131so270115pfb.9 for ; Tue, 24 Nov 2020 13:25:44 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z68sm129381pgb.37.2020.11.24.13.25.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 13:25:41 -0800 (PST) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1khfon-0008Fo-Ay for xen-devel@lists.xenproject.org; Tue, 24 Nov 2020 21:25:45 +0000 X-Inumbo-ID: 858a5b60-34e4-436e-8314-247b42b0274e Received: from mail-pf1-x443.google.com (unknown [2607:f8b0:4864:20::443]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 858a5b60-34e4-436e-8314-247b42b0274e; Tue, 24 Nov 2020 21:25:44 +0000 (UTC) Received: by mail-pf1-x443.google.com with SMTP id 131so270115pfb.9 for ; Tue, 24 Nov 2020 13:25:44 -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=Hc7xHQdcWqcI1RL6yWHK3qM7+D3PcB+9wJ1f+Y4kOZ8=; b=oKmDT/E0BiqfYtxGd9S8VgvaixpTRLnYMRrsUV9kaRuJo3R/5oNlOHAboaJA72rvz5 cPy+dYNpKpp/tW1abpWiBH/rmtZxXE/MLGj7m5uMt/n+RU1YTE1Rw6QIxNLzAajuHLbW OV/WWZm28UqOigi5ggHh0BMVZishCwQGNb1Ns= 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=Hc7xHQdcWqcI1RL6yWHK3qM7+D3PcB+9wJ1f+Y4kOZ8=; b=iA0zVU08afAX62nOGW5pBcJIlS3YZsN6EsipEbNCtGK72pUE1ICSRp7sOBFX9SnU6B tZ0zR1g1RSEzvHIpNUNmzvle7dd1JyagruLCw1gxpGpOhV6EdmL+hosSp1SVyoq1oZKO zE1lXkvMzAHYHJdkoijfhk1Wj3amtX+XtfTQwqDgxOP7F/O0VCL0TWYczAE0fKClhpaE j0P7lJlC+FY493lc4SWTqdlxehjP7H8N3LVt1mIQpCwt3b9tnAxw4ZUf9zc8V1MfsD/M 7321eecip59njQFA61gwEHG0UN/xFJCYYpDVchef64eEa2HT5fP6mepwpK4sLzdkJekW XBXg== X-Gm-Message-State: AOAM530/VcmmNk/cJ8/6PE7zqyoudd6iLrhYHuCIh9eVQ+tPq9Actuj8 +/BzoGMzcpqq/L0rvuQVUrxCnA== X-Google-Smtp-Source: ABdhPJwtm7ki1o3tlMghBzBMLVUzEcZQN+PDIoPgB8WI7uCPSXlOMvf7LiH3SXaewZBRcFltugq6wg== X-Received: by 2002:a17:90b:3505:: with SMTP id ls5mr176054pjb.55.1606253143764; Tue, 24 Nov 2020 13:25:43 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z68sm129381pgb.37.2020.11.24.13.25.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 13:25:41 -0800 (PST) Date: Tue, 24 Nov 2020 13:25:40 -0800 From: Kees Cook To: Nick Desaulniers Cc: Jakub Kicinski , "Gustavo A. R. Silva" , LKML , alsa-devel@alsa-project.org, amd-gfx list , bridge@lists.linux-foundation.org, ceph-devel@vger.kernel.org, cluster-devel@redhat.com, coreteam@netfilter.org, devel@driverdev.osuosl.org, dm-devel@redhat.com, drbd-dev@lists.linbit.com, dri-devel , GR-everest-linux-l2@marvell.com, GR-Linux-NIC-Dev@marvell.com, intel-gfx@lists.freedesktop.org, intel-wired-lan@lists.osuosl.org, keyrings@vger.kernel.org, linux1394-devel@lists.sourceforge.net, linux-acpi@vger.kernel.org, linux-afs@lists.infradead.org, Linux ARM , linux-arm-msm , linux-atm-general@lists.sourceforge.net, linux-block@vger.kernel.org, linux-can@vger.kernel.org, linux-cifs@vger.kernel.org, "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , linux-decnet-user@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-geode@lists.infradead.org, linux-gpio@vger.kernel.org, linux-hams@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-i3c@lists.infradead.org, linux-ide@vger.kernel.org, linux-iio@vger.kernel.org, linux-input@vger.kernel.org, linux-integrity@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-media@vger.kernel.org, linux-mmc@vger.kernel.org, Linux Memory Management List , linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org, Linux-Renesas , linux-scsi@vger.kernel.org, linux-sctp@vger.kernel.org, linux-security-module@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-wireless , Network Development , netfilter-devel@vger.kernel.org, nouveau@lists.freedesktop.org, op-tee@lists.trustedfirmware.org, oss-drivers@netronome.com, patches@opensource.cirrus.com, rds-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, samba-technical@lists.samba.org, selinux@vger.kernel.org, target-devel@vger.kernel.org, tipc-discussion@lists.sourceforge.net, usb-storage@lists.one-eyed-alien.net, virtualization@lists.linux-foundation.org, wcn36xx@lists.infradead.org, "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , xen-devel@lists.xenproject.org, linux-hardening@vger.kernel.org, Nathan Chancellor , Miguel Ojeda , Joe Perches Subject: Re: [PATCH 000/141] Fix fall-through warnings for Clang Message-ID: <202011241324.B3439A2@keescook> References: <20201120105344.4345c14e@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <202011201129.B13FDB3C@keescook> <20201120115142.292999b2@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <202011220816.8B6591A@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Nov 23, 2020 at 05:32:51PM -0800, Nick Desaulniers wrote: > On Sun, Nov 22, 2020 at 8:17 AM Kees Cook wrote: > > > > On Fri, Nov 20, 2020 at 11:51:42AM -0800, Jakub Kicinski wrote: > > > If none of the 140 patches here fix a real bug, and there is no change > > > to machine code then it sounds to me like a W=2 kind of a warning. > > > > FWIW, this series has found at least one bug so far: > > https://lore.kernel.org/lkml/CAFCwf11izHF=g1mGry1fE5kvFFFrxzhPSM6qKAO8gxSp=Kr_CQ@mail.gmail.com/ > > So looks like the bulk of these are: > switch (x) { > case 0: > ++x; > default: > break; > } > > I have a patch that fixes those up for clang: > https://reviews.llvm.org/D91895 I still think this isn't right -- it's a case statement that runs off the end without an explicit flow control determination. I think Clang is right to warn for these, and GCC should also warn. -- Kees Cook