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=-16.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 3BEA0C433E1 for ; Thu, 4 Jun 2020 20:29:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 00FA3206E6 for ; Thu, 4 Jun 2020 20:29:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="N9f0DBz1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 00FA3206E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8F0D18E0006; Thu, 4 Jun 2020 16:29:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 879E980007; Thu, 4 Jun 2020 16:29:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 772828E0006; Thu, 4 Jun 2020 16:29:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0101.hostedemail.com [216.40.44.101]) by kanga.kvack.org (Postfix) with ESMTP id 5E8118E0006 for ; Thu, 4 Jun 2020 16:29:58 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1E688180AD801 for ; Thu, 4 Jun 2020 20:29:58 +0000 (UTC) X-FDA: 76892670876.15.maid89_41135e526d9a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id EABB01814B0CC for ; Thu, 4 Jun 2020 20:29:57 +0000 (UTC) X-HE-Tag: maid89_41135e526d9a X-Filterd-Recvd-Size: 5700 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Thu, 4 Jun 2020 20:29:57 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id d66so3797076pfd.6 for ; Thu, 04 Jun 2020 13:29:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bnsaMm5xHsmGTKM8crY5633RBfnrE452zASAiUrFU6c=; b=N9f0DBz11v8qKCu5VA9JXvurX/AQtTOXbiTH5jmNKefXzNsIFm+M7WPzmoaUlp4aH2 r+jMi/YmukLuVqYctzsJtxcn0mVNYhMsSNT9VA6N7PnsQg5yUlK9mfLk/5/Ruh0U/Pwu PDPRxMt4IzbnxQDI/neSyUM1ytXRkW/vLuLZKE80o7Nj5PUF2JyDsoKL+PvQ95dTnNfZ KgrObLpuy2lSQ1b3DD2riryZUDl8/MGtuP3prwyWT2YzcrBoR4Z0ygA8w4IwkVOIQfT2 XknAaA0BFuOmwbwTbgOy7UCAxJmRzkJu3RwBQHvX6d2dQvm2RBoWXIh1YpGHB5SsL5b+ hRAg== 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=bnsaMm5xHsmGTKM8crY5633RBfnrE452zASAiUrFU6c=; b=eFzUnZvfUGM4muQlcPMwjj6ehFK1IMWGKNAkA/EzRZes96MLR95tNH++N8hkfirlJU 6SImkgnX0u19+wALbmglLo/mDnUX/D/kBRiWSzXpT7qdk08OcTZTrEFlZ3UIvNaTW2Id /cmdEe9ATOOy8ytMt0SlIjyoKR9OuUNu3MHuSHqFX9P1F9xWh/+ldULUBYmCEPccGpEL DrACns2o8A4ofSZXMWR2kuOaC6LrOQ2bpsE0M6NnlWix5sPtMtuXmd7DcNUFVqyRmHEE idwdm41CTo6/Zc7XIVKesH8mbMOhE2Zn4P5PDi5ISFq/3JGQvDnOTiopDvOuOryulL+a KYKg== X-Gm-Message-State: AOAM531KU59Fq8AhWwumkoGz5gBapLYlb0EUhKLF+iSlKmN9/cQiY0AN YyaEwBbTrnw25DwXWSmYptO1NGq6RdoJxfUYfonkXQ== X-Google-Smtp-Source: ABdhPJy84Bpyo9gVnHDmhNZ0Cl7JJ5pAaUOhbP1nHyEJIJ3dMgwhwkaPgsD+FnKg2zDZj7i1oTdj2nlsRsGHJYRwQ7w= X-Received: by 2002:a63:f00d:: with SMTP id k13mr6286936pgh.263.1591302596138; Thu, 04 Jun 2020 13:29:56 -0700 (PDT) MIME-Version: 1.0 References: <20200603233203.1695403-1-keescook@chromium.org> <20200603233203.1695403-6-keescook@chromium.org> <202006041318.B0EA9059C7@keescook> In-Reply-To: <202006041318.B0EA9059C7@keescook> From: Nick Desaulniers Date: Thu, 4 Jun 2020 13:29:44 -0700 Message-ID: Subject: Re: [PATCH 05/10] ide: Remove uninitialized_var() usage To: Kees Cook Cc: LKML , Linus Torvalds , Miguel Ojeda , Alexander Potapenko , Joe Perches , Andy Whitcroft , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , drbd-dev@lists.linbit.com, linux-block@vger.kernel.org, b43-dev@lists.infradead.org, Network Development , linux-wireless , linux-ide@vger.kernel.org, linux-clk@vger.kernel.org, linux-spi@vger.kernel.org, Linux Memory Management List , clang-built-linux , Sebastian Andrzej Siewior , Saravana Kannan Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: EABB01814B0CC X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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 1:20 PM Kees Cook wrote: > > On Thu, Jun 04, 2020 at 12:29:17PM -0700, Nick Desaulniers wrote: > > On Wed, Jun 3, 2020 at 4:32 PM 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 a precursor > > > to removing[2] this[3] macro[4], just remove this variable since it was > > > actually unused: > > > > > > drivers/ide/ide-taskfile.c:232:34: warning: unused variable 'flags' [-Wunused-variable] > > > unsigned long uninitialized_var(flags); > > > ^ > > > > > > [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/ > > > > > > Signed-off-by: Kees Cook > > > > Reviewed-by: Nick Desaulniers > > Thanks for the reviews! > > > Fixes ce1e518190ea ("ide: don't disable interrupts during kmap_atomic()") > > I originally avoided adding Fixes tags because I didn't want these > changes backported into a -stable without -Wmaybe-uninitialized > disabled, but in these cases (variable removal), that actually does make > sense. Thanks! Saravana showed me a cool trick for quickly finding commits that removed a particular identifier that I find faster than `git blame` or vim-fugitive for the purpose of Fixes tags: $ git log -S I've added it to our wiki: https://github.com/ClangBuiltLinux/linux/wiki/Command-line-tips-and-tricks#for-finding-which-commit-may-have-removed-a-string-try. I should update the first tip; what was your suggestion for constraining the search to the current remote? -- Thanks, ~Nick Desaulniers