Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2322574imm; Tue, 10 Jul 2018 18:17:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe1sGbHFtxk0F15y0W1xPD8dhtWFlZG6g968haBSE1FUBXgdD0AFk+nz40y6mYdNXplURZX X-Received: by 2002:a63:5b0d:: with SMTP id p13-v6mr25014921pgb.202.1531271840320; Tue, 10 Jul 2018 18:17:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531271840; cv=none; d=google.com; s=arc-20160816; b=qeKbsyw7T9IUi7kXwnJ7qQMmaG6/BZBSwmVMntyrc4RlKw/JcBKmtN1Z3QYCmMGqxv Sk5otkZhvHW5d5dtyioPvaIjjtaIt7H1hr7lCq6RnsBfoh9VGxcptgjEy/gYZtKsoPBr mVI3BRKG7o96BRXOKfjyKePUdtGjOHPLtv6+nmSlJoDCaxjUCRGlJbLc3UPOjQiLDu++ +OJqg/qJi+frLQoky/rEatsDl8aAk18fJpz58ui1WPvfYal0MixC+P/5ohiq2/YzUdCA 0Tx6j316QdP+8jEPpIocCAcb4kOfhODx6zKEsJ48AuIXS2ccadYa8NeaPBuEH5r9gKCI 8L6Q== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=k+50sKu+LVEauXWMRCccTo1vpY69SxfsWxgj6voFVSY=; b=tlbubsHdMELUREeDFjwZLMws81PGUPcg2+Njy5T3VwA7ppyU7mk/xoey08SL+qPnVh TLUAGXxmkJ9CvmSEqwbhw3d8MmEKLTd5zbSvt3ypYRKQb/nF0MvfCdrvMULkOzmPAKTZ ybe3EIHkDF3/Y9+8SeNeon0egtBcfhp9tw3riGMpIvXrWeOE+kmAB4RyIX50K52vzwHX /FI07wCuQAnuY1uwY5bN0PxhDZrLw3LAxuiA5/WntZ1wAtO6nOeouGGxJF1uDh0cYN7U pUyqzAt6pESVcYORGhGD/fGN3QKOIWcbhP9dC1DVa6gJtROgCp3HLTck4c4nR71BsMfq tuxQ== ARC-Authentication-Results: i=1; mx.google.com; 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 h16-v6si18655148pli.14.2018.07.10.18.17.05; Tue, 10 Jul 2018 18:17:20 -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; 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 S1732381AbeGKBRI (ORCPT + 99 others); Tue, 10 Jul 2018 21:17:08 -0400 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 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fd3iy-00023i-ED; Wed, 11 Jul 2018 01:15:20 +0000 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: User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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"?