From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755271AbbJUOg4 (ORCPT ); Wed, 21 Oct 2015 10:36:56 -0400 Received: from mail.skyhub.de ([78.46.96.112]:43857 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754715AbbJUOgy (ORCPT ); Wed, 21 Oct 2015 10:36:54 -0400 Date: Wed, 21 Oct 2015 16:36:51 +0200 From: Borislav Petkov To: Ard Biesheuvel Cc: Ingo Molnar , Matt Fleming , Stephen Smalley , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , Kees Cook , Thomas Gleixner , "H. Peter Anvin" , Peter Zijlstra , Andy Lutomirski , Denys Vlasenko , Brian Gerst , "linux-efi@vger.kernel.org" Subject: Re: [PATCH v2] x86/mm: warn on W+x mappings Message-ID: <20151021143651.GE3575@pd.tnic> References: <20151012125548.GE2579@codeblueprint.co.uk> <20151012141754.GA6621@gmail.com> <20151012144928.GF2579@codeblueprint.co.uk> <20151014151807.GA27013@gmail.com> <20151014210257.GF2782@codeblueprint.co.uk> <20151021094242.GA12155@gmail.com> <20151021124924.GA19262@gmail.com> <20151021132430.GD3575@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 On Wed, Oct 21, 2015 at 03:28:56PM +0200, Ard Biesheuvel wrote: > In theory, yes. In practice, since this is supposed to be a security > enhancement, we need some kind of ground truth to tell us which pages > can be legally modified *and* executed, so that we can detect the > illegal cases. My point was that, since a multitude of PE/COFF images > can be covered by a single EfiRuntimeServicesCode region, the UEFI > memory map does not give us enough information to make the distinction > between a page that sits on the text/data boundary of some PE/COFF > image and a page that sits wholly in either. Well, we're going to simply allow the accesses to in-kernel users which fault on those ranges, assuming that in-kernel modifiers are legit and DTRT. Which means, we don't really need to know which pages can be legally modified - we simply trust the in-kernel users. The moment you're able to load an evil kernel module, guarding against those writes is the last thing you need to worry about... -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.