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 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0FD5FC433F5 for ; Thu, 3 Mar 2022 07:06:32 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4C9C81A24; Thu, 3 Mar 2022 08:05:40 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4C9C81A24 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1646291190; bh=+zgxtLk+dfPgBQrgB52waUtMNEkXQ03m+IyU5C9fZ4c=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=l/QPAuXTq8+9tQKPwx3uFyZnQP6TkVRtnSLHsPuf+5vaWwHluJqadvRYvAFarfJvE 2AnpYfegvbt11uzSfZqetMEwQLYSvZWJqkorKhRZL7k13UP5pSXGN/OfLpeHqf6aya 2v1zBM2JtgPD3HOqP0OiK4t6bBQHrdetYV2H6pfE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3ED2BF8052E; Thu, 3 Mar 2022 08:03:32 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D13EBF801D5; Wed, 2 Mar 2022 21:25:35 +0100 (CET) Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9CFBFF80054 for ; Wed, 2 Mar 2022 21:25:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9CFBFF80054 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="Be+smD91" Received: by mail-ej1-x631.google.com with SMTP id pj17so1816358ejb.2 for ; Wed, 02 Mar 2022 12:25:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Uy+qIY61mUv01aVZ77KYqcI4VQ6CnEr5ehBFaIlKwdg=; b=Be+smD91jIehBxsphVP8GxPmG9fZ7UzsziFVI8sCcayH4ghcjVwFadN69qX3SSZZfA w/nKcppYscRVDTynDM99u+3Int1mDvzuW1vHPoDdJ+8JxYLDdH7+xaY9DZL7COnmW4q3 yEVm7FisHcBkdW7xwzBny/SyDipBoZU1ONqUc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Uy+qIY61mUv01aVZ77KYqcI4VQ6CnEr5ehBFaIlKwdg=; b=3oSrU62qTDpHxRbIF47aDhLyNrV5kVS/cY3rDjcHyifoy9lLW2oylVtveFBCoHn/Wv nGczX2i9F/y5OScV7wFe6czyHHhpKwcGdSF8zMQn4nmrQWpU2Qu4DAzROVQvZO+KMJ1p OX//PzA6RaVcCvwEb75IfoyHPcoaaDqGVopdO9knLjMdNpxgiTg6zBKh+ffrXcoCXBHK NVY7HEmauOOUxVPpIzXck7KcrwgOlDs4ik+dBg/n0e36of/KrSSlHXPZRyowXWxu6Vf3 s6CxyuQW48jfrQFS4xgWx/1Vyfnpgrv+vqCzC5RWQy5B9A1Fv7yc8AnebLGer8vPbK2v yaVA== X-Gm-Message-State: AOAM532t6dYwTudBoBdVvCrNwp8wP4vj9fz+YQDynMMGp3e0JYpFWOVm 0OlgrDYF8TpbOpelPMt/wuApXfuvjjxNw1D437I= X-Google-Smtp-Source: ABdhPJxgSKrNBx0LlcHTPu/LA87LvSEKVVBf1ZAjg5Z/0/lIqMrbVvM8S7ZDVUDOUITuy4CDqyT/gQ== X-Received: by 2002:a17:906:c282:b0:6ce:369d:3d5 with SMTP id r2-20020a170906c28200b006ce369d03d5mr24291017ejz.425.1646252731386; Wed, 02 Mar 2022 12:25:31 -0800 (PST) Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com. [209.85.218.45]) by smtp.gmail.com with ESMTPSA id z22-20020a05640240d600b00415d8c59bf5sm10954edb.25.2022.03.02.12.25.31 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Mar 2022 12:25:31 -0800 (PST) Received: by mail-ej1-f45.google.com with SMTP id r13so6221751ejd.5 for ; Wed, 02 Mar 2022 12:25:31 -0800 (PST) X-Received: by 2002:a2e:3013:0:b0:246:2ca9:365e with SMTP id w19-20020a2e3013000000b002462ca9365emr21092331ljw.291.1646252342192; Wed, 02 Mar 2022 12:19:02 -0800 (PST) MIME-Version: 1.0 References: <282f0f8d-f491-26fc-6ae0-604b367a5a1a@amd.com> <7D0C2A5D-500E-4F38-AD0C-A76E132A390E@kernel.org> <73fa82a20910c06784be2352a655acc59e9942ea.camel@HansenPartnership.com> <7dc860874d434d2288f36730d8ea3312@AcuMS.aculab.com> <0ced2b155b984882b39e895f0211037c@AcuMS.aculab.com> <78ccb184-405e-da93-1e02-078f90d2b9bc@rasmusvillemoes.dk> <202203021158.DB5204A0@keescook> In-Reply-To: <202203021158.DB5204A0@keescook> From: Linus Torvalds Date: Wed, 2 Mar 2022 12:18:45 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr To: Kees Cook Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Thu, 03 Mar 2022 08:03:25 +0100 Cc: "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 , James Bottomley , Cristiano Giuffrida , "Bos, H.J." , "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" , amd-gfx list , 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 , Jakob Koschel , "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 , David Laight , "tipc-discussion@lists.sourceforge.net" , Linux Crypto Mailing List , dma , "linux-mediatek@lists.infradead.org" , Andrew Morton , linuxppc-dev , =?UTF-8?Q?Christian_K=C3=B6nig?= , Mike Rapoport X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Wed, Mar 2, 2022 at 12:07 PM Kees Cook wrote: > > I've long wanted to change kfree() to explicitly set pointers to NULL on > free. https://github.com/KSPP/linux/issues/87 We've had this discussion with the gcc people in the past, and gcc actually has some support for it, but it's sadly tied to the actual function name (ie gcc has some special-casing for "free()") See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94527 for some of that discussion. Oh, and I see some patch actually got merged since I looked there last so that you can mark "deallocator" functions, but I think it's only for the context matching, not for actually killing accesses to the pointer afterwards. Linus