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=-5.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 71B86C433DF for ; Thu, 4 Jun 2020 07:27:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 321222072E for ; Thu, 4 Jun 2020 07:27:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZS4bR5yl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 321222072E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CFD6A80014; Thu, 4 Jun 2020 03:27:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CD5238000E; Thu, 4 Jun 2020 03:27:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C10BE80014; Thu, 4 Jun 2020 03:27:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0004.hostedemail.com [216.40.44.4]) by kanga.kvack.org (Postfix) with ESMTP id A6AB18000E for ; Thu, 4 Jun 2020 03:27:11 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 6335C824934B for ; Thu, 4 Jun 2020 07:27:11 +0000 (UTC) X-FDA: 76890698262.03.cap37_5bcb7dbb9ec0d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 1B95A13573 for ; Thu, 4 Jun 2020 07:27:11 +0000 (UTC) X-HE-Tag: cap37_5bcb7dbb9ec0d X-Filterd-Recvd-Size: 5769 Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Thu, 4 Jun 2020 07:27:10 +0000 (UTC) Received: by mail-io1-f67.google.com with SMTP id j8so5188999iog.13 for ; Thu, 04 Jun 2020 00:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=mGOxjTCdefrrnR0hBKEqLE+5+y5wUx6BcOT52JEiO/w=; b=ZS4bR5ylkA3qMyDfT9teREVYO+h3tibjnXyMJoJVX+G5mJ13iGtF5nRneHn2y4BXKk lbuA38DH8PUg7+NnR/cRrvaPdec+9VbV7j8bpXSIvpgF1JXXQjjbiwoR4VphfuiGExJt hLAd/KpHYlSGyG+SYPS4B4UqdSRoUABVvzmUhM84xdRr3+M7Ejw5zRXRHI9S7C4ge69w pHHApPVvaksuEjuQWJYGIZ58KDToZLKr1OfN8O/H8RmdIn0p+KhbEW4AU6+9mOsYqoG0 i4HZ9VdbrqFEIkfk7P5p1r/q/z2DKw42yvXNm3xth1WgLu9BQ1Leo+hkaKoCcnQ7shWy D+2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=mGOxjTCdefrrnR0hBKEqLE+5+y5wUx6BcOT52JEiO/w=; b=r72/0wPSRTcnoKUtmwrG23YIHGwCamrpiiLdeIB5MTdoX18MVUXUwy664NnANX84mR yTuDdck686Uwuyh/W0r+Ijd/Qrwy+jVzcX5Z2cdtjJkfvvqMz/UHuPYEZmtfDz96Go5L WxeM2exVjXL4J+o9x/InVbkJtKgWK4y8E7zrbHiTu4H8woWIKJltSSINrnkMnsO1fyHM 27hmU1ecsa5AE3f2oFs34oC8UqN2LiW2et0i6TGlTlppTUhamTKGpPjWTM5P1NzwzhPb UJIBqfBA7iJKY2oetEAtsKHrsA1AXz1wo4UP1HWBfYAOZYrnkWEyb9rAVlrPSFeJt2Sw 6n6w== X-Gm-Message-State: AOAM532pbWbqDBTEWKSkHM63BSMutiYpNRv8oRvf+B8B7UeTtLULS1w5 u1j5xhrYKjwPgpY13oWJk/Zty7/kKviZq24nHIU= X-Google-Smtp-Source: ABdhPJwrHY2BsggDHErpO1Iuf0ec8cSLwXn1wO03W9qrRj259eIfuSS5XQEsDKLZy/A8Pd7aPUbrd6qaIHCM8QmxBFo= X-Received: by 2002:a5d:91cc:: with SMTP id k12mr2896278ior.135.1591255630008; Thu, 04 Jun 2020 00:27:10 -0700 (PDT) MIME-Version: 1.0 References: <20200603233203.1695403-1-keescook@chromium.org> <20200604033347.GA3962068@ubuntu-n2-xlarge-x86> In-Reply-To: <20200604033347.GA3962068@ubuntu-n2-xlarge-x86> Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Thu, 4 Jun 2020 09:26:58 +0200 Message-ID: Subject: Re: [PATCH 00/10] Remove uninitialized_var() macro To: Nathan Chancellor Cc: Kees Cook , linux-kernel@vger.kernel.org, Linus Torvalds , Miguel Ojeda , Alexander Potapenko , Joe Perches , 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 ML Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 1B95A13573 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 Thu, Jun 4, 2020 at 5:33 AM Nathan Chancellor wrote: > > On Wed, Jun 03, 2020 at 04:31:53PM -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. > > > > As recommended[2] by[3] Linus[4], remove the macro. > > > > Most of the 300 uses don't cause any warnings on gcc 9.3.0, so they're in > > a single treewide commit in this series. A few others needed to actually > > get cleaned up, and I broke those out into individual patches. > > > > -Kees > > > > [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/ > > > > Kees Cook (10): > > x86/mm/numa: Remove uninitialized_var() usage > > drbd: Remove uninitialized_var() usage > > b43: Remove uninitialized_var() usage > > rtlwifi: rtl8192cu: Remove uninitialized_var() usage > > ide: Remove uninitialized_var() usage > > clk: st: Remove uninitialized_var() usage > > spi: davinci: Remove uninitialized_var() usage > > checkpatch: Remove awareness of uninitialized_var() macro > > treewide: Remove uninitialized_var() usage > > compiler: Remove uninitialized_var() macro > > I applied all of these on top of cb8e59cc8720 and ran a variety of > builds with clang for arm32, arm64, mips, powerpc, s390, and x86_64 [1] > and only saw one warning pop up (which was about a variable being > unused, commented on patch 9 about it). No warnings about uninitialized > variables came up; clang's -Wuninitialized was not impacted by > 78a5255ffb6a ("Stop the ad-hoc games with -Wno-maybe-initialized") so it > should have caught anything egregious. > > [1]: https://github.com/nathanchance/llvm-kernel-testing > > For the series, consider it: > > Tested-by: Nathan Chancellor [build] > Hi Kees, I tried with updated version (checkpatch) of your tree and see no (new) warnings in my build-log. Feel free to add my... Tested-by: Sedat Dilek Thanks. Regards, - Sedat -