From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753968AbaFQKKX (ORCPT ); Tue, 17 Jun 2014 06:10:23 -0400 Received: from mail-ig0-f171.google.com ([209.85.213.171]:60090 "EHLO mail-ig0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751737AbaFQKKV (ORCPT ); Tue, 17 Jun 2014 06:10:21 -0400 MIME-Version: 1.0 In-Reply-To: <53A012C8.7060109@redhat.com> References: <1402655819-14325-1-git-send-email-dh.herrmann@gmail.com> <53A01049.6020502@redhat.com> <53A012C8.7060109@redhat.com> Date: Tue, 17 Jun 2014 12:10:20 +0200 Message-ID: Subject: Re: [PATCH v3 0/7] File Sealing & memfd_create() From: David Herrmann To: Florian Weimer Cc: Andy Lutomirski , "linux-kernel@vger.kernel.org" , Michael Kerrisk , Ryan Lortie , Linus Torvalds , Andrew Morton , "linux-mm@kvack.org" , Linux FS Devel , Linux API , Greg Kroah-Hartman , John Stultz , Lennart Poettering , Daniel Mack , Kay Sievers , Hugh Dickins , Tony Battersby Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi On Tue, Jun 17, 2014 at 12:04 PM, Florian Weimer wrote: > On 06/17/2014 12:01 PM, David Herrmann wrote: > >>> I don't think this is what potential users expect because mlock requires >>> capabilities which are not available to them. >>> >>> A couple of weeks ago, sealing was to be applied to anonymous shared >>> memory. >>> Has this changed? Why should *reading* it trigger OOM? >> >> The file might have holes, therefore, you'd have to allocate backing >> pages. This might hit a soft-limit and fail. To avoid this, use >> fallocate() to allocate pages prior to mmap() > > This does not work because the consuming side does not know how the > descriptor was set up if sealing does not imply that. The consuming side has to very seals via F_GET_SEALS. After that, it shall do a simple fallocate() on the whole file if it wants to go sure that all pages are allocated. Why shouldn't that be possible? Please elaborate. Thanks David