Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754487AbbHEX4J (ORCPT ); Wed, 5 Aug 2015 19:56:09 -0400 Received: from mail-bn1on0059.outbound.protection.outlook.com ([157.56.110.59]:25635 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753913AbbHEX4H (ORCPT ); Wed, 5 Aug 2015 19:56:07 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=David.Daney@caviumnetworks.com; Message-ID: <55C2A28C.7000809@caviumnetworks.com> Date: Wed, 5 Aug 2015 16:55:56 -0700 From: David Daney User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Leonid Yegoshin CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v4 3/3] MIPS: set stack/data protection as non-executable References: <20150805234348.20722.71740.stgit@ubuntu-yegoshin> <20150805234936.20722.60927.stgit@ubuntu-yegoshin> In-Reply-To: <20150805234936.20722.60927.stgit@ubuntu-yegoshin> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [64.2.3.194] X-ClientProxiedBy: SN2PR07CA009.namprd07.prod.outlook.com (10.255.174.26) To CY1PR0701MB1725.namprd07.prod.outlook.com (25.163.21.14) X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1725;2:Dp9pcG06iwPKb9q7EVdKf9lt7jQV53k9/VSXrjkjx8e7IY44Cg1YEYWsSLwAjhhp/xNYA+aax0k/JJA/osS8ez8iAoUzpa4s0sXbC7eGfLYRZ2IwM6essegmvtNPs/t+UnwOTLHGpvt98PdrzkJwwhNTx4LM1IPlkh7J+fsTMyU=;3:YoqeXZw20A+unD4aW9MzAvYCG0qkfx1zHciv1YD+wxIvHH9G4B0OZ9gaIosRD7yjYhdNQl5nQYkNMj9xJMEI49uVNA9AoffgTm8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VAvbp0bLACGvp7oKTD2itLWN71Z8q4LffzLxXYJdvXFFyhDHSno1Ru+pDn9kqOzrmua6Wk+PIibN46+StqrvSqohEXOI2N3SKR151+m3EN09qPbbep+ra4kYUA+bsBXbMQorrclv6qwI6RlmuqzOB7WgSOmL4ci692xhPPZ+ZaX1slMDIKpdY9vTvM5HM2EFSxpY9uHGyeYen7OBvJou46mgjeQe+T+18Bv8aYUCgTSHw+omjaqpM8w1cosPBPVIzlcVMH63XeQHadEHivmiWXn78= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:CY1PR0701MB1725;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1725; X-Forefront-PRVS: 06592CCE58 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(377454003)(24454002)(189002)(479174004)(199003)(5001960100002)(77156002)(110136002)(54356999)(106356001)(65816999)(76176999)(4001540100001)(50986999)(97736004)(36756003)(87266999)(23676002)(92566002)(68736005)(64126003)(4001350100001)(2950100001)(77096005)(5001860100001)(5001830100001)(81156007)(122386002)(64706001)(40100003)(66066001)(69596002)(80316001)(19580405001)(83506001)(65806001)(65956001)(189998001)(105586002)(42186005)(53416004)(47776003)(50466002)(46102003)(101416001)(33656002)(19580395003)(59896002)(62966003)(87976001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB1725;H:dl.caveonetworks.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjA3MDFNQjE3MjU7MjM6NzdyYWNJRk92UllxU2VUN0xCaTlSOG9E?= =?utf-8?B?VEpoWWZKWjl6dm00WmN3OHBXZG05WkxLaU9TYVcxWEFUVWx5VytLeFB2YWhk?= =?utf-8?B?TGtXRkZqZExKUUIwRElhOVp2djFqOWRMY1YzbjRCYXI0K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W+wK9LYQ==;24:nBh8N81LdlUat3GoiNco7k87xiqKFKOWKbVFBUl+ktoO6qneojRI6DSyKuFs0ey0uL7rfrkTZkJP6fuPFNO9ju24LN5I45UIk54OBWMqqLU=;20:cxAZQJ/ZXYvUwkBdykgiVhRLD58L/FjXw1myhUU3mCSMJF4cqqsdAHCyuLTFRZrHidL22/uFnj6KH9E6rCM01g== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2015 23:56:00.4142 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1725 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1451 Lines: 42 On 08/05/2015 04:49 PM, 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. > NAK. You cannot change the default. If you want a non-executable stack, the program has to request it with the proper annotations in its ELF file. David Daney. > 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) > -- 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/