From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751344AbdEBIn1 (ORCPT ); Tue, 2 May 2017 04:43:27 -0400 Received: from mx2.suse.de ([195.135.220.15]:33084 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750957AbdEBIn0 (ORCPT ); Tue, 2 May 2017 04:43:26 -0400 Date: Tue, 2 May 2017 10:43:23 +0200 From: Michal Hocko To: Xishi Qiu Cc: Andrew Morton , Mel Gorman , Vlastimil Babka , Joonsoo Kim , Johannes Weiner , Rik van Riel , Shakeel Butt , Linux MM , LKML , zhong jiang Subject: Re: [RFC] dev/mem: "memtester -p 0x6c80000000000 10G" cause crash Message-ID: <20170502084323.GG14593@dhcp22.suse.cz> References: <59083C5B.5080204@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <59083C5B.5080204@huawei.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 02-05-17 15:59:23, Xishi Qiu wrote: > Hi, I use "memtester -p 0x6c80000000000 10G" to test physical address 0x6c80000000000 > Because this physical address is invalid, and valid_mmap_phys_addr_range() > always return 1, so it causes crash. > > My question is that should the user assure the physical address is valid? We already seem to be checking range_is_allowed(). What is your CONFIG_STRICT_DEVMEM setting? The code seems to be rather confusing but my assumption is that you better know what you are doing when mapping this file. > ... > [ 169.147578] ? panic+0x1f1/0x239 > [ 169.150789] oops_end+0xb8/0xd0 > [ 169.153910] pgtable_bad+0x8a/0x95 > [ 169.157294] __do_page_fault+0x3aa/0x4a0 > [ 169.161194] do_page_fault+0x30/0x80 > [ 169.164750] ? do_syscall_64+0x175/0x180 > [ 169.168649] page_fault+0x28/0x30 > > Thanks, > Xishi Qiu -- Michal Hocko SUSE Labs