Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp45319rdb; Wed, 18 Oct 2023 17:40:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGNkEeizo8rzL4cbxYz3vEoRT7A4VqcdLRkVnBnrFxG31dBiT+FLX0bwkiMx2fpytPz2j0R X-Received: by 2002:a05:6a00:1506:b0:6ba:2ba7:b9cb with SMTP id q6-20020a056a00150600b006ba2ba7b9cbmr739784pfu.12.1697676014526; Wed, 18 Oct 2023 17:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697676014; cv=none; d=google.com; s=arc-20160816; b=kwQdLG1NSMZidZ0vCYbKOqiacMOKBYb7FbMMd2kCjQQq3o04Bi7q7A/HWbX0AF6g8F F5yRQy4Z02Dftf3NNYf79WJ8vfEsm7MIYFohoNyVzmqX84WcNxHEpU4/nWhJBMB44gVH FAHn/nTD8zqlSDjOMblfZE39PU4iEgYl2xA1uia6Ud264Z8XtWRnfn9l4+S49BZW8N7s HdA3rHq8Q4ETrgjFdNShR/Rw1blzHqQtKjBYJe8q/dSRQ5ng+jgfmDzcu/9VG8dk5a8+ S2t3kwKRCNk5DJrKsPEXv8+zt5MfHMXWGaYUPw1uEH0HcB4EopU8rQ10gFfSU4TteXNI JxTg== 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=FlAqaHdwVhP7VKj5Daa/OfAYFr6hwyKTFgWl8b0z2fY=; fh=0ce13NnNxS0p7i17x/Z5gfr/Sw04PdKhN3tsBCE2qB8=; b=SRLGMA03UZKxmdbEA0qOf6ep5PYB5bi4ocuSLc4xTR7OU6l85G6cuP2iM8k2KJ5/rr Q/iTIHdOichyQGwJWoLKxeVtRtp8ZwytXtMrnHgUyFCJLKnoc8lOCTAjGglgGrahhfZp U+Ds9oGjrFa+OaEy4tvuru6svnIEI6Q98vqUKv+D84FwcZihLyEXXUhEq5I3PlnmUUNl vL4UgSyicwebbJMv5A5H0oDnRhV84xpRy2FMaVYoI62HzUjx3tVfV7iKVV7OEDwCyVGC kSPcRVvl6XmO+DJ9Qjf8JKcdeRHCSmV4S42hAwudJhRRMYPNEobY+BhPgowiD37iQMVH galQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CMuJGFPH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id by31-20020a056a02059f00b00578c3b7af9fsi3764839pgb.184.2023.10.18.17.40.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 17:40:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CMuJGFPH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 31BAB8113EE7; Wed, 18 Oct 2023 17:40:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229726AbjJSAj0 (ORCPT + 99 others); Wed, 18 Oct 2023 20:39:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbjJSAjZ (ORCPT ); Wed, 18 Oct 2023 20:39:25 -0400 Received: from mail-oo1-xc2c.google.com (mail-oo1-xc2c.google.com [IPv6:2607:f8b0:4864:20::c2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA95CFE for ; Wed, 18 Oct 2023 17:39:23 -0700 (PDT) Received: by mail-oo1-xc2c.google.com with SMTP id 006d021491bc7-5832ea25c7eso365284eaf.3 for ; Wed, 18 Oct 2023 17:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1697675963; x=1698280763; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=FlAqaHdwVhP7VKj5Daa/OfAYFr6hwyKTFgWl8b0z2fY=; b=CMuJGFPHhNXI2VOwSGJiFikZYuNbevuaGufA8gldUtBHXpgyY/TMu8dIjailP9wgl5 eZh7ULnjXp7gb9lv4cLsP7cP125Zc/VwWz8mE/Orj6dxlc8ASPHcTbFy+QxTWJPDSdfc lth67MUvp5WnfAWa3WNdiCaUx4qSZqnm/rm04= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697675963; x=1698280763; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FlAqaHdwVhP7VKj5Daa/OfAYFr6hwyKTFgWl8b0z2fY=; b=C2Z3YUy+/2vDNcmpYH/09J5eitirjyng4ePbGLMFqR6gP+m48+3KwFk2bBoMfHLDF8 hH23TqAtSuom6OLNfvriWnZfVBuBwebqSbs2rUjLJxcOyQW2gk0oR6cDYmU4ghctSdej DqJVAC2TRkRKY6BYFnz56pX8udrVFUF9KxhDcufXDr7L4Q1VT7eS3C8dQ4lfpGnvwQpc wqHkKylAFPkhrSFXb4jpNojCjop+i3AvqsnVxMyry9nx/+DycqT/YE1mkhl5t5LtsPzv //Zihlp8oio7WqjCd6yfaCn5FY9Uj8jQ+3mJEmak+C7GwolAO2iiNTKk1mY679U6441f l5Zw== X-Gm-Message-State: AOJu0YyWVq18MNZTseGB6CPn7gElkwR+AN6QxCR5V1lEHDL4hibvxySq GvkvKWZJ3qow8G0piHl13kpmCg== X-Received: by 2002:a05:6358:5114:b0:13c:dd43:f741 with SMTP id 20-20020a056358511400b0013cdd43f741mr471532rwi.24.1697675962983; Wed, 18 Oct 2023 17:39:22 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id y18-20020aa79432000000b006bd2bbbaf49sm3929613pfo.122.2023.10.18.17.39.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 17:39:22 -0700 (PDT) Date: Wed, 18 Oct 2023 17:39:21 -0700 From: Kees Cook To: Mark Rutland Cc: 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: <202310181704.F1089D5B@keescook> References: <20231017060824.10434-1-zeming@nfschina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Wed, 18 Oct 2023 17:40:07 -0700 (PDT) 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. > That said, I don't have strong feelings either way, and Kees is the > de-facto-yet-undocumented maintainer for this code, so I will leave it to him > to decide whether to apply. Oh, hm, good point. I will add a MAINTAINER entry for it. Thanks! -Kees -- Kees Cook