Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1930891ybt; Mon, 15 Jun 2020 13:14:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDkN/4YmqJ1by+Y+K9bL/Y2q3fyjH08qt4P3cX2xGwlhnDqsHXocf3J5FOfiuAhZTH5kOG X-Received: by 2002:a05:6402:1767:: with SMTP id da7mr26030502edb.90.1592252041576; Mon, 15 Jun 2020 13:14:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592252041; cv=none; d=google.com; s=arc-20160816; b=No2AVLmW/U/pvS3DCwL1QFNoQneYBelUiP86bqZk0DPYm2cFEpoFatweGzx7oy7Zc6 T7HyZ3Sgm9cV3NvdoNzdjul1vdRxK4/4YeTIyO92RMHJHBYV5fCDTx8gkQC9ZpDg2Ctg vPhbpqUj17/CgIatch/XkSsvDI4SX/19EbU8yK2q1VlPrBnKzzazv1IOJE+Z/lcpSsmI YrfteciVvRtbmsWB/HyFVlejgV4wwbwwpu8PJxZFMut68sukbdDzHsfpQ2Kje+7oyUBM TSRH40Gv6sn9A7CkLmtl7/7CUFXlR1otd9H6df54krZHQSvcSLh1OHlWLNbtG2f3j9xG UywA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Yrq+7tIQLTLfowElVM/LAUx+j6R1G8S30nvCECShhQQ=; b=msatjrwbg4B2HMQqvb5MbEniQu8DmWY2thPX1Lrpi2ADUvOn5xV8r9Rb34WwbQNH9p T28v3QR6o5X2+sO6saX8SWAx5tOIx4Gwzll/6uZD2djr8uXvoB5McJOW6ljj4P0q67id Jyl7queTmKG8uc37pyioVe2qDzH9xqLcWq4vAPso4ORD+/KR5fLKh8eEc8NB+MayKpmS a/q8kCNgd9PiE7dseXl4dlpDbxq4MoVqctGxJVYi2B12KGChh1O0EyF3l9YaFyMK1dT9 NAxH4GIfkM9DjR8ADHHEy97AwDgoujMMtqSV41Ic8rIE63UburlhNqms+PA3E82VSt4l WDXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=l6YV1FGo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w23si9423583edv.71.2020.06.15.13.13.39; Mon, 15 Jun 2020 13:14:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=l6YV1FGo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1730095AbgFOULl (ORCPT + 99 others); Mon, 15 Jun 2020 16:11:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729821AbgFOULl (ORCPT ); Mon, 15 Jun 2020 16:11:41 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E905C061A0E for ; Mon, 15 Jun 2020 13:11:41 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id e18so8062732pgn.7 for ; Mon, 15 Jun 2020 13:11:41 -0700 (PDT) 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=Yrq+7tIQLTLfowElVM/LAUx+j6R1G8S30nvCECShhQQ=; b=l6YV1FGo7TU7pAG9+qw2VIKRm2zpVhJYfNx5Q3J6oTPJYQgyGzOfcrhTa0eJoLKTfn 6NfDhsnF08XkpsSWX1cIl04wPTRWtjc8sLkIwWt83YoJPjzvbq0i2dqsxkNArhbh3t0Y BD6QOc6aFvItzd5w5V1qKCCHaAGNorfpDSIn8= 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=Yrq+7tIQLTLfowElVM/LAUx+j6R1G8S30nvCECShhQQ=; b=uWCjKqgclq8MmVmNpaRGQPi0uCqX/w5ggxBXrALWX9P4eKyssx0xkwDfuH5Kg9FCxd DwfcA79W5m0en37zXtseAer6T7qaS9WF6Eq0bk48j3UDd6X2Aqobotpw1nobhSBVP+UA VqFcgtHZ8RIMdaSPUFt1n0lb1iAmf9NwElBGcomisT4X4E+Vjdx6s8zJSHbAmDP0VUaq Z+e+ybT/xDPld+H2AbBIUOKXvugoyrEvUB8AqmkOTl0xrUTGOLwKx06W+FMMYO38Ow84 tV47ru4gnPDmRNFKtebmWDnJLpAGnWgcjm1MqZwxuFygGKlfNy6V65EYfVQXYINlXhyr ptyg== X-Gm-Message-State: AOAM531PvnlBvlavQYkXQfywjDmkjoOJq6u+yEfwvSk9UFpOwppDLYAU 5rbVN8y9lL2RYCP3pR3S80vPTg== X-Received: by 2002:a63:925a:: with SMTP id s26mr14310236pgn.21.1592251900590; Mon, 15 Jun 2020 13:11:40 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id n4sm15282175pfq.9.2020.06.15.13.11.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 13:11:39 -0700 (PDT) Date: Mon, 15 Jun 2020 13:11:38 -0700 From: Kees Cook To: Jason Yan Cc: jaegeuk@kernel.org, chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, Chao Yu Subject: Re: [PATCH] f2fs: Eliminate usage of uninitialized_var() macro Message-ID: <202006151311.138CD1D@keescook> References: <20200615085132.166470-1-yanaijie@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200615085132.166470-1-yanaijie@huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 15, 2020 at 04:51:32PM +0800, Jason Yan wrote: > This is an effort to eliminate the uninitialized_var() macro[1]. > > The use of this macro is the wrong solution because it forces off ANY > analysis by the compiler for a given variable. It even masks "unused > variable" warnings. > > Quoted from Linus[2]: > > "It's a horrible thing to use, in that it adds extra cruft to the > source code, and then shuts up a compiler warning (even the _reliable_ > warnings from gcc)." > > Fix it by remove this variable since it is not needed at all. > > [1] https://github.com/KSPP/linux/issues/81 > [2] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/ > > Cc: Kees Cook > Suggested-by: Chao Yu > Signed-off-by: Jason Yan > --- > v2: Directly remove this variable. Thanks! I've applied this to my uninitialized_var() macro removal series. -- Kees Cook