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 3A23FC433E3 for ; Thu, 4 Jun 2020 03:33:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F3147206DC for ; Thu, 4 Jun 2020 03:33:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hAU6iC7S" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F3147206DC 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 9F92F8000C; Wed, 3 Jun 2020 23:33:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D0348000B; Wed, 3 Jun 2020 23:33:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8E5AE8000C; Wed, 3 Jun 2020 23:33:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0083.hostedemail.com [216.40.44.83]) by kanga.kvack.org (Postfix) with ESMTP id 7358A8000B for ; Wed, 3 Jun 2020 23:33:51 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 4077A2497 for ; Thu, 4 Jun 2020 03:33:51 +0000 (UTC) X-FDA: 76890110262.05.rest70_5bcb7cdd44555 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 1EB051801366C for ; Thu, 4 Jun 2020 03:33:51 +0000 (UTC) X-HE-Tag: rest70_5bcb7cdd44555 X-Filterd-Recvd-Size: 5542 Received: from mail-ot1-f68.google.com (mail-ot1-f68.google.com [209.85.210.68]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Thu, 4 Jun 2020 03:33:50 +0000 (UTC) Received: by mail-ot1-f68.google.com with SMTP id o13so3688597otl.5 for ; Wed, 03 Jun 2020 20:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=MtysUER1l5a/zqtCZtWbYXE2kDcmWMdAVlNOZNySUKQ=; b=hAU6iC7SzuADMG5Aos+RZHGnFaCQ8z6d36F+7W8dHx8UydKYHSdkcMT8w6CUcGNzag njj37uaHb1XsQkeNNgODWxw+JmIPSJFsiOzWaiRts6JwLN85uBohYPmIU0IknkNXqApb 3XrfusUHfNL5s13uf3b2DyoPaSWSJxflMEAZNaYtnurxuCdr4w+7UzwHmt4ux1uoSJZY VRuPqpiBPltoh715g3N7dXpDuR406aK9rtLam9pcwGJmc9amafFSMtWft6BzB9EYs6D1 9LU1A/I8cVMacSajcwltKX+v5EE6MYClw1IEQtopq+DleI/1RwWeGJEmC369juox9UBM UuWg== 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=MtysUER1l5a/zqtCZtWbYXE2kDcmWMdAVlNOZNySUKQ=; b=XEsbhLZqNbuXyZp6ho+YC/GQtHExFwNYUuOlAaHh5a2bUnhiPFoenWYFrq09AQZjb2 4qCNbH8zr6htDH4fSnADHAi0pIJjgqdoevhLUTOxB5dMDFnHodkl3/mDUhe3Ulj93P4s Wk0Ka33n75fMMturp98ifzTSDI2YlkR0cy+3/tP0PkAopXPrB61y1fa8AhCLvv9+LSOY hngMzb/pvB8SgyGLXaq1yV+rC3ECfAi1/038/fjDo8c4d5O9v74uEPa7lujkazBucvUJ K8+eYrXCVhgiSD+AEZJG0VIUf1CYNoL/xaRqXdXiEgE15oj40jRQj26wbdrkB6WuBtor ansQ== X-Gm-Message-State: AOAM532XZivVddItgpzwIGRGittMiAwHccEc+wqZqxG5TIuwG7+IwwBM omhDXswwAc4KyosmFENpTB0= X-Google-Smtp-Source: ABdhPJwauBmbuSyRfNNxnZntj92z7/qBAcGhEUztVFaDTipPYCkr+MSp0RGhU7FWUD4z+qoEhiCdIA== X-Received: by 2002:a9d:7387:: with SMTP id j7mr2354350otk.157.1591241630021; Wed, 03 Jun 2020 20:33:50 -0700 (PDT) Received: from ubuntu-n2-xlarge-x86 ([2604:1380:4111:8b00::3]) by smtp.gmail.com with ESMTPSA id z13sm969120oom.3.2020.06.03.20.33.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 20:33:49 -0700 (PDT) Date: Wed, 3 Jun 2020 20:33:47 -0700 From: Nathan Chancellor To: Kees Cook Cc: 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@googlegroups.com Subject: Re: [PATCH 00/10] Remove uninitialized_var() macro Message-ID: <20200604033347.GA3962068@ubuntu-n2-xlarge-x86> References: <20200603233203.1695403-1-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200603233203.1695403-1-keescook@chromium.org> X-Rspamd-Queue-Id: 1EB051801366C X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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 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]