Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755472AbaKPSwN (ORCPT ); Sun, 16 Nov 2014 13:52:13 -0500 Received: from www.linutronix.de ([62.245.132.108]:58520 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755257AbaKPSwM (ORCPT ); Sun, 16 Nov 2014 13:52:12 -0500 Date: Sun, 16 Nov 2014 19:52:05 +0100 (CET) From: Thomas Gleixner To: Yinghai Lu cc: Kees Cook , Linux Kernel Mailing List , Ingo Molnar , "H. Peter Anvin" , the arch/x86 maintainers , Andrew Morton , Andy Lutomirski , Yasuaki Ishimatsu , Wang Nan , David Vrabel Subject: Re: [PATCH v2] x86, mm: set NX across entire PMD at boot In-Reply-To: Message-ID: References: <20141114204517.GA24402@www.outflux.net> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 14 Nov 2014, Yinghai Lu wrote: > On Fri, Nov 14, 2014 at 6:46 PM, Kees Cook wrote: > > On Fri, Nov 14, 2014 at 6:29 PM, Yinghai Lu wrote: > > >> should use attached one instead. > >> > >> 1. should use _brk_end instead of &end, as we only use partial of > >> brk. > >> 2. [_brk_end, pm_end) page range is already converted. aka > >> is not wasted. > > > > Are you sure? For me, _brk_end isn't far enough: > > > > [ 1.475572] all_end: 0xffffffff82df5000 > > [ 1.476736] _brk_end: 0xffffffff82dd6000 > > Yes. _brk_end should be small then &_end. Wrong. _brk_end can move up to _end, i.e. to __brk_limit. But it's safe to use _brk_end when mark_rodata_ro() is called because extend_brk() is gone already at that point. Thanks, tglx -- 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/