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 X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E43FCC433E1 for ; Thu, 4 Jun 2020 01:40:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A6CB8207D0 for ; Thu, 4 Jun 2020 01:40:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="D25kXdKh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A6CB8207D0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4A5D48000E; Wed, 3 Jun 2020 21:40:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 47CA88000C; Wed, 3 Jun 2020 21:40:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 391CF8000E; Wed, 3 Jun 2020 21:40:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0151.hostedemail.com [216.40.44.151]) by kanga.kvack.org (Postfix) with ESMTP id 1DF1B8000C for ; Wed, 3 Jun 2020 21:40:13 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C5C53180AD802 for ; Thu, 4 Jun 2020 01:40:12 +0000 (UTC) X-FDA: 76889823864.17.horse98_7637aaac5f005 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 9E91F180D0180 for ; Thu, 4 Jun 2020 01:40:12 +0000 (UTC) X-HE-Tag: horse98_7637aaac5f005 X-Filterd-Recvd-Size: 5262 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Thu, 4 Jun 2020 01:40:12 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id y17so1478496plb.8 for ; Wed, 03 Jun 2020 18:40:12 -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=RZTkgHwXnV/Mmq7iR84jWoY6DwZ1rOj4qUQ+qrZYDwc=; b=D25kXdKhWQJ/MUHuNLgCYDZUO7VYifzgRU57sW3cCgSotuT36cS0gwMFjJehcx+vT7 Qo+Rryfzbt2dW0wLdUcGj9Q0InUDL3Kms87BacBCRrJrfyyPbeQNxvn25asBf8woO+z3 +P77gIynfVAOQsI2dG7+NHySk/5WZ7LfsfFJE= 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=RZTkgHwXnV/Mmq7iR84jWoY6DwZ1rOj4qUQ+qrZYDwc=; b=ECjy2Gc13fN2UE2jgodx+KIif+lnQMEeS+QggHdgEJKe33Zl1pa6NzlgHVnyl3DDZs L6qLHCBCNeuOMdlEsesHLh062+drvblvZEU1qnKU+JZqwoDwiYt9EGDM+Hva4fwPldYz Pd9IyK7ea5hD6z0PmQozOEbUBProtX3UyOQ7DRaMHS6QxDzQbaaXFT+gbXAeCA5HiKaE EBCIAqZBL3QxsLXZTbQE7ljbFaK1KrkxjAcsJU20TG9UXPxwMcyz341Ak8PF8esYeFuH I1DTmjNXTOagJzEa59s3061cUMN51VnSwdl6M62JitE6jhFy0XbjVhkEaJnpQZKI9wma OpCg== X-Gm-Message-State: AOAM530JvapDLX79R+6LKvi/0bNCSpZtfjPsJKdw4piIDfSHnT/uXkJ6 cDLFmIufGX9Yv0/7VOSe6CnSRkIFloinQA== X-Google-Smtp-Source: ABdhPJyG3cK5GuU0RarjdGROX8AagUDp+h912sluu+H/wdjYIyX1M3u7CAMpBcEf90rpTZQM3JGTsw== X-Received: by 2002:a17:90a:dd44:: with SMTP id u4mr2890350pjv.132.1591234811278; Wed, 03 Jun 2020 18:40:11 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id o13sm2589124pgs.82.2020.06.03.18.40.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 18:40:10 -0700 (PDT) Date: Wed, 3 Jun 2020 18:40:09 -0700 From: Kees Cook To: Joe Perches Cc: linux-kernel@vger.kernel.org, Linus Torvalds , Miguel Ojeda , Alexander Potapenko , Andy Whitcroft , x86@kernel.org, drbd-dev@lists.linbit.com, linux-block@vger.kernel.org, b43-dev@lists.infradead.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-ide@vger.kernel.org, linux-clk@vger.kernel.org, linux-spi@vger.kernel.org, linux-mm@kvack.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH 08/10] checkpatch: Remove awareness of uninitialized_var() macro Message-ID: <202006031838.55722640DC@keescook> References: <20200603233203.1695403-1-keescook@chromium.org> <20200603233203.1695403-9-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 9E91F180D0180 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Jun 03, 2020 at 05:02:29PM -0700, Joe Perches wrote: > On Wed, 2020-06-03 at 16:32 -0700, Kees Cook wrote: > > Using uninitialized_var() is dangerous as it papers over real bugs[1] > > (or can in the future), and suppresses unrelated compiler warnings > > (e.g. "unused variable"). If the compiler thinks it is uninitialized, > > either simply initialize the variable or make compiler changes. > > > > In preparation for removing[2] the[3] macro[4], effectively revert > > commit 16b7f3c89907 ("checkpatch: avoid warning about uninitialized_var()") > > and remove all remaining mentions of uninitialized_var(). > > > > [1] https://lore.kernel.org/lkml/20200603174714.192027-1-glider@google.com/ > > [2] https://lore.kernel.org/lkml/CA+55aFw+Vbj0i=1TGqCR5vQkCzWJ0QxK6CernOU6eedsudAixw@mail.gmail.com/ > > [3] https://lore.kernel.org/lkml/CA+55aFwgbgqhbp1fkxvRKEpzyR5J8n1vKT1VZdz9knmPuXhOeg@mail.gmail.com/ > > [4] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/ > > nack. see below. > > I'd prefer a simple revert, but it shouldn't > be done here. What do you mean? (I can't understand this and "fine by me" below?) > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > [] > > @@ -4075,7 +4074,7 @@ sub process { > > } > > > > # check for function declarations without arguments like "int foo()" > > - if ($line =~ /(\b$Type\s*$Ident)\s*\(\s*\)/) { > > + if ($line =~ /(\b$Type\s+$Ident)\s*\(\s*\)/) { > > This isn't right because $Type includes a possible trailing * > where there isn't a space between $Type and $Ident Ah, hm, that was changed in the mentioned commit: - if ($line =~ /(\b$Type\s+$Ident)\s*\(\s*\)/) { + if ($line =~ /(\b$Type\s*$Ident)\s*\(\s*\)/) { > > e.g.: int *bar(void); > > Other than that, fine by me... Thanks for looking it over! I'll adjust it however you'd like. :) -- Kees Cook