[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200604033347.GA3962068@ubuntu-n2-xlarge-x86>
Date: Wed, 3 Jun 2020 20:33:47 -0700
From: Nathan Chancellor <natechancellor@...il.com>
To: Kees Cook <keescook@...omium.org>
Cc: linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Alexander Potapenko <glider@...gle.com>,
Joe Perches <joe@...ches.com>,
Andy Whitcroft <apw@...onical.com>, x86@...nel.org,
drbd-dev@...ts.linbit.com, linux-block@...r.kernel.org,
b43-dev@...ts.infradead.org, netdev@...r.kernel.org,
linux-wireless@...r.kernel.org, linux-ide@...r.kernel.org,
linux-clk@...r.kernel.org, linux-spi@...r.kernel.org,
linux-mm@...ck.org, clang-built-linux@...glegroups.com
Subject: Re: [PATCH 00/10] Remove uninitialized_var() macro
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 <natechancellor@...il.com> [build]
Powered by blists - more mailing lists