Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4548572ybl; Mon, 26 Aug 2019 12:04:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMDrt65oavi1uDlfN1buD2c5azUm6PB96KdoJ0K+IvlSbMoJWwTpkx5hJKmpr6cfbMwfqk X-Received: by 2002:a65:6256:: with SMTP id q22mr17890793pgv.408.1566846277095; Mon, 26 Aug 2019 12:04:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566846277; cv=none; d=google.com; s=arc-20160816; b=mpdPu4Vqskv/mk0mQmHJBLFUieqZ41qQ7Ot5bLK8I9nofX3L+RHDvVjw30t3MZd2+K 3aBvUPzymaXX+jBf6p5tFPbc/yQkgSi8v3Weai1Z3Dp1rKDeUcLv2N7RfIjF5awD1jrt E6ppRuaCdpmVQQHrFzMDSYv2pmXc+wjsKR7eYEURlh4rNP3wFN/+/xNgIsaHaRQI5aLy bVmhV8jbpe62aoEHMpeyOQ93Ydb98sERDTEmuw9JJKJADSqfirVQAWsLNASqEOkA7zXe bPMZ1cxPzxyWkY5pTwLt41f2FPYdAkTHnpmOznExlsr7rGTfh8bbjAy/VB8O3hwi2kUd SgOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=SGzNXU9OUMJ4sxgAgwF2vBiAW3WFDK29f9kkvuUtX/U=; b=BcArDVEBKAlAzs2s2m2cI98HyTtdRBKnBWeKcIZOZL9mxYXR0jURxr90MNBLTk8wDz bj4K7M8QV831Uoc3yIDAvQr3IBpVrrcRnt1mG6Kbh1Xe6R+0YnVL88oLXWy/sTZIgNA3 635XujhBttyMD5WEJBXW3b52Rtpq4FHn+wtLybiGRljiHfr5lpkp3XsHm6iStZVE9JJQ Wodbu90cbqDEoUoDdRTuhaV3Gmft6OPIPrs1csLzYkTR7AbhW6qQWSAQYtjaPWQhFqvA eiJ4ilC1rFkxMt+fx3ljNDmysW/UcgVhA9q+OHEhmIQDGA5boKWH4e97q4DpOJrAK836 jf+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=iRJskzvc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v184si11188247pfc.90.2019.08.26.12.04.21; Mon, 26 Aug 2019 12:04:37 -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; dkim=pass header.i=@nvidia.com header.s=n1 header.b=iRJskzvc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387797AbfHZSVy (ORCPT + 99 others); Mon, 26 Aug 2019 14:21:54 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:14863 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733311AbfHZSVy (ORCPT ); Mon, 26 Aug 2019 14:21:54 -0400 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 26 Aug 2019 11:21:55 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Mon, 26 Aug 2019 11:21:53 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Mon, 26 Aug 2019 11:21:53 -0700 Received: from rcampbell-dev.nvidia.com (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 26 Aug 2019 18:21:49 +0000 Subject: Re: [PATCH 1/2] mm/hmm: hmm_range_fault() NULL pointer bug To: Jason Gunthorpe CC: Christoph Hellwig , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "nouveau@lists.freedesktop.org" , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Andrew Morton References: <20190823221753.2514-1-rcampbell@nvidia.com> <20190823221753.2514-2-rcampbell@nvidia.com> <20190824223754.GA21891@lst.de> <20190826180937.GI27031@mellanox.com> From: Ralph Campbell X-Nvconfidentiality: public Message-ID: <9351886a-34b4-4d6f-95b0-d25007a38e61@nvidia.com> Date: Mon, 26 Aug 2019 11:21:49 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190826180937.GI27031@mellanox.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1566843715; bh=SGzNXU9OUMJ4sxgAgwF2vBiAW3WFDK29f9kkvuUtX/U=; h=X-PGP-Universal:Subject:To:CC:References:From:X-Nvconfidentiality: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=iRJskzvc2xmRxSFweduukFPXuLO46IayfypAROJ04qHuHouqTkdxRWJBjEvfWz26t nH11/K1bIcpCtfQ3PCzTwQ7OjiV89AbFCKVp2GG/u7oavfNQjSfTIN9Ay9sY6QisRX Lw8C5CzNnDbqQDuqVHy8esNTkALJED132k9sS3BGQHah1iO+M08Lear0RteTgH3Plb +ypJuyFZ7wu0/IIAGodcN57KhvsrhSSHhMSpq1VtFDlL1oWxG7Yp0WVpo+rUHAmyWi mHRx0pP0zK6O9mcrC5LbmewxrhxFYmw5xcF/RjJ6Svoenp5d4wFxOGfjSn8PYeN7b2 yZgNdr/Pbptmw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/26/19 11:09 AM, Jason Gunthorpe wrote: > On Mon, Aug 26, 2019 at 11:02:12AM -0700, Ralph Campbell wrote: >> >> On 8/24/19 3:37 PM, Christoph Hellwig wrote: >>> On Fri, Aug 23, 2019 at 03:17:52PM -0700, Ralph Campbell wrote: >>>> Although hmm_range_fault() calls find_vma() to make sure that a vma exists >>>> before calling walk_page_range(), hmm_vma_walk_hole() can still be called >>>> with walk->vma == NULL if the start and end address are not contained >>>> within the vma range. >>> >>> Should we convert to walk_vma_range instead? Or keep walk_page_range >>> but drop searching the vma ourselves? >>> >>> Except for that the patch looks good to me: >>> >>> Reviewed-by: Christoph Hellwig >>> >> >> I think keeping the call to walk_page_range() makes sense. >> Jason is hoping to be able to snapshot a range with & without vmas >> and have the pfns[] filled with empty/valid entries as appropriate. >> >> I plan to repost my patch changing hmm_range_fault() to use >> walk.test_walk which will remove the call to find_vma(). >> Jason had some concerns about testing it so that's why I have >> been working on some HMM self tests before resending it. > > I'm really excited to see tests for hmm_range_fault()! > > Did you find this bug with the tests?? > > Jason > Yes, I found both bugs with the tests. I started with Jerome's hmm_dummy driver and user level test code. Hopefully I can send it out this week.