Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4610211ybl; Mon, 26 Aug 2019 13:02:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwx/so0hBkjXgP62mZp/srUfDSY1S2poRiGGud2eVYNDq/ex3DRPY8fQf986G+HGTKo066V X-Received: by 2002:a63:6fcf:: with SMTP id k198mr17925928pgc.276.1566849777096; Mon, 26 Aug 2019 13:02:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566849777; cv=none; d=google.com; s=arc-20160816; b=zvWTWiiDunTPsoVZ1hEGFkolGU/bFhx6uVcMdqJ8oBfDmgh5D3Mm+J0y7CsMV8p7Zo 02TJnDDKQJ7nVry3T1hOnBqMBohI6XuFq22SavjSVJ//l0ZRnUg/35dwb4a8/kzSStIq 87VsNKzAMEriN+DqKlo0NVePIohkGg7L7U/5y96L7wLjF4SuON1To/7C3/A1M4YVK9OF z9V82R4DPLtzuGGJ5lmP1zaZ3ktPOHMKDKN7QocYlIv/4zKahb/WH594LqLF65jNOuP2 lAPs0iMMN/2OnhKlwG+FhlXVIeSsALVjHV91p1qJ8W+IXlwg4f1nC82FHbUA1Cx+XxdI BE4A== 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=q0XlO0WIP1WKl6O/MutlXE9k/HAHL1+wksVgPZA90XQ=; b=fFGayMI3mTBWiP/0xrOZptSoXGyGLC08Wzk0TcFQwIk0iXQ/AoYC6GnCA2hnEj/12+ FnDl/GT056t22C8F3gGnhLUp3fZlmrqJR06edLTb3Jy/dO48AdY9uaIdEeUnAkPHa81q rTRWx1mplkJhi1DT7IOr+K2tIOUjEoIFWEoWVkcOtE0Z1kgo1x+xpZGVPMjkTD5NHQ2j CVbjxJ8+JddJzx4xxivan9uf42zgEeRSgASqfjYdqsuepTX8l1Svs4Eof1flcp0/1TTw 1VuBM6rFjqhqY1tZitgEn5QMxYvoR/pJt3uC6z4ORwvJB5OqreyBOIREpHl+blia69hN Btcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=d2fknKfO; 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 c18si10517182plo.251.2019.08.26.13.02.41; Mon, 26 Aug 2019 13:02:57 -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=d2fknKfO; 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 S1731140AbfHZSCO (ORCPT + 99 others); Mon, 26 Aug 2019 14:02:14 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:4846 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729144AbfHZSCN (ORCPT ); Mon, 26 Aug 2019 14:02:13 -0400 Received: from hqpgpgate101.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:02:15 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 26 Aug 2019 11:02:13 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 26 Aug 2019 11:02:13 -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:02:12 +0000 Subject: Re: [PATCH 1/2] mm/hmm: hmm_range_fault() NULL pointer bug To: Christoph Hellwig CC: , , , , , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Jason Gunthorpe , Andrew Morton References: <20190823221753.2514-1-rcampbell@nvidia.com> <20190823221753.2514-2-rcampbell@nvidia.com> <20190824223754.GA21891@lst.de> X-Nvconfidentiality: public From: Ralph Campbell Message-ID: Date: Mon, 26 Aug 2019 11:02:12 -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: <20190824223754.GA21891@lst.de> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) 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=1566842535; bh=q0XlO0WIP1WKl6O/MutlXE9k/HAHL1+wksVgPZA90XQ=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=d2fknKfO2/+Zv6spaSSH3ujdgxCAZH3q2pr6c/Siwshb41aUxlG/I+6Tyj3fXyYY5 r1ZUUnxreiuxEswRCYLLZsMIXjsrYEZ2qKObAcIzx4lFW+80OBz929fmspCEwePFSM Weh8IBdvRGmAYugnTXZh+qH1U82UBGS1UKNXbJ6ZBS+xJMiQMjfCYuJvF6l51O9pkO O0oy/5uowbDESOjWEqnQfr3ZNPKFAUyr/vq/8JL6L4ZXdjyHlF2eCpi6YaUIhZ26eX tDQ19l3lAZnppu1N//ySuXInwpJ3YqMTeBXQVmBM1ehXjdv0DZYHvm24rrRDsWS3r/ wDuGvR7pgamGw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.