Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1269pxm; Tue, 1 Mar 2022 13:33:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIIlu2lDnIt71Cq50MWqMU/y5nJ0DUCeLv8qtvzpl4CFhWy1RGtrT4wsR3pHW1bpB36AhU X-Received: by 2002:a65:4789:0:b0:374:8b11:fb47 with SMTP id e9-20020a654789000000b003748b11fb47mr22973637pgs.325.1646170405431; Tue, 01 Mar 2022 13:33:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646170405; cv=none; d=google.com; s=arc-20160816; b=e4XiZ3nl8YfpnyHytpNn/XgDj0Ehkm2TfKEm+AFB0H7EbkGMIBO9QzZij+2+c6bdhI zM2bezLMdtjgeRppXLI2epr6u96ci5KsNMEbLoyORpQsfJ9bCBmBw2yJLOMmQ8kgrXEa NqVbAjnRipapGoHknbL9JjjXSS3xcM3HUF4iJ1voW8UzNdmCIak5Y/v9gYnpM2QI+idx wsMvFX2FL4zvf/eYc3R0VEZVLedWLd16DUSSdb5VofpWoauotubAkmfSWTpueISScnkT HbH8Mou1DSbWfOnnDmUIerUnTEJ7XBqRDmhUqrK97Qz3nmJeNgHG38m+7ZYC1/Bml7Bd 5+uQ== 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=N36sF4HUer+rUuc5VxWx2NxZT2Mje9G1bKhkVtQFmow=; b=XR6f38wg4s3iPxIokr02+/ffcbfmlPuIrV3V0f3Q4PtwRkdBXJNg7L6fhWCO3hwV+z XHo6FHrNRCAMcWlAto4EwjqKrSsl92MwU735sd0A25zQk9S0mgSU5qfFpzRNN0YIi6FV zOxOsqMd6zbwf10MKx6bglWHtdilpSI0z+sJvkpkbo7egTtr2bsGTT3fQ6a9atac+Wy4 DDQW9oLtsc6Zz0MElHnCORcekSQdXVArKtOdmU9UL598nKi7Dt023iceDIIW5p2FIjX4 F8rC8Bd5HiAz7M8/b+guG7ebHxP1wmZdnNED/qyIFjLn1vqJ7Cli7aJ/VYIpCtniOQjC Tw8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=O9Pc4FRh; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w15-20020a63d74f000000b00372f3e76f87si13297233pgi.547.2022.03.01.13.33.10; Tue, 01 Mar 2022 13:33:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=O9Pc4FRh; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 S236870AbiCASOy (ORCPT + 72 others); Tue, 1 Mar 2022 13:14:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236881AbiCASOw (ORCPT ); Tue, 1 Mar 2022 13:14:52 -0500 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E036A65158 for ; Tue, 1 Mar 2022 10:14:09 -0800 (PST) Received: by mail-pf1-x431.google.com with SMTP id d17so15055126pfl.0 for ; Tue, 01 Mar 2022 10:14:09 -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=N36sF4HUer+rUuc5VxWx2NxZT2Mje9G1bKhkVtQFmow=; b=O9Pc4FRhQaHO8JwtvKmEa7P/p93QhIWPziYnJxBP3SmXkKfXwbS/+UXcAcizlZe2qE 5++D1AzgFSiNA6GVcHz58RghXwcZj0T+stAg2S8I6BdGwjnEpqEP1SHJlTJIwhdk7I/A Km+JuAoSqO/aabb7J1BxN3aslickTdbOZI2Hw= 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=N36sF4HUer+rUuc5VxWx2NxZT2Mje9G1bKhkVtQFmow=; b=3yfTNTcgj7sf9Y5NPdpa6AqlxPgg2JFvxMDh2gZTi9BN3efgqcWDqqDwzPH/EuUwtZ e/+CDT3FPS9YDhM/96Dm62H0lW+0CLZqPwfKVsisxfH61QvdEXW9O1rh+/27d+iyPUbQ x3soZ8Uz819MolD+nVkn7+Wr3nU+X/ca6sMZrCjzNAxIUeB/9uGvRrZ1OOKiXx6sgy64 usbHpyKYkdbSFNdZw/nqkxbb7CZbZqgTxkH7glzggzOXQNu1SR7oUEf4Kn1zLbuRBOzj 3OkPVqT40Odvh6fjeCu0dnX75MTVhsrgWhyIRs9pkeFpF7/dTGV37ord8Cl5SX0mmyNp A4ww== X-Gm-Message-State: AOAM532Lv6ihbPge3V4HRNwgwO+AxNt31YrOewmZBN6gmbmmjjd1Lg/0 bJzClneqAM03w30ZmCXdA2ELnQ== X-Received: by 2002:a62:d156:0:b0:4cd:fd21:e406 with SMTP id t22-20020a62d156000000b004cdfd21e406mr28741951pfl.44.1646158448831; Tue, 01 Mar 2022 10:14:08 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id nn10-20020a17090b38ca00b001bc3a60b324sm2540095pjb.46.2022.03.01.10.14.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 10:14:08 -0800 (PST) Date: Tue, 1 Mar 2022 10:14:07 -0800 From: Kees Cook To: Linus Torvalds Cc: Matthew Wilcox , Christian =?iso-8859-1?Q?K=F6nig?= , Jakob Koschel , alsa-devel@alsa-project.org, linux-aspeed@lists.ozlabs.org, "Gustavo A. R. Silva" , linux-iio@vger.kernel.org, nouveau@lists.freedesktop.org, Rasmus Villemoes , dri-devel , Cristiano Giuffrida , amd-gfx list , samba-technical@lists.samba.org, linux1394-devel@lists.sourceforge.net, drbd-dev@lists.linbit.com, linux-arch , CIFS , KVM list , linux-scsi , linux-rdma , linux-staging@lists.linux.dev, "Bos, H.J." , Jason Gunthorpe , intel-wired-lan@lists.osuosl.org, kgdb-bugreport@lists.sourceforge.net, bcm-kernel-feedback-list@broadcom.com, Dan Carpenter , Linux Media Mailing List , Arnd Bergman , Linux PM , intel-gfx , Brian Johannesmeyer , Nathan Chancellor , linux-fsdevel , Christophe JAILLET , v9fs-developer@lists.sourceforge.net, linux-tegra , Thomas Gleixner , Andy Shevchenko , Linux ARM , linux-sgx@vger.kernel.org, linux-block , Netdev , linux-usb@vger.kernel.org, linux-wireless , Linux Kernel Mailing List , Linux F2FS Dev Mailing List , tipc-discussion@lists.sourceforge.net, Linux Crypto Mailing List , dma , linux-mediatek@lists.infradead.org, Andrew Morton , linuxppc-dev , Mike Rapoport Subject: Re: [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr Message-ID: <202203011008.AA0B5A2D@keescook> References: <20220228110822.491923-1-jakobkoschel@gmail.com> <20220228110822.491923-3-jakobkoschel@gmail.com> <2e4e95d6-f6c9-a188-e1cd-b1eae465562a@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mon, Feb 28, 2022 at 04:45:11PM -0800, Linus Torvalds wrote: > Really. The "-Wshadow doesn't work on the kernel" is not some new > issue, because you have to do completely insane things to the source > code to enable it. The first big glitch with -Wshadow was with shadowed global variables. GCC 4.8 fixed that, but it still yells about shadowed functions. What _almost_ works is -Wshadow=local. At first glace, all the warnings look solvable, but then one will eventually discover __wait_event() and associated macros that mix when and how deeply it intentionally shadows variables. :) Another way to try to catch misused shadow variables is -Wunused-but-set-varible, but it, too, has tons of false positives. I tried to capture some of the rationale and research here: https://github.com/KSPP/linux/issues/152 -- Kees Cook