Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp75672ybr; Fri, 22 May 2020 01:09:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzX67AESFV7teEe63G3DBmFBhwniFdWcJOFRqH1OPL/bcJ85E21GzBibzfjBZQz08T+hnv7 X-Received: by 2002:a05:6402:177c:: with SMTP id da28mr1939859edb.378.1590134959076; Fri, 22 May 2020 01:09:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590134959; cv=none; d=google.com; s=arc-20160816; b=aasRL7izOfLuwg7/2sNZOdMqeS9emNKJ0UIvLJQfC6Azj8wtCtvMoGzOnJ79zbenTo 1dwk2rerFVaAdEGDfSXho5WWTIjkYLkNgMrzsOq/ts+37QSe6O/OHz/u0WyeL2NW9n3l XM41nm7XGpwqJ/eBIYJNPPT+zSgRYvfKe5TF0wfTJ9VaskYT1gSnsyMmyN51y78Yo40M ILwdgpJ9xgB7el1IXf5A1MbtNkhp4g/PENBWQrDT8RD6VCvDawUXU70F6HhBJbwMl788 PJXmhSQUI+c09hF9Vu6CM9zHZyGNAKrzCimqPJcbAUYYQcM1mrlks4Me8uPOeOFzMSrB uFMQ== 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=etVbOx25vgcGIjTgLx1al1CEQZNy2s/ReuwpgT7zNb4=; b=OD4zo0iBJXkuG3ATxEa7Zy8pNnSNWH50nzXDy4gAjq9E3ty51L3p3n8CpRYcyVrdlk aSMa1gw5I5L0z6vSaMr0V8m+brJWV1dcxJeQC0fAkPKZyTMZy4kLm6Fcr6KfhacwqqU+ wZFOd+uaEFJO9fKr6UgKKzCumiA1oGYvbfSoW4ONTF0s/qMq45UdrOM4D/L4RNj74POo NJxF0j/DIbOBPtdZv9e3OrKLCkP/llS2qtJsGRhwYOLgBN3/DFMT1Y/osf+eb9hVdwsn KVtPo15Imy5ILbqC472WWCKPkyHsebXcNm/ApoJfrmoL0b+4Ush9+zM5QlRAFHsHPVUi Iyjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qq25si4743361ejb.173.2020.05.22.01.08.55; Fri, 22 May 2020 01:09:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728816AbgEVIHY (ORCPT + 99 others); Fri, 22 May 2020 04:07:24 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:42336 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728152AbgEVIHW (ORCPT ); Fri, 22 May 2020 04:07:22 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 03A2323164A41ED81F03; Fri, 22 May 2020 16:07:20 +0800 (CST) Received: from [127.0.0.1] (10.166.213.93) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Fri, 22 May 2020 16:07:15 +0800 Subject: Re: arm64/acpi: NULL dereference reports from UBSAN at boot To: Will Deacon , CC: , , , References: <20200521100952.GA5360@willie-the-truck> From: Hanjun Guo Message-ID: Date: Fri, 22 May 2020 16:07:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200521100952.GA5360@willie-the-truck> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Originating-IP: [10.166.213.93] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Will, On 2020/5/21 18:09, Will Deacon wrote: > Hi folks, > > I just tried booting the arm64 for-kernelci branch under QEMU (version > 4.2.50 (v4.2.0-779-g4354edb6dcc7)) with UBSAN enabled, and I see a couple > of NULL pointer dereferences reported at boot. I think they're both GIC > related (log below). I don't see a panic with UBSAN disabled, so something's > fishy here. > > Please can you take a look when you get a chance? I haven't had time to see > if this is a regression or not, but I don't think it's particularly serious > as I have all sorts of horrible stuff enabled in my .config, since I'm > trying to chase down another bug: > > https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/plain/arch/arm64/configs/fuzzing.config?h=fuzzing/arm64-kernelci-20200519&id=c149cf6a51aa4f72d53fc681c6661094e93ef660 > > (on top of defconfig) > > CONFIG_FAIL_PAGE_ALLOC may be to blame. I enabled UBSAN and CONFIG_FAIL_PAGE_ALLOC on top of defconfig, testing against the for-kernelci branch on the D06 board, I can see some UBSAN warnings from megaraid_sas driver [0], but not from any other subsystem including ACPI, I will try all your configs above to see if I can get more warnings. Thanks Hanjun [0]: [ 18.244272] ================================================================================ [ 18.252673] UBSAN: array-index-out-of-bounds in drivers/scsi/megaraid/megaraid_sas_fp.c:104:32 [ 18.261244] index 1 is out of range for type 'MR_LD_SPAN_MAP [1]' [ 18.267313] CPU: 0 PID: 656 Comm: kworker/0:1 Not tainted 5.7.0-rc6-1-14703-gf4582661223d-dirty #20 [ 18.276314] Hardware name: Huawei TaiShan 2280 V2/BC82AMDC, BIOS 2280-V2 CS V3.B210.01 03/12/2020 [ 18.285151] Workqueue: events work_for_cpu_fn [ 18.289488] Call trace: [ 18.291925] dump_backtrace+0x0/0x248 [ 18.295572] show_stack+0x18/0x28 [ 18.298873] dump_stack+0xc0/0x10c [ 18.302261] ubsan_epilogue+0x10/0x58 [ 18.305905] __ubsan_handle_out_of_bounds+0x8c/0xa8 [ 18.310763] mr_update_load_balance_params+0x118/0x120 [ 18.315877] MR_ValidateMapInfo+0x300/0xb00 [ 18.320040] megasas_get_map_info+0x134/0x1f8 [ 18.324377] megasas_init_adapter_fusion+0xba8/0x10a0 [ 18.329403] megasas_probe_one+0x6e0/0x1b70 [ 18.333569] local_pci_probe+0x40/0xb0 [ 18.337299] work_for_cpu_fn+0x1c/0x30 [ 18.341031] process_one_work+0x1f8/0x378 [ 18.345022] worker_thread+0x21c/0x4c0 [ 18.348753] kthread+0x150/0x158 [ 18.351967] ret_from_fork+0x10/0x18 [ 18.355529] ================================================================================ [ 18.592274] ================================================================================ [ 18.600672] UBSAN: array-index-out-of-bounds in drivers/scsi/megaraid/megaraid_sas_fp.c:141:9 [ 18.609155] index 1 is out of range for type 'MR_LD_SPAN_MAP [1]' [ 18.615221] CPU: 0 PID: 656 Comm: kworker/0:1 Not tainted 5.7.0-rc6-1-14703-gf4582661223d-dirty #20 [ 18.624222] Hardware name: Huawei TaiShan 2280 V2/BC82AMDC, BIOS 2280-V2 CS V3.B210.01 03/12/2020 [ 18.633050] Workqueue: events work_for_cpu_fn [ 18.637387] Call trace: [ 18.639822] dump_backtrace+0x0/0x248 [ 18.643467] show_stack+0x18/0x28 [ 18.646767] dump_stack+0xc0/0x10c [ 18.650152] ubsan_epilogue+0x10/0x58 [ 18.653796] __ubsan_handle_out_of_bounds+0x8c/0xa8 [ 18.658652] MR_GetLDTgtId+0x58/0x60 [ 18.662211] megasas_sync_map_info+0xd0/0x1c0 [ 18.666547] megasas_init_adapter_fusion+0xd60/0x10a0 [ 18.671574] megasas_probe_one+0x6e0/0x1b70 [ 18.675736] local_pci_probe+0x40/0xb0 [ 18.679466] work_for_cpu_fn+0x1c/0x30 [ 18.683197] process_one_work+0x1f8/0x378 [ 18.687188] worker_thread+0x21c/0x4c0 [ 18.690920] kthread+0x150/0x158 [ 18.694123] ret_from_fork+0x10/0x18 [ 18.697683] ================================================================================