Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp669908rdb; Tue, 31 Oct 2023 21:03:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFh0xpU4N1tqCqtnop8YxzqyVWrZAbNq7C896/UChO+glyEm0VqNuRuRat8bvL1ZFPzmYy3 X-Received: by 2002:a17:902:c449:b0:1c9:9fa6:ce5b with SMTP id m9-20020a170902c44900b001c99fa6ce5bmr4988849plm.16.1698811408569; Tue, 31 Oct 2023 21:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698811408; cv=none; d=google.com; s=arc-20160816; b=i3xNedg5zXFjWCndvhctksVnVi60+oM5sjpt7W80tZYLreGAB7orqCntqaJrm8PdyP wNAc79exwJfkHwooH349ktDIOHPF/mpp2aoC/WVCqD86vWy6s33/LLIyxoXdxn2SIck0 ZpU8MJ2GcSlbw2L6EwKvWJbhVsDZXaF6WNjEhwB7H6jMVYP+K6YHOdOjaRSiMm0yhBjt 4Nk3lyLsOwxnkRGVkWDLGVSTQoLi53XLxoXMwTFpU4itqdAR/LI6VvCqq8F2iMQmGODD L1xS9jFV5XxU7B2KfMky8NHzVYSIs0iDVG91BIxzVospvOMIp33vJMI538aSegXO0CY2 G64w== 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:sender:dkim-signature; bh=NnMb6+VyJPA3A0rpO2QIfgR9bU2yeP3mMFNmvX5wlvI=; fh=fs1M82f8t6A16MieHkHE1cb+WE8pjJcF+2c0pVF1sjc=; b=yfg9nW6bbxZqfI8ZBprXbspBIHAc3MfGbGCDDx3dWVhesyn4JY9qsHAY4LIAF06llC oDqfcJWHOiNHHcSAnH7XSuf7CwMGxx4iHPId2qjcItN6SG06iLrc7k9ysY43W4n5s8Ty gKJuAd5XMMT3/zKj59aOzbADiITqqCy5GMKlNwgf2CgTbbxHVnnAwAij59OYqsD6ZPKO eizz4+3yg6BnHixRmvOx97rLAXpXe85l/zM9WQxbXgXDzoPylwoyRmcoud7S42WrZSL+ sPp3NS/9MskJT2JC8pMEO1oGbP5BeCZX5/cyJVHleW8SOAbAQxmH076MCXVK9PRV2EZm W1DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dZUgDamZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q4-20020a170902dac400b001cc33027349si2242008plx.360.2023.10.31.21.03.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 21:03:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dZUgDamZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5C6A18069F14; Tue, 31 Oct 2023 21:03:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232238AbjKAED0 (ORCPT + 99 others); Wed, 1 Nov 2023 00:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232091AbjKAEDZ (ORCPT ); Wed, 1 Nov 2023 00:03:25 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D7CEC1 for ; Tue, 31 Oct 2023 21:03:23 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-6bf03b98b9bso361558b3a.1 for ; Tue, 31 Oct 2023 21:03:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698811403; x=1699416203; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=NnMb6+VyJPA3A0rpO2QIfgR9bU2yeP3mMFNmvX5wlvI=; b=dZUgDamZAjKuKNwgh9rC7/V7VoxudveKDj3nCG2H7pS6MSHtKEnBMGxe/HGi/iwK28 qLI/jVCDg7Y6IqI6ScLnOlUbcrXR2h4IFCLzqMPLouu1MiSPF27PiWPetHSRWfSIvuf/ lS89Bm/ibwYqPKXBMfSDzbVIbw2gzDnxOuTYQje6knPDSFGck/qzzDRT6XPixNquqjEX JZNIh5T/pbricGtXf5Ho+bRl0++9hZvTJQiYei5JYSBJGCcJb+yt6w39dYN7Vy15BZtT cxKV7LjRb0JgRECQYjx5KicUN8PFx8r/LoYDOBVbfTmAjFcdAS15AjoDWUHkcumtDBpI YQVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698811403; x=1699416203; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NnMb6+VyJPA3A0rpO2QIfgR9bU2yeP3mMFNmvX5wlvI=; b=LRN0+ydhqwey9bCtdXpPH1ohCJcVKsYhPznl+ik1WLE1xW0Dneih2FBJPK9sZHmtQk j89qICTwleM1XzLOGh+DBeaohMXBGXZGLVvx2E7AhXhFGTiSo33GR84yrgcVsS7VPdvw lkmDEjTEQj2+q/qdto9uQGVg+iBpRUoMYYWH1Uz/UkmudHhlpunsWlyLRgqwYINYtkPe lI2f5VK3h3bv4uU/63VMZXODssbjwwszWQlDxUiW7F6MvmyZh7mlGCwt085Qs+BVsLAR l/4MUHVLX1mbh2FhAwfss5LvoC/v71X6ZPK9sbbYldG9kcf22HElKlxwLhM5YrEGMR04 EVag== X-Gm-Message-State: AOJu0YxKnw/qe1iGQx6uSKRhwEfH+kzm8IV5GwU4/F5k7Uy1wbFY2jEJ bSfCebEBuFiiTPHyXOdTBn+PEfiViMQ= X-Received: by 2002:a05:6a21:7897:b0:151:35ad:f331 with SMTP id bf23-20020a056a21789700b0015135adf331mr6146183pzc.14.1698811402841; Tue, 31 Oct 2023 21:03:22 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id n2-20020aa78a42000000b006c107a9e8f0sm348552pfa.128.2023.10.31.21.03.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 21:03:22 -0700 (PDT) Sender: Guenter Roeck Date: Tue, 31 Oct 2023 21:03:20 -0700 From: Guenter Roeck To: Kees Cook Cc: Mark Rutland , Li zeming , gor@linux.ibm.com, hca@linux.ibm.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] stackleak: Remove unnecessary '0' values from ret Message-ID: References: <20231017060824.10434-1-zeming@nfschina.com> <202310181704.F1089D5B@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202310181704.F1089D5B@keescook> X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 31 Oct 2023 21:03:27 -0700 (PDT) On Wed, Oct 18, 2023 at 05:39:21PM -0700, Kees Cook wrote: > On Tue, Oct 17, 2023 at 11:14:43AM +0100, Mark Rutland wrote: > > On Tue, Oct 17, 2023 at 02:08:24PM +0800, Li zeming wrote: > > > ret is assigned first, so it does not need to initialize the assignment. > > > > > > Signed-off-by: Li zeming > > > > Does this actually need to change? It's not harmful, and deleting the > > assignment doesn't save any lines of code. > > I prefer explicit initialization. Any unused initialization will be > optimized away by the compiler during Dead Store Elimination, so all > removing the initialization does is make the code more fragile in the > future. > Also, be careful with those submissions, and do not take the claim in the commit message at face value. Several of them introduce uninitialize variable errors. I had two submissions for the watchdog subsystem, and both of them were wrong. Guenter