From mboxrd@z Thu Jan 1 00:00:00 1970 From: Catalin Marinas Subject: Re: [PATCH 07/11] ARM64: mm: Make PAGE_NONE pages read only and no-execute. Date: Fri, 24 May 2013 12:21:49 +0100 Message-ID: <20130524112149.GJ18272@arm.com> References: <1369328878-11706-1-git-send-email-steve.capper@linaro.org> <1369328878-11706-8-git-send-email-steve.capper@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1369328878-11706-8-git-send-email-steve.capper@linaro.org> Sender: owner-linux-mm@kvack.org To: Steve Capper Cc: "linux-mm@kvack.org" , "x86@kernel.org" , "linux-arch@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Michal Hocko , Ken Chen , Mel Gorman , Will Deacon , "patches@linaro.org" List-Id: linux-arch.vger.kernel.org On Thu, May 23, 2013 at 06:07:54PM +0100, Steve Capper wrote: > If we consider the following code sequence: > > my_pte = pte_modify(entry, myprot); > x = pte_write(my_pte); > y = pte_exec(my_pte); > > If myprot comes from a PROT_NONE page, then x and y will both be > true which is undesireable behaviour. > > This patch sets the no-execute and read-only bits for PAGE_NONE > such that the code above will return false for both x and y. > > Signed-off-by: Steve Capper Acked-by: Catalin Marinas -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:52029 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752404Ab3EXLWf (ORCPT ); Fri, 24 May 2013 07:22:35 -0400 Date: Fri, 24 May 2013 12:21:49 +0100 From: Catalin Marinas Subject: Re: [PATCH 07/11] ARM64: mm: Make PAGE_NONE pages read only and no-execute. Message-ID: <20130524112149.GJ18272@arm.com> References: <1369328878-11706-1-git-send-email-steve.capper@linaro.org> <1369328878-11706-8-git-send-email-steve.capper@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1369328878-11706-8-git-send-email-steve.capper@linaro.org> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Steve Capper Cc: "linux-mm@kvack.org" , "x86@kernel.org" , "linux-arch@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Michal Hocko , Ken Chen , Mel Gorman , Will Deacon , "patches@linaro.org" Message-ID: <20130524112149.5rRUjJYPikQg6WAMspMh80liti-8eDQY_izX2rHg0xs@z> On Thu, May 23, 2013 at 06:07:54PM +0100, Steve Capper wrote: > If we consider the following code sequence: > > my_pte = pte_modify(entry, myprot); > x = pte_write(my_pte); > y = pte_exec(my_pte); > > If myprot comes from a PROT_NONE page, then x and y will both be > true which is undesireable behaviour. > > This patch sets the no-execute and read-only bits for PAGE_NONE > such that the code above will return false for both x and y. > > Signed-off-by: Steve Capper Acked-by: Catalin Marinas From mboxrd@z Thu Jan 1 00:00:00 1970 From: catalin.marinas@arm.com (Catalin Marinas) Date: Fri, 24 May 2013 12:21:49 +0100 Subject: [PATCH 07/11] ARM64: mm: Make PAGE_NONE pages read only and no-execute. In-Reply-To: <1369328878-11706-8-git-send-email-steve.capper@linaro.org> References: <1369328878-11706-1-git-send-email-steve.capper@linaro.org> <1369328878-11706-8-git-send-email-steve.capper@linaro.org> Message-ID: <20130524112149.GJ18272@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, May 23, 2013 at 06:07:54PM +0100, Steve Capper wrote: > If we consider the following code sequence: > > my_pte = pte_modify(entry, myprot); > x = pte_write(my_pte); > y = pte_exec(my_pte); > > If myprot comes from a PROT_NONE page, then x and y will both be > true which is undesireable behaviour. > > This patch sets the no-execute and read-only bits for PAGE_NONE > such that the code above will return false for both x and y. > > Signed-off-by: Steve Capper Acked-by: Catalin Marinas