Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp260694ybg; Mon, 1 Jun 2020 00:09:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqaK/xPMtnYvKBztx2RjlhGUlNd5aonRoN16d2wTNdU8Vp5UQFVoaa/VxBlYrz3LvPKRKo X-Received: by 2002:a17:906:6a1b:: with SMTP id o27mr18096238ejr.271.1590995362213; Mon, 01 Jun 2020 00:09:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590995362; cv=none; d=google.com; s=arc-20160816; b=VTt0qCC5Es0QfbKfH5VnraVGG+ZiTrrMq6L8JENoF6whQMOLOXpdeHx4L+H2195/d2 mK+00TmhE02bZxETn9AsdhBOxGWZHVU5OuP6oiv6jmUGQVqLs4/dtNZcR36ItQ/F/G4G PBanqIl2/FvLadJmb4W0/dvdpTioSAmR9zEu880XcToq5snykNPZXZCOcnw9zofCameO FrSj7pC2uilg2UnUEbxkXG8tr51TStsONuP+7QsT8/I4y8HzqZ366aDPKPPv5NEH5GB+ 334Whb/s34VmS2V6fDyMB8ld+ahM515gosGxb0tD+u6+8M8YPIM99VaL3l/WtadV6gqQ GIww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=kS74LJJQBUfhIMAtt3U4mG6YuTLUccjF9By6Sl4vpUo=; b=R8jlu0V86FjjJCQxjHtzGEWr5PmW/6khhGQoMKTyvvh+dik/tvNDx6aCb6YaQT2iMW XQ6tKNE8iTSogj5TbY/EgpD9Xf9lOi7k7M8iVTUuspn4BoF8B4cgDf8d2l2y70wzfBZ5 EPPvt9UAz+XIAS9wTy0uVT3Y2EZjGt9a9Os/Wc4FFuBmn6wcW4ZwiDGU425cWjpu9eFU vV2TfYrRQT8u7k7KdEu0TWy1pZDPjwTttGUK7xqJKfGgrOfwLTwoltFvtDO6R5mLOUjY JWFZOOQz8W9ojcVVs3qN0ExUOnesO2alcwpi8Xdmg4RU+s2is0XEloE5vvThmEuh/ewb JQUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DIyZxKIp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k4si10861273edi.24.2020.06.01.00.08.59; Mon, 01 Jun 2020 00:09:22 -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; dkim=pass header.i=@kernel.org header.s=default header.b=DIyZxKIp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727863AbgFAHFF (ORCPT + 99 others); Mon, 1 Jun 2020 03:05:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:53986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725283AbgFAHFF (ORCPT ); Mon, 1 Jun 2020 03:05:05 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0CF902074B; Mon, 1 Jun 2020 07:05:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590995104; bh=B3QD6jug+ogOzxUlyPb4F6UTjlIKD4f4RQZhFem4HJQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DIyZxKIpBbX7KMO6KiPQO8iHUlmr2rCiXeSPsi/nsD/csVbFUjQ511WD0pco/4587 4sxuBII1LQxSbg7P7vjRRQTfbTTV7rGT4RWxO6CPi6Jsn8WiSZ0wC+Qvf6/sERpgRJ 4NTHny9OIWYq+pWEtJihbcpITPmOXeAVlOC4FgxA= Date: Mon, 1 Jun 2020 08:05:00 +0100 From: Will Deacon To: Lorenzo Pieralisi Cc: guohanjun@huawei.com, rjw@rjwysocki.net, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, ndesaulniers@google.com Subject: Re: arm64/acpi: NULL dereference reports from UBSAN at boot Message-ID: <20200601070459.GB8601@willie-the-truck> References: <20200521100952.GA5360@willie-the-truck> <20200521173738.GA29590@e121166-lin.cambridge.arm.com> <20200526202157.GE2206@willie-the-truck> <20200527134104.GA16115@e121166-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200527134104.GA16115@e121166-lin.cambridge.arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 27, 2020 at 02:41:04PM +0100, Lorenzo Pieralisi wrote: > On Tue, May 26, 2020 at 09:21:57PM +0100, Will Deacon wrote: > > Hi Lorenzo, Hanjun, [+Nick] > > > > On Thu, May 21, 2020 at 06:37:38PM +0100, Lorenzo Pieralisi wrote: > > > On Thu, May 21, 2020 at 11:09:53AM +0100, 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. > > > > > > May I ask you the QEMU command line please - just to make sure I can > > > replicate it. > > > > As it turns out, I'm only able to reproduce this when building with Clang, > > but I don't know whether that's because GCC is missing something of Clang > > is signalling a false positive. You also don't need all of those whacky > > fuzzing options enabled. > > > > Anyway, to reproduce: > > > > $ git checkout for-next/kernelci > > $ make ARCH=arm64 CC=clang CROSS_COMPILE=aarch64-linux-gnu- defconfig > > > > $ make ARCH=arm64 CC=clang CROSS_COMPILE=aarch64-linux-gnu- Image > > > > I throw that at QEMU using: > > > > qemu-system-aarch64 -M virt -machine virtualization=true \ > > -machine virt,gic-version=3 \ > > -cpu max,sve=off -smp 2 -m 4096 \ > > -drive if=pflash,format=raw,file=efi.img,readonly \ > > -drive if=pflash,format=raw,file=varstore.img \ > > -drive if=virtio,format=raw,file=disk.img \ > > -device virtio-scsi-pci,id=scsi0 \ > > -device virtio-rng-pci \ > > -device virtio-net-pci,netdev=net0 \ > > -netdev user,id=net0,hostfwd=tcp::8222-:22 \ > > -nographic \ > > -kernel ~/work/linux/arch/arm64/boot/Image \ > > -append "earlycon root=/dev/vda2" > > > > I built QEMU a while ago according to: > > > > https://mirrors.edge.kernel.org/pub/linux/kernel/people/will/docs/qemu/qemu-arm64-howto.html > > > > and its version 4.2.50 (v4.2.0-779-g4354edb6dcc7). > > > > My clang is version 11.0.1. > > Thanks a lot Will. > > I *think* I was right - it is the ACPI_OFFSET() macro: > > #define ACPI_OFFSET(d, f) ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) 0) > > that triggers the warnings (I suspected it because at least in one of > the warnings I could not see any dereference of any dynamically > allocated data). Cheers, Lorenzo. > Now on what to do with it - thoughts welcome. Nick -- any idea what to do about the above? The '#define' pasted by Lorenzo is causing a couple of spurious UBSAN splats when compiling with clang 11. Cheers, Will