From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752368Ab2IJFQn (ORCPT ); Mon, 10 Sep 2012 01:16:43 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:35611 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751408Ab2IJFQm (ORCPT ); Mon, 10 Sep 2012 01:16:42 -0400 Message-ID: <504D77D0.70705@gmail.com> Date: Mon, 10 Sep 2012 07:17:04 +0200 From: Sasha Levin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120902 Thunderbird/15.0 MIME-Version: 1.0 To: "H. Peter Anvin" CC: Linus Torvalds , Suresh Siddha , Andrew Morton , dwmw2@infradead.org, "linux-kernel@vger.kernel.org" , linux-mtd@lists.infradead.org, linux-mm , Dave Jones Subject: Re: mtd: kernel BUG at arch/x86/mm/pat.c:279! References: <1340959739.2936.28.camel@lappy> <1347057778.26695.68.camel@sbsiddha-desk.sc.intel.com> <1347062045.26695.82.camel@sbsiddha-desk.sc.intel.com> <504CCA31.2000003@zytor.com> In-Reply-To: <504CCA31.2000003@zytor.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/09/2012 06:56 PM, H. Peter Anvin wrote: >> >> Anyway, that means that the BUG_ON() is likely bogus, but so is the >> whole calling convention. >> >> The 4kB range starting at 0xfffffffffffff000 sounds like a *valid* >> range, but that requires that we fix the calling convention to not >> have that "end" (exclusive) thing. It should either be "end" >> (inclusive), or just "len". >> > > On x86, it is definitely NOT a valid range. There is no physical addresses > there, and there will never be any. This reminds me a similar issue: If you try to mmap /dev/kmem at an offset which is not kernel owned (such as 0), you'll get all the way to __pa() before getting a BUG() about addresses not making sense. How come there's no arch-specific validation of attempts to access virtual/physical addresses? In the kmem example I'd assume that something very early on should be yelling at me about doing something like that, but for some reason I get all the way to __pa() before getting a BUG() (!). Thanks, Sasha