From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) by kanga.kvack.org (Postfix) with ESMTP id 3785E6B0031 for ; Tue, 17 Jun 2014 08:13:55 -0400 (EDT) Received: by mail-wg0-f48.google.com with SMTP id n12so6833527wgh.31 for ; Tue, 17 Jun 2014 05:13:54 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTP id em6si12349475wib.48.2014.06.17.05.13.52 for ; Tue, 17 Jun 2014 05:13:53 -0700 (PDT) Message-ID: <53A030E9.7010701@redhat.com> Date: Tue, 17 Jun 2014 14:13:29 +0200 From: Florian Weimer MIME-Version: 1.0 Subject: Re: [PATCH v3 0/7] File Sealing & memfd_create() References: <1402655819-14325-1-git-send-email-dh.herrmann@gmail.com> <53A01049.6020502@redhat.com> <53A012C8.7060109@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: David Herrmann 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 On 06/17/2014 12:10 PM, David Herrmann wrote: >>> 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. Hmm. You permit general fallocate even for WRITE seals. That's really unexpected. The inode_newsize_ok check in shmem_fallocate can result in SIGXFSZ, which doesn't seem to be what's intended here. Will the new pages attributed to the process calling fallocate, or to the process calling memfd_create? -- Florian Weimer / Red Hat Product Security Team -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org