Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp958938pxb; Fri, 22 Jan 2021 03:45:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKZ0fPpibZZxcDHOvCink/Ejoa1laQssUZsePqQOwzR3OAUV8v75jH9c3yOv3nB89jQgiZ X-Received: by 2002:aa7:ccc6:: with SMTP id y6mr54043edt.226.1611315927605; Fri, 22 Jan 2021 03:45:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611315927; cv=none; d=google.com; s=arc-20160816; b=XwkTOtB3PwwmkMtJau65nwllAKicSZRvzozpo76GtBNxlMntlT/SemoEV/TogQfEfI ENnMVzlFMNvN6H1pSN5/69jSo6v4Pg/CK8QfRSD72qIsZUn1ic3Rp4L847Wr+SKcswTk 7xft8IUQ2gA8vTQbKKOpyWcuO/mqWFAEWLQdQv2hsTZB+2LX23z24yq9OwuRgy1osUSn FuGKoS8Lnw1x6bj40vbxsS2csuAnM6Onb8ppkT5gmmRHfeRpdOo4zilW9fcoALPhvrst 2y9bfn+Kr+hIGDW3ME5cdsWB3JMzbmNsnwTbO4vlipSDXo8q9ojBOD0Nb28/GSNof+HL e4Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=XXTrwKkVfZ1VdCqpuKJgGPj0Wqkg2wGVDM6uHYFnqyU=; b=NlljMZayPC/OD2XM7ICF+79TGNbKSWSzPeTjH2cHWyj8knp4zzX7RebEJi15gRZ/xY 2uuN0LDFARSBs2enwAg9r0GSa/LDX5Tgb7Ambq0MqU7/eNvroGdDqUaKxeIH2LEbYnsw BYXxlLVi7Rp3k+S9ubxXelN5MVxXOarW5uoCjlwOiI2rt6WiKQei2leOb7EiyLE0dipY 3dCD4PVlodUpwtmHyr6DaduqBGecYTBGKm1wyFJP3MHIACUQONuXLhRY0EGu1lP8G+Y4 rC7R1sgi9zcuHHzncTVyKkKwOWPMe/1W1oSWtIkCGcQXOTbI/F/AuNtI2R6PNIeQ3ccn bhag== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s23si2781473ejf.192.2021.01.22.03.45.03; Fri, 22 Jan 2021 03:45:27 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727650AbhAVLmu (ORCPT + 99 others); Fri, 22 Jan 2021 06:42:50 -0500 Received: from foss.arm.com ([217.140.110.172]:43122 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727534AbhAVLmn (ORCPT ); Fri, 22 Jan 2021 06:42:43 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 78A3711D4; Fri, 22 Jan 2021 03:41:57 -0800 (PST) Received: from [10.37.8.28] (unknown [10.37.8.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5D9553F719; Fri, 22 Jan 2021 03:41:55 -0800 (PST) Subject: Re: rcu-torture: Internal error: Oops: 96000006 To: Mark Rutland , "Paul E. McKenney" Cc: Will Deacon , 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 References: <20210121185521.GQ2743@paulmck-ThinkPad-P72> <20210121213110.GB23234@willie-the-truck> <20210121214314.GW2743@paulmck-ThinkPad-P72> <20210122095925.GA29124@C02TD0UTHF1T.local> From: Vincenzo Frascino Message-ID: <07a8f455-8414-979e-3e1a-cbc63357acb6@arm.com> Date: Fri, 22 Jan 2021 11:45:46 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210122095925.GA29124@C02TD0UTHF1T.local> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/22/21 10:02 AM, Mark Rutland wrote: > On Thu, Jan 21, 2021 at 01:43:14PM -0800, Paul E. McKenney wrote: >> 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! ;-) > > Hopefully, though we might need to check other architectures beyond > arm64, ppc, and x86, to be certain! > Which other architectures do you propose to verify? > Is there any other latent use of virt_addr_valid() that needs this > semantic? If so we'll probably want to backport the changes to arm64's > implementation, at least for v5.10. > > Vincenzo, would you mind taking a look? > I am happy to have a look at it, but due to previous commitments I will be able to get at it after -rc1. A quick grep shows that there are ~32 cases that might be affected by the same semantic in the common code (left out arch/ and drivers/). I will post the improvement for arm64 in the meantime though. > Thanks, > Mark. > -- Regards, Vincenzo