Received: by 10.192.165.148 with SMTP id m20csp4590759imm; Tue, 24 Apr 2018 05:26:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx486BDybU5WJsmu8k2PtuUe9U8rpsh24x9KGAUMqymzZqFprt4eqCrSph4MFxQvsmiGpUDal X-Received: by 10.98.100.11 with SMTP id y11mr20474498pfb.118.1524572763680; Tue, 24 Apr 2018 05:26:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524572763; cv=none; d=google.com; s=arc-20160816; b=KDh9P7/BD5wbpv74v0pT8ocDf7m+l2q9X4U5w0aPtdAET/2B/VmghKCzr9Ond7GuWm Y4zwJ8oliG4Z4XggS2pn+A7Wr2pLCy3FrCHglmolLx8ox3AOLFKXpoWRKoUi3IJ+pqRw Yc6vORCfmKVyFDRfyWhYBVye9/Ifq+SIAqdcq82NFlw1T70oc76l90ujAbcsZUM9oCw8 Pr5XabQ7cuHPUzaJ97Bd/u6I1r5bY0s36QG7DZ3NilcXUD1VzoYT/aQr8BAJ4+L0mcrn 6rmbcagyhTMGj2Et2RDRhryOfczENHMjBG2TVsgetGyZip33CDepP23XRVhe5AFQV7F3 QDig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=OQxt61pkYvcYAj73KHUAVctB9+2XcsegsgjJwH5/Wr0=; b=GIIeat3bD6my3V8ZwSJiHQMTru/O8U87ZF/5nB1/oSnAgkV/MzS5C8avpENFSxMhyb 8ivd1Z4yP37XCFGulP9UfXVYylnczT5xy0W/Wi8kD1xlkNZTXayVCsObX2u9g3KOAWOv W9pjiLZq8izL3eOSnxeGyRXPF0Z5WSyVbHPMsgHK7I+RthSyovaL6RXwzjIUP6rkItdQ mnS23JaWFKoDYk2dNB5emzc7up1xFhtivRtU6/5HpBWNTXL/xZvF3uHAFJpLnu5l/c5Q WwhfXfWmXexyGYN6sHyZp09syLmvHgyhLwfEpFnosKhF+AxLwlkGKbzXfanZKWOCrjyf 3sNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=tGH/q/G3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k3-v6si13449059pld.9.2018.04.24.05.25.49; Tue, 24 Apr 2018 05:26:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=tGH/q/G3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932903AbeDXLvL (ORCPT + 99 others); Tue, 24 Apr 2018 07:51:11 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:51080 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756318AbeDXLvI (ORCPT ); Tue, 24 Apr 2018 07:51:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=OQxt61pkYvcYAj73KHUAVctB9+2XcsegsgjJwH5/Wr0=; b=tGH/q/G3azBV/jVQzmBC1Eba2 w0Stg8lMegPbf2YWYoViMsRvPU60JzLN2bhXrO2+ptbJqqL2Nwj+XpbPyk2x2lJaKhgUBpDpzkAnK LJkSRDVbsjJi/wZkG2HDgiMkR/CRwyK+cFSnXYnZL5Ug1mkHZKYEuxHelHg63eVUlOAfiyiwbaiiN 7IWEuk7dCzwPbeorPxG+R5gpxnPYja3hJV2/qUrACdYcH0EOuVsEhmiMoJ8RoAqEsjgmJsfSkGLfG uNV/ILAHewIc0IHRZdpRSGM90Pc6yABym6FzMEEHaCMjV/+a8bwSvxcDBqR+OI6oEDB/CIZeWhwXI jlx74fTlw==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fAwTD-00083S-7t; Tue, 24 Apr 2018 11:50:51 +0000 Date: Tue, 24 Apr 2018 04:50:50 -0700 From: Matthew Wilcox To: Igor Stoppa Cc: keescook@chromium.org, paul@paul-moore.com, sds@tycho.nsa.gov, mhocko@kernel.org, corbet@lwn.net, labbott@redhat.com, linux-cc=david@fromorbit.com, --cc=rppt@linux.vnet.ibm.com, --security-module@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, Igor Stoppa , Carlos Chinea Perez , Remi Denis Courmont Subject: Re: [PATCH 7/9] Pmalloc Rare Write: modify selected pools Message-ID: <20180424115050.GD26636@bombadil.infradead.org> References: <20180423125458.5338-1-igor.stoppa@huawei.com> <20180423125458.5338-8-igor.stoppa@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180423125458.5338-8-igor.stoppa@huawei.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 23, 2018 at 04:54:56PM +0400, Igor Stoppa wrote: > While the vanilla version of pmalloc provides support for permanently > transitioning between writable and read-only of a memory pool, this > patch seeks to support a separate class of data, which would still > benefit from write protection, most of the time, but it still needs to > be modifiable. Maybe very seldom, but still cannot be permanently marked > as read-only. This seems like a horrible idea that basically makes this feature useless. I would say the right way to do this is to have: struct modifiable_data { struct immutable_data *d; ... }; Then allocate a new pool, change d and destroy the old pool.