Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3272615imu; Fri, 18 Jan 2019 07:39:33 -0800 (PST) X-Google-Smtp-Source: ALg8bN6h3rAAJ2oyxwvAyURa0dasYsAKt3tlQrs4K5dPu0OuRLLyHC/o7hMYcb6MgKGFn9nRLCRb X-Received: by 2002:a62:7dcb:: with SMTP id y194mr19962821pfc.113.1547825973015; Fri, 18 Jan 2019 07:39:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547825972; cv=none; d=google.com; s=arc-20160816; b=nawiRiimEFSKacTmp+9LIIe29d0Wl8Vym16hjNb+bwLX8LpreHiFRC7AxhqlMxfx1S 1maqzR/OHPiI3xdI2t6WsQpiA+g2YmCDrjMGdh5Jbsx3Go2dl9jGRBvXYGCXRXqid0gu CHu75ujb3zkPG2K1UEcOwet0y3zjW8/cbKcbRrxPdVDe53xwTZivQ6cVMC9JfO2pfMuG uvXbsTjIkZehdccmGb0vkO7y5j99rHKQKNGU46pU843ooBsoOsZJqdjuju45jVRYVTnW 91WFXUUE5KgO4WqNAm7TsM3R4wgKz6ac3TgjYWNyktFwvqE9FangyC6Xiea+ztJwcoiX cYcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Ep8W8B8Egj+la+9PFPfNj+8y9HjrfbKX6WxwyMgIJAs=; b=JO6BT6PU326n97xVdzwhsBL+J45wTA3c4/poMwbvStQCJhvlN0eZhyGkwNuDvXMbyi Ez7oj35HPNsT2zX8xtY/HpZR1pdVjzSpq9AKS4cGB6f4QQiOoIjqvyN4HSj4ZqelDHSj 0jylzgY/eUZBruFhCrmCt7WQN5+O0pJWTL5bsK6aFKUWbZZi4wte0hIRyiQlu9/2kkeL apKmnKkMXf/aq2wRRdoKrWHvp+wNiD2JelAQbRYgXW9RUFdOqNTRVtX1Kox5QylNZ18A s9Xx8ATb6KqFK4HiVaAl49aIK6wH3ZMMtY2FbiBYCtKtaw4kfeJM6llJr2nupzfxAgW/ cCow== 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 o68si5603056pfo.140.2019.01.18.07.39.16; Fri, 18 Jan 2019 07:39:32 -0800 (PST) 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 S1727910AbfARPhc (ORCPT + 99 others); Fri, 18 Jan 2019 10:37:32 -0500 Received: from smtp3-g21.free.fr ([212.27.42.3]:54644 "EHLO smtp3-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727542AbfARPhb (ORCPT ); Fri, 18 Jan 2019 10:37:31 -0500 Received: from [192.168.108.68] (unknown [213.36.7.13]) (Authenticated sender: marc.w.gonzalez) by smtp3-g21.free.fr (Postfix) with ESMTPSA id F40E113F8D5; Fri, 18 Jan 2019 16:36:59 +0100 (CET) Subject: Re: kmemleak panic To: Catalin Marinas Cc: Robin Murphy , Mark Rutland , Arnd Bergmann , Ard Biesheuvel , Oscar Salvador , Wei Yang , Michal Hocko , Andrew Morton , Linus Torvalds , Sri Krishna chowdary , Qian Cai , LKML References: <20190118143434.GE118707@arrakis.emea.arm.com> From: Marc Gonzalez Message-ID: Date: Fri, 18 Jan 2019 16:36:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190118143434.GE118707@arrakis.emea.arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/01/2019 15:34, Catalin Marinas wrote: > On Fri, Jan 18, 2019 at 02:36:46PM +0100, Marc Gonzalez wrote: > >> Trying to diagnose a separate issue, I enabled a raft of debugging options, >> including kmemleak. However, it looks like kmemleak itself is crashing? >> >> We seem to be crashing on this code: >> >> kasan_disable_current(); >> pointer = *ptr; >> kasan_enable_current(); > > There was another regression reported recently: > > http://lkml.kernel.org/r/51e79597-21ef-3073-9036-cfc33291f395@lca.pw > > See if reverting commit 9f1eb38e0e113 (mm, kmemleak: little optimization while > scanning) fixes it. > [Drop LAKML, add LKML, add recipients] Bug is easy to reproduce: boot mount -t debugfs nodev /sys/kernel/debug/ echo scan > /sys/kernel/debug/kmemleak Unable to handle kernel paging request at virtual address ffffffc021e00000 Mem abort info: ESR = 0x96000006 Exception class = DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 Data abort info: ISV = 0, ISS = 0x00000006 CM = 0, WnR = 0 swapper pgtable: 4k pages, 39-bit VAs, pgdp = (____ptrval____) [ffffffc021e00000] pgd=000000017e3ba803, pud=000000017e3ba803, pmd=0000000000000000 Internal error: Oops: 96000006 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 635 Comm: exe Not tainted 5.0.0-rc1 #16 Hardware name: Qualcomm Technologies, Inc. MSM8998 v1 MTP (DT) pstate: 80000085 (Nzcv daIf -PAN -UAO) pc : scan_block+0x70/0x190 lr : scan_block+0x6c/0x190 sp : ffffff80133b3b20 x29: ffffff80133b3b20 x28: ffffffc0fdbaf018 x27: ffffffc022000000 x26: 0000000000000080 x25: ffffff80118bdf70 x24: ffffffc0f8cc8000 x23: ffffff8010bd8000 x22: ffffff8010bd8830 x21: ffffffc021e00ff9 x20: ffffffc0f8cc8050 x19: ffffffc021e00000 x18: 00000000000025fd x17: 0000000000000200 x16: 0000000000000000 x15: ffffff8010c24dd8 x14: 00000000000025f9 x13: 00000000445b0e6c x12: ffffffc0f5a96658 x11: 0000000000000001 x10: ffffff8010bae688 x9 : ffffff8010baf000 x8 : ffffff8010bae688 x7 : 0000000000000003 x6 : 0000000000000000 x5 : ffffff801133ad60 x4 : 0000000000002878 x3 : ffffff8010c24d88 x2 : 7c512d102eca1300 x1 : ffffffc0f5a81b00 x0 : 0000000000000000 Process exe (pid: 635, stack limit = 0x(____ptrval____)) Call trace: scan_block+0x70/0x190 scan_gray_list+0x108/0x1c0 kmemleak_scan+0x33c/0x7c0 kmemleak_write+0x410/0x4b0 full_proxy_write+0x68/0xa0 __vfs_write+0x60/0x190 vfs_write+0xac/0x1a0 ksys_write+0x6c/0xe0 __arm64_sys_write+0x24/0x30 el0_svc_handler+0xc0/0x160 el0_svc+0x8/0xc Code: f9000fb4 d503201f 97ffffd2 35000580 (f9400260) ---[ end trace 8797ac2fea89abd6 ]--- note: exe[635] exited with preempt_count 2 Reverting 9f1eb38e0e1131e75cc4ac684391b25d70282589 does not help: Unable to handle kernel paging request at virtual address ffffffc021e00000 Mem abort info: ESR = 0x96000006 Exception class = DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 Data abort info: ISV = 0, ISS = 0x00000006 CM = 0, WnR = 0 swapper pgtable: 4k pages, 39-bit VAs, pgdp = (____ptrval____) [ffffffc021e00000] pgd=000000017e3ba803, pud=000000017e3ba803, pmd=0000000000000000 Internal error: Oops: 96000006 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 636 Comm: exe Not tainted 5.0.0-rc1 #18 Hardware name: Qualcomm Technologies, Inc. MSM8998 v1 MTP (DT) pstate: 80000085 (Nzcv daIf -PAN -UAO) pc : scan_block+0x70/0x190 lr : scan_block+0x6c/0x190 sp : ffffff8013303b20 x29: ffffff8013303b20 x28: ffffffc0fdbaf018 x27: ffffffc022000000 x26: 0000000000000080 x25: ffffff80118bdf70 x24: ffffffc0f8cc8000 x23: ffffff8010bd8000 x22: ffffff8010bd8830 x21: ffffffc021e00ff9 x20: ffffffc0f8cc8050 x19: ffffffc021e00000 x18: 0000000000002704 x17: 0000000000000200 x16: 0000000000000000 x15: ffffff8010c24dd8 x14: 0000000000002700 x13: 0000000068ed2dfa x12: ffffffc0f5a39a58 x11: 0000000000000001 x10: ffffff8010bae688 x9 : ffffff8010baf000 x8 : ffffff8010bae688 x7 : 0000000000000003 x6 : 0000000000000000 x5 : ffffff80113223a0 x4 : 00000000000029c8 x3 : ffffff8010c24d88 x2 : 7c512d102eca1300 x1 : ffffffc0f59f9200 x0 : 0000000000000000 Process exe (pid: 636, stack limit = 0x(____ptrval____)) Call trace: scan_block+0x70/0x190 scan_gray_list+0x108/0x1c0 kmemleak_scan+0x338/0x7c0 kmemleak_write+0x410/0x4b0 full_proxy_write+0x68/0xa0 __vfs_write+0x60/0x190 vfs_write+0xac/0x1a0 ksys_write+0x6c/0xe0 __arm64_sys_write+0x24/0x30 el0_svc_handler+0xc0/0x160 el0_svc+0x8/0xc Code: f9000fb4 d503201f 97ffffd2 35000580 (f9400260) ---[ end trace 65933b4754c5cee7 ]--- note: exe[636] exited with preempt_count 2 Regards.