From patchwork Mon Jun 17 12:14:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 166999 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2787686ilk; Mon, 17 Jun 2019 05:16:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpA4Tb3McciTJqjDD8B1Difz3wfviNfo1FJ9GqVYuVA1mK2LFstyVbjpmYsVhoNgYoIZMA X-Received: by 2002:aa7:9197:: with SMTP id x23mr78261195pfa.161.1560773787343; Mon, 17 Jun 2019 05:16:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560773787; cv=none; d=google.com; s=arc-20160816; b=Hb00rWykd//1dErfe2ZgNjPrpH5wHkuEbyWV05RniMAbrTs7RS5aDgxzL+eznH/QPN i1bBghZ74rwaF6Gr/37ftLlUEXP3fTRmAsOKDzsf0a8yiZ+vziVYsM13FBBmsHDq1aEV l2jpO2rQ23iHrK9Po9ZRNdG3lYiadbCETYJIOL54T1Z478VEsx3Hzxun//oZkfzCMfEb +nU6y0uFTKwGekwAaWOtbuUx9Y9e1/iCIHiMK2tyxupQ3QvbZcvNA+LGTEAYRds9M4yO q6IPFT4v5G0KQVFqyMxwIGuZM/Xl2s0bT17g/so2I7HI34v1fzHvNr/O0fyRopznC6A7 38jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from; bh=4uTICVvnlaEhduUXZZHHwDtP16h4L4Jee+k86bD4ipc=; b=KoOAAt5W3rSGVx8/9m0wz4fyODppsiaNZ5NsWSH7+CZo0c38meINqhGbjVdxP50dPV E+KABKUbl3Uxj6z+DoiH1JwoW1X9A20YTNQNL0S6O6+QpniIHVnl1f/OqDSLpfEGUIKl 97n80y3kuH3zLx45tQfIohOdiFubu5wUAIfgdyiTKWPpuwTYSSQEuV9rhiKN1o7qIt0o U6pRvB4UVkC0qm4r0tsD/u1yCwkIncU3TzRn93Zc/TlZavjhEPZ4almInwS/SoSjijVS rG+e6cFQ1IC095cXptcM3JT+i12EfzE6+B4OYQ/QIqFcjWRPtmu/u69iF435FsDRJNXp nj4w== 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 l1si10931696pld.110.2019.06.17.05.16.27; Mon, 17 Jun 2019 05:16:27 -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 S1727268AbfFQMQZ (ORCPT + 26 others); Mon, 17 Jun 2019 08:16:25 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:39229 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725906AbfFQMQZ (ORCPT ); Mon, 17 Jun 2019 08:16:25 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.145]) with ESMTPA (Nemesis) id 1Mn1iT-1iIoa32p7v-00kBBk; Mon, 17 Jun 2019 14:14:44 +0200 From: Arnd Bergmann Cc: Arnd Bergmann , "Uladzislau Rezki (Sony)" , 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 , Roman Penyaev , Rick Edgecombe , Andrey Ryabinin , Mike Rapoport , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [BUG]: mm/vmalloc: uninitialized variable access in pcpu_get_vm_areas Date: Mon, 17 Jun 2019 14:14:11 +0200 Message-Id: <20190617121427.77565-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:tTeqNGd4TVlIml5CMtu2lMEK72C2cmu0L9gWMplwst9AdyblEhs /0GtS05lmzrqMN+S4zaQlZdDFpVtXvZDzOGUU/lEIyDDojFmYV7qBw5N800RdJ/exviAEh2 bwxyVHQcntNpqtK3OsDbSbxrB1vvLAa9d/sppldXDeuvrcB81qPmTI0bBovbNv4DbdqOhX6 /VeAekZToBibxtpGIUakg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:5xtYdggVb/A=://lSt3xAZ83zGcKRhCe14J +CuhOHiyn4wqvnJJkAfHxsJmn+sIb1JQ3abjypPEJGTzZsew1dIaDOszL54oqYOAEshi+eDRm jymPkZpcYMppwZfoCDckrWlK8/RidzMkTcUxoYKzRNI9FD0exgdoqu/wOqS9JkfqT8NBTTJun zsoeoK/LJptEQ43ByItpeW6hzvg5BHJLz+jGFu6SsEvw5kA93RvdMrJgLvsiwBfCLz2itlfkX Aqu/MAwQ1nHA69Ga0qIr2VDHUsEMf1sw3RUoEaAe/SkpTY65dnhsIOzccSyOtXafgEPT/PVVN ReseF9Rs8yM2MqTNwJ8Qec/4EQ8ikeiME+An4TXwic7SCmsfgKiNspk5eaYWLGD5Hprgu5dC7 OgsfkSqwXf0M1d9kbS0t8R22rQg6q+vYChxvYspng5AjkdAjhQPfHGlelY3sqSfaipWuh/0K+ pRuPrQK2vez1y+1cOGcsuI0LWa5/dwqUkl9cCq29nn9dxTkQzhimFk1OoAqTEZ5Li88iOIjT/ cIbXwWiEDsCd44CPzNXFWTXjmmvfs53T8GUPir6iK0L+n029eFmS9Y9q8cDVeSEZQoWItCVyO ybQPzt+Hv79ihJrzbAh2tOsZ2DHcKazrYMi3AdajY2sJhlONFxC75LkJ62KG0q5/telLrRmXn iXGN3AFE7THZt6qIYKmqNawGoswPSgpVfOD953kict+xZH3R5l8IJic3d4nZYPkYQn3nO0BEq 4DlevSOlSCpFdd4yNVTiLK0lyMukQ3MuK8UxaA== To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Fixes: 68ad4a330433 ("mm/vmalloc.c: keep track of free blocks for vmap allocation") Signed-off-by: Arnd Bergmann --- mm/vmalloc.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) -- 2.20.0 diff --git a/mm/vmalloc.c b/mm/vmalloc.c index a9213fc3802d..bfcf0124a773 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -984,14 +984,9 @@ adjust_va_to_fit_type(struct vmap_area *va, return -1; } - if (type != FL_FIT_TYPE) { + if (type == FL_FIT_TYPE) augment_tree_propagate_from(va); - if (type == NE_FIT_TYPE) - insert_vmap_area_augment(lva, &va->rb_node, - &free_vmap_area_root, &free_vmap_area_list); - } - return 0; }