Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751608AbdFFLfv (ORCPT ); Tue, 6 Jun 2017 07:35:51 -0400 Received: from lhrrgout.huawei.com ([194.213.3.17]:28081 "EHLO lhrrgout.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751391AbdFFLfu (ORCPT ); Tue, 6 Jun 2017 07:35:50 -0400 Subject: Re: [PATCH 2/5] Protectable Memory Allocator To: Christoph Hellwig , Tetsuo Handa CC: , , , , , , , , , References: <20170605192216.21596-1-igor.stoppa@huawei.com> <20170605192216.21596-3-igor.stoppa@huawei.com> <201706060444.v564iWds024768@www262.sakura.ne.jp> <20170606062505.GA18315@infradead.org> From: Igor Stoppa Message-ID: <214229a9-6e64-7351-1609-79c83d75d8c9@huawei.com> Date: Tue, 6 Jun 2017 14:34:04 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170606062505.GA18315@infradead.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.122.225.51] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.59369372.0080,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: ed181ec4a6e04dbbf9ca4d0b7706b84a Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 632 Lines: 18 On 06/06/17 09:25, Christoph Hellwig wrote: > On Tue, Jun 06, 2017 at 01:44:32PM +0900, Tetsuo Handa wrote: [..] >> As far as I know, not all CONFIG_MMU=y architectures provide >> set_memory_ro()/set_memory_rw(). You need to provide fallback for >> architectures which do not provide set_memory_ro()/set_memory_rw() >> or kernels built with CONFIG_MMU=n. > > I think we'll just need to generalize CONFIG_STRICT_MODULE_RWX and/or > ARCH_HAS_STRICT_MODULE_RWX so there is a symbol to key this off. Would STRICT_KERNEL_RWX work? It's already present. If both kernel text and rodata can be protected, so can pmalloc data. --- igor