Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163306AbbKTUHM (ORCPT ); Fri, 20 Nov 2015 15:07:12 -0500 Received: from mail-ig0-f173.google.com ([209.85.213.173]:37301 "EHLO mail-ig0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162428AbbKTUHJ (ORCPT ); Fri, 20 Nov 2015 15:07:09 -0500 MIME-Version: 1.0 In-Reply-To: <4325714.tYNkapC69P@wuerfel> References: <20151120173133.24259.97028.stgit@dwillia2-desk3.jf.intel.com> <4325714.tYNkapC69P@wuerfel> Date: Fri, 20 Nov 2015 12:07:08 -0800 X-Google-Sender-Auth: KKEPPruT12Fz_CP7IjHbJ1benh8 Message-ID: Subject: Re: [RFC PATCH] restrict /dev/mem to idle io memory ranges From: Kees Cook To: Arnd Bergmann Cc: "linux-arm-kernel@lists.infradead.org" , Dan Williams , LKML , Russell King , linux-nvdimm@ml01.01.org, Greg Kroah-Hartman , "H. Peter Anvin" , Heiko Carstens , Will Deacon , Ingo Molnar , Benjamin Herrenschmidt , Catalin Marinas , Martin Schwidefsky , Thomas Gleixner , Andrew Morton Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2038 Lines: 52 On Fri, Nov 20, 2015 at 12:00 PM, Arnd Bergmann wrote: > On Friday 20 November 2015 09:31:33 Dan Williams wrote: >> This effectively promotes IORESOURCE_BUSY to IORESOURCE_EXCLUSIVE >> semantics by default. If userspace really believes it is safe to access >> the memory region it can also perform the extra step of disabling an >> active driver. This protects device address ranges with read side >> effects and otherwise directs userspace to use the driver. >> >> Persistent memory presents a large "mistake surface" to /dev/mem as now >> accidental writes can corrupt a filesystem. >> >> Cc: Kees Cook >> Cc: Russell King >> Cc: Catalin Marinas >> Cc: Will Deacon >> Cc: Benjamin Herrenschmidt >> Cc: Martin Schwidefsky >> Cc: Heiko Carstens >> Cc: Thomas Gleixner >> Cc: Ingo Molnar >> Cc: "H. Peter Anvin" >> Cc: Andrew Morton >> Cc: Greg Kroah-Hartman >> Signed-off-by: Dan Williams >> > > I like the idea. Yes please! I was always surprised that IORESOURCE_BUSY was allowed under STRICT_DEVMEM. > Maybe split the change up into two patches, where the first one > just does the trivial move of the Kconfig option, and the second > one that changes behavior is small? Agreed: consolidate the per-arch Kconfigs first. > There is also a question of whether we actually need two options > or if we can safely make the existing option stricter. Right -- what actually breaks if we add _BUSY to getting blocked? -Kees -- Kees Cook Chrome OS Security -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/