From mboxrd@z Thu Jan 1 00:00:00 1970 Reply-To: kernel-hardening@lists.openwall.com Sender: Ingo Molnar Date: Wed, 11 May 2016 08:24:42 +0200 From: Ingo Molnar Message-ID: <20160511062442.GA24803@gmail.com> References: <1462900755-20005-1-git-send-email-keescook@chromium.org> <1462900755-20005-2-git-send-email-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1462900755-20005-2-git-send-email-keescook@chromium.org> Subject: [kernel-hardening] Re: [PATCH v8 1/4] x86/KASLR: Clarify identity map interface To: Kees Cook Cc: Borislav Petkov , Yinghai Lu , Baoquan He , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , Vivek Goyal , Andy Lutomirski , lasse.collin@tukaani.org, Andrew Morton , Dave Young , kernel-hardening@lists.openwall.com, LKML List-ID: * Kees Cook wrote: > +/* > + * Mapping information structure passed to kernel_ident_mapping_init(). > + * Due to relocation, pointers must be assigned at run time not build time. > + */ > +static struct x86_mapping_info mapping_info = { > + .pmd_flag = __PAGE_KERNEL_LARGE_EXEC, > +}; > +void initialize_identity_maps(void) > { > + /* Init mapping_info with run-time function/buffer pointers. */ > + mapping_info.alloc_pgt_page = alloc_pgt_page; > + mapping_info.context = &pgt_data; Could you please outline the precise failure mode? What gets executed when, which pointer gets relocated and which not, and exactly when does it pose a problem, etc. Thanks, Ingo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751450AbcEKGYu (ORCPT ); Wed, 11 May 2016 02:24:50 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36049 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751129AbcEKGYs (ORCPT ); Wed, 11 May 2016 02:24:48 -0400 Date: Wed, 11 May 2016 08:24:42 +0200 From: Ingo Molnar To: Kees Cook Cc: Borislav Petkov , Yinghai Lu , Baoquan He , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , Vivek Goyal , Andy Lutomirski , lasse.collin@tukaani.org, Andrew Morton , Dave Young , kernel-hardening@lists.openwall.com, LKML Subject: Re: [PATCH v8 1/4] x86/KASLR: Clarify identity map interface Message-ID: <20160511062442.GA24803@gmail.com> References: <1462900755-20005-1-git-send-email-keescook@chromium.org> <1462900755-20005-2-git-send-email-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1462900755-20005-2-git-send-email-keescook@chromium.org> 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 * Kees Cook wrote: > +/* > + * Mapping information structure passed to kernel_ident_mapping_init(). > + * Due to relocation, pointers must be assigned at run time not build time. > + */ > +static struct x86_mapping_info mapping_info = { > + .pmd_flag = __PAGE_KERNEL_LARGE_EXEC, > +}; > +void initialize_identity_maps(void) > { > + /* Init mapping_info with run-time function/buffer pointers. */ > + mapping_info.alloc_pgt_page = alloc_pgt_page; > + mapping_info.context = &pgt_data; Could you please outline the precise failure mode? What gets executed when, which pointer gets relocated and which not, and exactly when does it pose a problem, etc. Thanks, Ingo