Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753890AbbHEXzt (ORCPT ); Wed, 5 Aug 2015 19:55:49 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:40400 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751328AbbHEXzs (ORCPT ); Wed, 5 Aug 2015 19:55:48 -0400 Date: Wed, 5 Aug 2015 16:55:43 -0700 From: Paul Burton To: Leonid Yegoshin CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v4 3/3] MIPS: set stack/data protection as non-executable Message-ID: <20150805235543.GG2057@NP-P-BURTON> References: <20150805234348.20722.71740.stgit@ubuntu-yegoshin> <20150805234936.20722.60927.stgit@ubuntu-yegoshin> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <20150805234936.20722.60927.stgit@ubuntu-yegoshin> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [192.168.159.103] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1727 Lines: 42 On Wed, Aug 05, 2015 at 04:49:36PM -0700, Leonid Yegoshin wrote: > This is a last step of 3 patches which shift FPU emulation out of > stack into protected area. So, it disables a default executable stack. > > Additionally, it sets a default data area non-executable protection. > > Signed-off-by: Leonid Yegoshin > --- > arch/mips/include/asm/page.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h > index 89dd7fed1a57..0b6cec4a1b80 100644 > --- a/arch/mips/include/asm/page.h > +++ b/arch/mips/include/asm/page.h > @@ -228,7 +228,7 @@ extern int __virt_addr_valid(const volatile void *kaddr); > #define virt_addr_valid(kaddr) \ > __virt_addr_valid((const volatile void *) (kaddr)) > > -#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ > +#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | \ > VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) > > #define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE) > Hi Leonid, As was pointed out last time you posted this, it breaks backwards compatibility with userland & thus cannot be applied. We should only be changing executability of memory in the presence of a PT_GNU_STACK header indicating that it's safe to do so, with cooperation from the toolchain team to begin emitting it for MIPS. See the way ARM did it, or the patches I've posted for this in the past. Thanks, Paul -- 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/