Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751606AbbEGT0i (ORCPT ); Thu, 7 May 2015 15:26:38 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:33044 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750892AbbEGT0Y (ORCPT ); Thu, 7 May 2015 15:26:24 -0400 Date: Thu, 7 May 2015 21:26:20 +0200 From: Ingo Molnar To: One Thousand Gnomes Cc: Dave Hansen , linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH 00/12] [RFC] x86: Memory Protection Keys Message-ID: <20150507192619.GA23338@gmail.com> References: <20150507174132.34AF8FAF@viggo.jf.intel.com> <20150507175707.GA22172@gmail.com> <554BAA68.6000508@sr71.net> <20150507201843.0ccf0938@lxorguk.ukuu.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150507201843.0ccf0938@lxorguk.ukuu.org.uk> 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 Content-Length: 1542 Lines: 41 * One Thousand Gnomes wrote: > > We could keep heap metadata as R/O and only make it R/W inside of > > malloc() itself to catch corruption more quickly. > > If you implement multiple malloc pools you can chop up lots of > stuff. I'd say that a 64-bit address space is large enough to hide buffers in from accidental corruption, without any runtime page protection flipping overhead? > In library land it isn't just stuff like malloc, you can use it as a > debug weapon to protect library private data from naughty > application code. > > There are some other debug uses when catching faults - fast ways to > do range access breakpoints for example. I think libraries are happy enough to work without bugs - apps digging around in library data are in a "you keep all the broken pieces" situation, why would a library want to slow down every good citizen down with extra protection flipping/unflipping accesses? The Valgrind usecase looks somewhat legit, albeit not necessarily for multithreaded apps: there you generally really want protection changes to be globally visible, such as publishing the effects of free() or malloc(). Also, will apps/libraries bother if it's not a standard API and if it only runs on very fresh CPUs? Thanks, Ingo -- 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/