Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4802820ybp; Mon, 14 Oct 2019 10:14:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1OIn+1jwy5iYAaPdl5yEE0pbBnwq9Suxsh/Uh9/QQMJdspcnuncpg5T603ky1krPOVhgy X-Received: by 2002:a17:906:2c5b:: with SMTP id f27mr28989627ejh.239.1571073262886; Mon, 14 Oct 2019 10:14:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571073262; cv=none; d=google.com; s=arc-20160816; b=UVUlG15/vqgJ7T4iRYjVJUtkB5oiMrKnTpIdJRw9uQB91xdmKJ9J+PRVEcLzROUs/Y XX0MaUGnrv/z5m1YxJjxxvCrcWnJRCGpqXf4DRjgPx7q22529V8JLBTbrMJubAJwYwDx D/6Wh5IVfnzKwPQziOapdSpLfkud3PLeco639mFfaSMyfZBApZp76IVORsE6jBlrAzVk TaUegl2PCmdk0ETmJRG90o46VHRI5XI7BcfylMkuqPxf7Xtu9Y8VarMleR6Jif4wLdsd w90r/m6E89LWPOytzWxCQFBfm+nrtIt48QD89ncfi1MLkt/muGzxfHCn4/JwU7WShMYG eg9w== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=NbgrPII5KZ1MD3e13wBqv9UZ2ZF2xoBjbIEUKismQ70=; b=BWqPI9b3omr7gkNszpOMlivS9HI0TvHJ8wyKzYnj8U/8rxVLi6xl7otR6zxfn9mSF8 FQ7oftoQs+d3hgoIvwHJp+1+GEFp2bqfddH//fxU9n4eCVUkG9cE0/sUCQWwrF8a1IzG 3t47mbrKSEM4M7jgeqnJgTMF+0CZbjhlLfxOQ6z32iomKBNDeHQBMx3KAGb0Uymq0TDk 4KaggIHWmT4AHlrTio+0PBElfKB838mX6KBsEfCfPAooJpsjiEoq3rpYT02UZZbiksc+ ucDW3XFLMF0A76YzsSFCxvaa+isOplnVKbfg3coAW8IAJHOXzU/omCkadvQhxhdnYpPh Yh/A== 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 g20si14860589edb.149.2019.10.14.10.13.58; Mon, 14 Oct 2019 10:14:22 -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 S2388074AbfJNQ4O (ORCPT + 99 others); Mon, 14 Oct 2019 12:56:14 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:33738 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727083AbfJNQ4O (ORCPT ); Mon, 14 Oct 2019 12:56:14 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 4872ABD9755E61BFA34D; Tue, 15 Oct 2019 00:56:12 +0800 (CST) Received: from [127.0.0.1] (10.202.227.179) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.439.0; Tue, 15 Oct 2019 00:56:07 +0800 Subject: Re: edac KASAN warning in experimental arm64 allmodconfig boot To: James Morse References: <304df85b-8b56-b77e-1a11-aa23769f2e7c@huawei.com> CC: Borislav Petkov , Mauro Carvalho Chehab , , Robert Richter , , "linux-kernel@vger.kernel.org" From: John Garry Message-ID: Date: Mon, 14 Oct 2019 17:56:02 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.179] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/10/2019 17:15, James Morse wrote: > Hi John, > Hi James, > On 14/10/2019 16:18, John Garry wrote: >> I'm experimenting by trying to boot an allmodconfig arm64 kernel, as mentioned here: > > Crumbs! > > >> One thing that I noticed - it's hard to miss actually - is the amount of complaining from >> KASAN about the EDAC/ghes code. Maybe this is something I should not care about/red >> herring, or maybe something genuine. Let me know what you think. > > Hmmm, I thought I tested this recently... > >> Log snippet (I cut off after the first KASAN warning): >> >> [ 70.471011][ T1] random: get_random_u32 called from new_slab+0x360/0x698 with >> crng_init=0 > >> [ 70.478671][ T1] [Firmware Bug]: APEI: Invalid bit width + offset in GAR >> [0x94110034/64/0/3/0] > > (this one's for you right?) Yeah, I'll report it. It might be already fixed. > >> [ 70.700412][ T1] ------------[ cut here ]------------ > >> [ 70.802080][ T1] Call trace: >> [ 70.802093][ T1] debug_print_object+0xec/0x130 >> [ 70.802106][ T1] __debug_check_no_obj_freed+0x114/0x290 >> [ 70.802119][ T1] debug_check_no_obj_freed+0x18/0x28 >> [ 70.802130][ T1] slab_free_freelist_hook+0x18c/0x228 >> [ 70.802140][ T1] kfree+0x264/0x420 >> [ 70.802157][ T1] _edac_mc_free+0x6c/0x210 >> [ 70.814163][ T1] edac_mc_free+0x68/0x88 >> [ 70.814177][ T1] ghes_edac_unregister+0x44/0x70 >> [ 70.814193][ T1] ghes_remove+0x274/0x2a0 > > Ugh. This must be the test driver remove thing. Yeah, the probe, remove, probe again flow from CONFIG_DEBUG_TEST_DRIVER_REMOVE. > > I've reproduced this, but had to remove the parent GHES twice. It looks like it tries to > use the first ghes_edac global variables when freeing the second. ghes_init prevents it > from re-allocating over the top. > > The below diff fixes it for me. And for me by the looks of it. That's with CONFIG_DEBUG_KOBJECT_RELEASE now unset, but I expect the same with it set. (I'll post it as a proper patch once I've done the > archaeology) > > -----------%<----------- > diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c > index d413a0bdc9ad..955b59b6aade 100644 > --- a/drivers/edac/ghes_edac.c > +++ b/drivers/edac/ghes_edac.c > @@ -554,6 +554,7 @@ void ghes_edac_unregister(struct ghes *ghes) > return; > > mci = ghes_pvt->mci; > + ghes_pvt = NULL; > edac_mc_del_mc(mci->pdev); > edac_mc_free(mci); > } > > -----------%<----------- > Thanks, John BTW, I am not sure if my response to Boris was rejected due to attachments, as but it is here: https://lore.kernel.org/linux-edac/dc974549-6ea4-899d-7f3a-b2fcfafe1528@arm.com/T/#ma0e122ca0eda9d80e869af179352f75037146d3c > > Thanks! > > James > > . >