From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932966AbbJALR2 (ORCPT ); Thu, 1 Oct 2015 07:17:28 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:34525 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932845AbbJALRX (ORCPT ); Thu, 1 Oct 2015 07:17:23 -0400 Date: Thu, 1 Oct 2015 13:17:18 +0200 From: Ingo Molnar To: Dave Hansen Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds , Andrew Morton , Peter Zijlstra , Andy Lutomirski , Borislav Petkov , Kees Cook Subject: Re: [PATCH 26/26] x86, pkeys: Documentation Message-ID: <20151001111718.GA25333@gmail.com> References: <20150916174903.E112E464@viggo.jf.intel.com> <20150916174913.AF5FEA6D@viggo.jf.intel.com> <20150920085554.GA21906@gmail.com> <55FF88BA.6080006@sr71.net> <20150924094956.GA30349@gmail.com> <56044A88.7030203@sr71.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56044A88.7030203@sr71.net> 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 * Dave Hansen wrote: > > If yes then this could be a significant security feature / usecase for pkeys: > > executable sections of shared libraries and binaries could be mapped with pkey > > access disabled. If I read the Intel documentation correctly then that should > > be possible. > > Agreed. I've even heard from some researchers who are interested in this: > > https://www.infsec.cs.uni-saarland.de/wp-content/uploads/sites/2/2014/10/nuernberger2014ccs_disclosure.pdf So could we try to add an (opt-in) kernel option that enables this transparently and automatically for all PROT_EXEC && !PROT_WRITE mappings, without any user-space changes and syscalls necessary? Beyond the security improvement, this would enable this hardware feature on most x86 Linux distros automatically, on supported hardware, which is good for testing. Assuming it boots up fine on a typical distro, i.e. assuming that there are no surprises where PROT_READ && PROT_EXEC sections are accessed as data. Thanks, Ingo