Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752214AbbEHFTF (ORCPT ); Fri, 8 May 2015 01:19:05 -0400 Received: from chicago.guarana.org ([198.144.183.183]:39521 "EHLO chicago.guarana.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750849AbbEHFTB (ORCPT ); Fri, 8 May 2015 01:19:01 -0400 X-Greylist: delayed 555 seconds by postgrey-1.27 at vger.kernel.org; Fri, 08 May 2015 01:19:01 EDT Date: Fri, 8 May 2015 16:09:09 +1000 From: Kevin Easton To: One Thousand Gnomes Cc: Dave Hansen , Ingo Molnar , linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH 00/12] [RFC] x86: Memory Protection Keys Message-ID: <20150508060909.GA5296@chicago.guarana.org> 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.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1218 Lines: 26 On Thu, May 07, 2015 at 08:18:43PM +0100, 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. > > 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. How could a library (or debugger, for that matter) arbitrate ownership of the protection domains with the application? One interesting use for it might be to be to provide an interface to allocate memory and associate it with a lock that's supposed to be held while accessing that memory. The allocation function hashes the lock address down to one of the 15 non-zero protection domains and applies that key to the memory, the lock function then adds RW access to the appropriate protection domain and the unlock function removes it. - Kevin -- 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/