From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:44278 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732278AbeGKBRI (ORCPT ); Tue, 10 Jul 2018 21:17:08 -0400 Date: Wed, 11 Jul 2018 02:15:20 +0100 From: Al Viro To: Linus Torvalds Cc: Andy Lutomirski , David Howells , Linux API , linux-fsdevel , Linux Kernel Mailing List , Jann Horn Subject: Re: [PATCH 24/32] vfs: syscall: Add fsopen() to prepare for superblock creation [ver #9] Message-ID: <20180711011520.GL30522@ZenIV.linux.org.uk> References: <153126248868.14533.9751473662727327569.stgit@warthog.procyon.org.uk> <153126264966.14533.3388004240803696769.stgit@warthog.procyon.org.uk> <686E805C-81F3-43D0-A096-50C644C57EE3@amacapital.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Jul 10, 2018 at 06:05:49PM -0700, Linus Torvalds wrote: > Yeah, Andy is right that we should *not* make "write()" have side effects. > > Use it to queue things by all means, but not "do" things. Not unless > there's a very sane security model. > > On Tue, Jul 10, 2018 at 4:59 PM Andy Lutomirski wrote: > > > > I think the right solution is one of: > > > > (a) Pass a netlink-formatted blob to fsopen() and do the whole thing in one syscall. I don’t mean using netlink sockets — just the nlattr format. Or you could use a different format. The part that matters is using just one syscall to do the whole thing. > > Please no. Not another nasty marshalling thing. > > > (b) Keep the current structure but use a new syscall instead of write(). > > > > (c) Keep using write() but literally just buffer the data. Then have a new syscall to commit it. In other words, replace “x” with a syscall and call all the fs_context_operations helpers in that context instead of from write(). > > But yeah, b-or-c sounds fine. Umm... How about "use credentials of opener for everything"?