Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp489674imu; Wed, 12 Dec 2018 22:13:55 -0800 (PST) X-Google-Smtp-Source: AFSGD/V303gaXtSOZZSNGk+We1TVnaQcKh+CpzWeMi8SNFIkAqKU6NJtO1t+D+OB7dSfvqhDqQI9 X-Received: by 2002:a17:902:c5:: with SMTP id a63mr22901063pla.267.1544681635428; Wed, 12 Dec 2018 22:13:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544681635; cv=none; d=google.com; s=arc-20160816; b=lBXYTBkIGKAM0+rquRD8y573vgSMkBLYhSq0BVp5BMk9eVkBza+7lj0/D5X0wGTnCY vJJovBdPTpJrY2G+UbvnFjp5XTw92PtxxP46i76ph19CxCZySUNxdMKKQTU423okwkKY Kk81Q2AoPCnjlP6NE8tLKSzK0hBM0RurMZ3utLvCIiV+ibTMzOcmFwevDRUqL+yUjzhl S84+J9II02n9Bnb2XiLJ7b3jjMA06qnuxd5MDIX1b+p3B5UCQnnusz3+nIaMgzxJmQaQ /XjWDQGdwxvufVWlr6Ouc4VXYqU6tJgrwVorQ+xmjk/DOQYbiSDUWT3XPaUAUXVZK+pz x9VQ== 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:mail-followup-to :message-id:subject:cc:to:from:date; bh=ly8ujGYZNJFfThVN6JvujxP5PiEnfOF2xvFykwi/QlI=; b=osX0jrKEkJ0wjuiAxhcuN8lPobmtVaYd9NmCjM/EvnFY75h5yjXvQR0RJSvwMHjc0G jV4hn9sU02ZUT1Slv1gb0Dton5d4MiQ1Kg2RzKGKkBcFIL/CFfa2p+cBrtfjZBl8MhKx AE04yB6RXfT35NVmDoBB6Ezd0xCevLiguuTLRUISXnIIHbE7JXNZVa06/IjGScjuu4qs zAaLZ+qZngmfrGh24DRiIrCFTO5dm29lc/5VTIx9ELfXEuEwInB2jzhwJOPeZnvQaiFH x5WWr+c8S4Rrd95JpNl5eMy0j8LCgWBAektla3UJDV4u985LS6YDaFu3fS/AbudcZGJk RB5g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 101si976115pld.22.2018.12.12.22.13.40; Wed, 12 Dec 2018 22:13:55 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726729AbeLMGMv (ORCPT + 99 others); Thu, 13 Dec 2018 01:12:51 -0500 Received: from mga03.intel.com ([134.134.136.65]:2617 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726478AbeLMGMu (ORCPT ); Thu, 13 Dec 2018 01:12:50 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2018 22:12:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,347,1539673200"; d="scan'208";a="283206481" Received: from linux.intel.com ([10.54.29.200]) by orsmga005.jf.intel.com with ESMTP; 12 Dec 2018 22:12:49 -0800 Received: from tiger-server (unknown [10.239.48.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id B5640580380; Wed, 12 Dec 2018 22:12:47 -0800 (PST) Date: Thu, 13 Dec 2018 14:12:40 +0800 From: Yi Zhang To: Dan Williams Cc: Dave Jiang , Vishal L Verma , "Zhang, Yu C" , Linux Kernel Mailing List , linux-nvdimm , zwisler@kernel.org, Jan Kara , "Zhang, Yi Z" Subject: Re: [PATCH V2 1/1] device-dax: check for vma range while dax_mmap. Message-ID: <20181213061239.GA43404@tiger-server> Mail-Followup-To: Dan Williams , Dave Jiang , Vishal L Verma , "Zhang, Yu C" , Linux Kernel Mailing List , linux-nvdimm , zwisler@kernel.org, Jan Kara , "Zhang, Yi Z" References: <46441800c43f029757c70d8386e3112701081503.1534160958.git.yi.z.zhang@linux.intel.com> <1534787638.13739.52.camel@intel.com> <89e7bd54-4afa-614d-ec54-49af7928d6c7@intel.com> <20180821161657.GA22028@tiger-server> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-12-10 at 16:10:31 -0800, Dan Williams wrote: > On Tue, Aug 21, 2018 at 12:38 AM Yi Zhang wrote: > > > > On 2018-08-20 at 12:50:31 -0700, Dave Jiang wrote: > > > > > > > > > On 08/20/2018 10:53 AM, Verma, Vishal L wrote: > > > > > > > > On Mon, 2018-08-13 at 20:02 +0800, Zhang Yi wrote: > > > >> This patch prevents a user mapping an illegal vma range that is larger > > > >> than a dax device physical resource. > > > >> > > > >> When qemu maps the dax device for virtual nvdimm's backend device, the > > > >> v-nvdimm label area is defined at the end of mapped range. By using an > > > >> illegal size that exceeds the range of the device dax, it will trigger a > > > >> fault with qemu. > > > >> > > > >> Signed-off-by: Zhang Yi > > > >> --- > > > >> drivers/dax/device.c | 29 +++++++++++++++++++++++++++++ > > > >> 1 file changed, 29 insertions(+) > > > >> > > > > > > > > Looks good to me: > > > > Reviewed-by: Vishal Verma > > > > > > Applied. > > Thanks Dava and Vishal's kindly review. Thank you. > > So, it turns out this patch did not get merged for 4.20. I fumbled it > when returning from vacation. However, I'm not sure it is needed. As > long as attempts to access the out-of-range capacity results in SIGBUS > then the implementation is correct. This is similar to the case where > a file is truncated after the vma is established. That size is > validated at fault time. The problem is that we didn't get the fault at we initial the mapping until attempt to access it, then qemu will failed unexpect without any output, I think is is better to mention user that we are starting at a illegal size, but not faulting at an uncertained time. > > Could you be clearer about why this is a problem? The fault sounds > like the correct result. > _______________________________________________ > Linux-nvdimm mailing list > Linux-nvdimm@lists.01.org > https://lists.01.org/mailman/listinfo/linux-nvdimm