From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751926AbdEJHpW (ORCPT ); Wed, 10 May 2017 03:45:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:45064 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751081AbdEJHpV (ORCPT ); Wed, 10 May 2017 03:45:21 -0400 Date: Wed, 10 May 2017 09:45:19 +0200 From: Michal Hocko To: Igor Stoppa Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dave Hansen Subject: Re: RFC v2: post-init-read-only protection for data allocated dynamically Message-ID: <20170510074518.GE31466@dhcp22.suse.cz> References: <9200d87d-33b6-2c70-0095-e974a30639fd@huawei.com> <20170504112159.GC31540@dhcp22.suse.cz> <83d4556c-b21c-7ae5-6e83-4621a74f9fd5@huawei.com> <20170504131131.GI31540@dhcp22.suse.cz> <20170504140126.GJ31540@dhcp22.suse.cz> <3e798c43-1726-ee7d-add5-762c7e17cb88@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3e798c43-1726-ee7d-add5-762c7e17cb88@huawei.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 05-05-17 15:19:19, Igor Stoppa wrote: > > > On 04/05/17 17:01, Michal Hocko wrote: > > On Thu 04-05-17 16:37:55, Igor Stoppa wrote: > > [...] > > >> The disadvantage is that anything can happen, undetected, while the seal > >> is lifted. > > > > Yes and I think this makes it basically pointless > > ok, this goes a bit beyond what I had in mind initially, but I see your > point > > [...] > > > Just to make my proposal more clear. I suggest the following workflow > > > > cache = kmem_cache_create(foo, object_size, ..., SLAB_SEAL); > > > > obj = kmem_cache_alloc(cache, gfp_mask); > > init_obj(obj) > > [more allocations] > > kmem_cache_seal(cache); > > In case one doesn't want the feature, at which point would it be disabled? > > * not creating the slab > * not sealing it > * something else? If the sealing would be disabled then sealing would be a noop. -- Michal Hocko SUSE Labs