Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp554613pxb; Thu, 21 Jan 2021 13:47:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqSU/NlXi7DnAq9ucdLnppj56NUX1iSCRZK90GW+d1GDKU2gWaCRthQsuQlt5/2Vj2ebUT X-Received: by 2002:a05:6402:524a:: with SMTP id t10mr930968edd.270.1611265646871; Thu, 21 Jan 2021 13:47:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611265646; cv=none; d=google.com; s=arc-20160816; b=XPYy9uprRzwFiBOoaDI3TOsaEqFk+3ClOC4CgY1WZEoISzBUeY5bpxifT4Rr9V2PJY xlclGoYDp3lSYSJoBbUYJr6D9O/G0exjwQYGZ8zgOfyvB9baFfOsJylG9erZ9vbPOV78 S+2Txgy47f9dNrnQkW0dQqCa48umaPSae7MnmueISRrfVTJ1xNde21SeNKBW+z2D9ToO vOwAtyGUX/9kJHgejDYCCMzAtA9+s1qYxN3fWgzXguzne07n58R9iH3ecT4BpTejAwOT KBAvuYRxzF1pPjlGPh/3r3FWkpAHDLtrOzPa0yBep7ufe8vA5FUsNtvOUIP6+SmhwCht 8JVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=CqHbSWe2CWgFakolyCYikf6i17NMpgwLQuIT+AFzmw4=; b=zBjfW7yJBQ2drPAkaQIqZna4wB7gLI742ov1iszSIV7VBWPm3r60SwLC+FRhvwz0pm nZZOAGQ09KQSSr1rEGvMIHIE88SiVIIBi/hnVwGF2+q+3RoTMnZIgrbOUB9slRNDWp0s sdL2uH1139SBYBFdDGz+NunnIk1s+01wRjZqz6izP5a8s+M4xKrmhOew4+m7Tc8SxDLO f48vjxOApEZ37Yo6ulLUGXjCbvuNCoC5aFLDHQjCCqBooQhBXRbzyq9tN8JsUQSlAGBf AFXhnfMV6rtI1bmNbG3qhIpOkREtRckHLbErOHWzLqsDouABfoPJ7DQ10louy+LqhHsx WqIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=je6Vk1jj; 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 x9si2189292eje.398.2021.01.21.13.47.03; Thu, 21 Jan 2021 13:47:26 -0800 (PST) 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=k20201202 header.b=je6Vk1jj; 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 S1727483AbhAUVq0 (ORCPT + 99 others); Thu, 21 Jan 2021 16:46:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:40528 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727273AbhAUVoI (ORCPT ); Thu, 21 Jan 2021 16:44:08 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7507E23A54; Thu, 21 Jan 2021 21:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611265394; bh=qj3RrM+hGGEbQA50Mwahsi0VaXZuShqtsPO0Lx/8LwE=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=je6Vk1jj8Fnh78pX6xyhg1YoN+8oFceX96bVh0UxwrAVx8RYxb0l8yPf7dyQTOxgV X11Bk/O3tF3RmMvaQoEQ8ROGIdpkhOZCc4vRWf0zjCQqQL/e9rQ5bKrpPBkvrnQupU 7QklaabUw8fnF6kKU61Mhz92siKB12guuQzlCHYnPBjHVH7r2cZVGSdrwpo1zK3W5i zVe6/vcB0ihX0rL4EWcdMtCjEiSY2dca+QfjfyA/RQ/RY4+zgh6RL/PUHw0Sog96cI dpHUC7VfEW96+SjnX+Efwp2Ly0o+nW4dRcb77BQwdd8SJ0TCaFRFsEcEheGZ/peIHM DLcazNBbBgFDQ== Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 3F1AA35226D8; Thu, 21 Jan 2021 13:43:14 -0800 (PST) Date: Thu, 21 Jan 2021 13:43:14 -0800 From: "Paul E. McKenney" To: Will Deacon Cc: Naresh Kamboju , rcu@vger.kernel.org, open list , Linux-Next Mailing List , lkft-triage@lists.linaro.org, Peter Zijlstra , Steven Rostedt , Ingo Molnar , catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, vincenzo.frascino@arm.com, mark.rutland@arm.com Subject: Re: rcu-torture: Internal error: Oops: 96000006 Message-ID: <20210121214314.GW2743@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20210121185521.GQ2743@paulmck-ThinkPad-P72> <20210121213110.GB23234@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210121213110.GB23234@willie-the-truck> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 21, 2021 at 09:31:10PM +0000, Will Deacon wrote: > On Thu, Jan 21, 2021 at 10:55:21AM -0800, Paul E. McKenney wrote: > > On Thu, Jan 21, 2021 at 10:37:21PM +0530, Naresh Kamboju wrote: > > > While running rcu-torture test on qemu_arm64 and arm64 Juno-r2 device > > > the following kernel crash noticed. This started happening from Linux next > > > next-20210111 tag to next-20210121. > > > > > > metadata: > > > git branch: master > > > git repo: https://gitlab.com/Linaro/lkft/mirrors/next/linux-next > > > git describe: next-20210111 > > > kernel-config: https://builds.tuxbuild.com/1muTTn7AfqcWvH5x2Alxifn7EUH/config > > > > > > output log: > > > > > > [ 621.538050] mem_dump_obj() slab test: rcu_torture_stats = > > > ffff0000c0a3ac40, &rhp = ffff800012debe40, rhp = ffff0000c8cba000, &z > > > = ffff8000091ab8e0 > > > [ 621.546662] mem_dump_obj(ZERO_SIZE_PTR): > > > [ 621.546696] Unable to handle kernel NULL pointer dereference at > > > virtual address 0000000000000008 > > [...] > > > Huh. I am relying on virt_addr_valid() rejecting NULL pointers and > > things like ZERO_SIZE_PTR, which is defined as ((void *)16). It looks > > like your configuration rejects NULL as an invalid virtual address, > > but does not reject ZERO_SIZE_PTR. Is this the intent, given that you > > are not allowed to dereference a ZERO_SIZE_PTR? > > > > Adding the ARM64 guys on CC for their thoughts. > > Spooky timing, there was a thread _today_ about that: > > https://lore.kernel.org/r/ecbc7651-82c4-6518-d4a9-dbdbdf833b5b@arm.com Very good, then my workaround (shown below for Naresh's ease of testing) is only a short-term workaround. Yay! ;-) Thanx, Paul ------------------------------------------------------------------------ diff --git a/mm/slab_common.c b/mm/slab_common.c index cefa9ae..a8375d1 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -550,7 +550,8 @@ bool kmem_valid_obj(void *object) { struct page *page; - if (!virt_addr_valid(object)) + /* Some arches consider ZERO_SIZE_PTR to be a valid address. */ + if (object < (void *)PAGE_SIZE || !virt_addr_valid(object)) return false; page = virt_to_head_page(object); return PageSlab(page);