Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2619838ybi; Mon, 17 Jun 2019 07:50:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFpr2F3YUu7MSRyYpPjDncPGr5R/2pX60mIb/5zP8fUqn014MMbq5X5Z/XARA5OO/LQmBH X-Received: by 2002:a62:3741:: with SMTP id e62mr115321532pfa.213.1560783046265; Mon, 17 Jun 2019 07:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560783046; cv=none; d=google.com; s=arc-20160816; b=NwU4EIWcP8jlr5hBHTLBt87HV3GjAhHJno2xpaaz5nv2On2wYN1DheukrVAuPW3NTQ Gc73xy4pkG5S6wHduUcheiNZQky2q59gZVJNReY11v9rqYfkqI3j/KOiCtvWGAsiH2i+ Ktpm+a38IMlutxh39BbXamyOTPXiAlvlRrS2C8Ww/ZehQY1kqSMQFTzWrlw5/I3yE1T2 jNQiPhRqmO3F8fVPje6BH/hAi//G5pkgawBjG7p+TXtLeuJiKBC0n9sPZZP+595D/uvg yZzp0E3Xmktxl1ygi6vDpVFn7Yn+V+Bv0ivM0bRXwDU6b/pMQ990hRzuNDNmmOt2w7Gp qaLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version; bh=dEA3YnWQKVV/MWIa5Yuh0PUdlRXKRdfJtv3/Jm6bLAo=; b=KKLit7oaU0RqKX4J4WxSXzoVxSIEbU02oKo9pGFqTQBCAZSmpIaR+WvhKo8H19m7pN kOzAV9BD3kqO9/yeqWmxwLPtXf4KHkhBVOA8xwfRnj6cF+R85d15YWnUIawad+dy9k5T VpAUpeu4VNJ2q7ATkaT61xQO0rfSmmkJZNpVGJJhwJIhGNB+h27gtCWe1/1j5ZJIQ5rb 53KMM6q+dRFWhEVFHj7M3bYhDtAoELmkiI7JuXnoijsf2nKFWTeQ8jSlSLtxQ/dsvR1l WSqRlJzLMRatwh7zN2ih7hfuZ4sYmZ6Ywsvoge9rOjJUTRrut2nsEPmbnbIRq2AVN67V A8ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b26si11079333pgl.407.2019.06.17.07.50.30; Mon, 17 Jun 2019 07:50:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727997AbfFQOuU (ORCPT + 99 others); Mon, 17 Jun 2019 10:50:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:56084 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726065AbfFQOuT (ORCPT ); Mon, 17 Jun 2019 10:50:19 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6B7B3AEF1; Mon, 17 Jun 2019 14:50:18 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 17 Jun 2019 16:50:17 +0200 From: Roman Penyaev To: Arnd Bergmann Cc: Uladzislau Rezki , Roman Gushchin , Michal Hocko , Matthew Wilcox , Thomas Garnier , Oleksiy Avramchenko , Steven Rostedt , Joel Fernandes , Thomas Gleixner , Ingo Molnar , Tejun Heo , Andrew Morton , Linus Torvalds , Stephen Rothwell , Rick Edgecombe , Andrey Ryabinin , Mike Rapoport , Linux-MM , Linux Kernel Mailing List Subject: Re: [BUG]: mm/vmalloc: uninitialized variable access in pcpu_get_vm_areas In-Reply-To: References: <20190617121427.77565-1-arnd@arndb.de> <20190617141244.5x22nrylw7hodafp@pc636> Message-ID: X-Sender: rpenyaev@suse.de User-Agent: Roundcube Webmail Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-06-17 16:44, Arnd Bergmann wrote: > On Mon, Jun 17, 2019 at 4:12 PM Uladzislau Rezki > wrote: >> >> On Mon, Jun 17, 2019 at 02:14:11PM +0200, Arnd Bergmann wrote: >> > gcc points out some obviously broken code in linux-next >> > >> > mm/vmalloc.c: In function 'pcpu_get_vm_areas': >> > mm/vmalloc.c:991:4: error: 'lva' may be used uninitialized in this function [-Werror=maybe-uninitialized] >> > insert_vmap_area_augment(lva, &va->rb_node, >> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> > &free_vmap_area_root, &free_vmap_area_list); >> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> > mm/vmalloc.c:916:20: note: 'lva' was declared here >> > struct vmap_area *lva; >> > ^~~ >> > >> > Remove the obviously broken code. This is almost certainly >> > not the correct solution, but it's what I have applied locally >> > to get a clean build again. >> > >> > Please fix this properly. >> > > >> > >> Please do not apply this. It will just break everything. > > As I wrote in my description, this was purely meant as a bug > report, not a patch to be applied. That's a perfect way to attract attention! :) > >> As Roman pointed we can just set lva = NULL; in the beginning to make >> GCC happy. >> For some reason GCC decides that it can be used uninitialized, but >> that >> is not true. > > I got confused by the similarly named FL_FIT_TYPE/NE_FIT_TYPE Names are indeed very confusing, that is true. Very easy to mix up things. -- Roman