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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, 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 51851C433E0 for ; Thu, 4 Jun 2020 19:09:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 20486206A2 for ; Thu, 4 Jun 2020 19:09:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20486206A2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9D30680007; Thu, 4 Jun 2020 15:09:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 983358E0006; Thu, 4 Jun 2020 15:09:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8985080007; Thu, 4 Jun 2020 15:09:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0064.hostedemail.com [216.40.44.64]) by kanga.kvack.org (Postfix) with ESMTP id 7239C8E0006 for ; Thu, 4 Jun 2020 15:09:45 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 36E0C1287EB for ; Thu, 4 Jun 2020 19:09:45 +0000 (UTC) X-FDA: 76892468730.12.plane57_310ec2d26d99 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 14848182EC6B4 for ; Thu, 4 Jun 2020 19:09:45 +0000 (UTC) X-HE-Tag: plane57_310ec2d26d99 X-Filterd-Recvd-Size: 4874 Received: from mail-ot1-f67.google.com (mail-ot1-f67.google.com [209.85.210.67]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Thu, 4 Jun 2020 19:09:44 +0000 (UTC) Received: by mail-ot1-f67.google.com with SMTP id o13so5649054otl.5 for ; Thu, 04 Jun 2020 12:09:44 -0700 (PDT) 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:from:date :message-id:subject:to:cc; bh=X+qiK8YjhEONxTpdjX70xl6++OY/MUPwZ+Do1G1LJJ8=; b=t+Q5BCeII5FAPWEH1h8P4Hjh8k8YXs8z5X5PpqNG1S3FNAtFhFlImseiz7sq6PJNzH YGLS5JkXgJucjy6D9bqjZupe0E9nlWvNUZt4T8KqI78iBqc8Ua4ALvNBdM5FuFLOj5R3 GoIW6oO41ANViOunH8HbEWfzTP6qJz5C9qviuN4PXsUrV/vIv5M8uUeXYJm7SHZuqMvn bN3ScqL/oYL4HvJjqS0Va/rWo9Wh/fiMBYodgm0/5+I9zHflXL/oxHLM9KZ7vDBegVW5 RRJiceSCd/hohijPXXismRnOqXs9sEn8ZAAl8pEov3n2fq7jTUiPAZHvwa6ASR7Ari55 VrMQ== X-Gm-Message-State: AOAM531N5BWBKeEkTETqvz3GJOSv6egUbcJwWMQxtK72/yrVXYy2Z3P4 878Kt9uqyk7l7Bzn/8auv6WP6dnxdlR33olwxfs= X-Google-Smtp-Source: ABdhPJzhyOhHvYlAI9At8dx2VdKyrIdrlXCUe7od4PVsnRA3/MLtv6c1HELqb/95gRjonFKD9uvMPOkwcy/FsbOWC+M= X-Received: by 2002:a05:6830:141a:: with SMTP id v26mr4936016otp.250.1591297783928; Thu, 04 Jun 2020 12:09:43 -0700 (PDT) MIME-Version: 1.0 References: <20200603233203.1695403-1-keescook@chromium.org> <20200603233203.1695403-10-keescook@chromium.org> <20200604132306.GO6578@ziepe.ca> <202006040757.0DFC3F28E@keescook> In-Reply-To: <202006040757.0DFC3F28E@keescook> From: Geert Uytterhoeven Date: Thu, 4 Jun 2020 21:09:32 +0200 Message-ID: Subject: Re: [PATCH 09/10] treewide: Remove uninitialized_var() usage To: Kees Cook Cc: Jason Gunthorpe , Linux Kernel Mailing List , Linus Torvalds , Miguel Ojeda , Alexander Potapenko , Joe Perches , Andy Whitcroft , "the arch/x86 maintainers" , Lars Ellenberg , linux-block@vger.kernel.org, b43-dev@lists.infradead.org, netdev , linux-wireless , linux-ide@vger.kernel.org, linux-clk , linux-spi , Linux MM , clang-built-linux Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 14848182EC6B4 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: Hi Kees, On Thu, Jun 4, 2020 at 5:01 PM Kees Cook wrote: > On Thu, Jun 04, 2020 at 10:23:06AM -0300, Jason Gunthorpe wrote: > > On Wed, Jun 03, 2020 at 04:32:02PM -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. > > > > > > I preparation for removing[2] the[3] macro[4], remove all remaining > > > needless uses with the following script: > > > > > > git grep '\buninitialized_var\b' | cut -d: -f1 | sort -u | \ > > > xargs perl -pi -e \ > > > 's/\buninitialized_var\(([^\)]+)\)/\1/g; > > > s:\s*/\* (GCC be quiet|to make compiler happy) \*/$::g;' > > > > > > drivers/video/fbdev/riva/riva_hw.c was manually tweaked to avoid > > > pathological white-space. > > > > > > No outstanding warnings were found building allmodconfig with GCC 9.3.0 > > > for x86_64, i386, arm64, arm, powerpc, powerpc64le, s390x, mips, sparc64, > > > alpha, and m68k. > > > > At least in the infiniband part I'm confident that old gcc versions > > will print warnings after this patch. > > > > As the warnings are wrong, do we care? Should old gcc maybe just -Wno- > > the warning? > > I *think* a lot of those are from -Wmaybe-uninitialized, but Linus just > turned that off unconditionally in v5.7: > 78a5255ffb6a ("Stop the ad-hoc games with -Wno-maybe-initialized") > > I'll try to double-check with some older gcc versions. My compiler > collection is mostly single-axis: lots of arches, not lots of versions. ;) Nope, support for the good old gcc 4.1 was removed a while ago. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds