Received: by 10.192.165.148 with SMTP id m20csp4999874imm; Tue, 1 May 2018 07:29:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpP83BR3R/GfZfVFDiAU82NvX4Qfo0yr5IA4OW16y5i8XH/S6mATeAfPPOiLhOksfgrUaH+ X-Received: by 2002:a17:902:680c:: with SMTP id h12-v6mr16736572plk.113.1525184986880; Tue, 01 May 2018 07:29:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525184986; cv=none; d=google.com; s=arc-20160816; b=nb/oNQuXVAzXVAsZ12Dj4Yb8Vbip3arAgHzUiAEAa9XVVTlP3aAT2LrBRpX4MVdILu I6ZQuWBOhLCQAWDgV/S4UyHD9zsWz4mPX72oWBGxGGP41QMY8Yaz7C28ymDUkIClfYV9 pMOiMyxL49d5wly/x9I3ZaxgXkA2FNZFhwi+PHLLZ3da7BtDrknkwl+h5XX7npmkUvaZ JVhU8AyuRxzclnJm6aBXKdI9F5e94XjRaX6KzHqVY3GBjvYeXYcwK1X5ZPgp1w33FTph NNDHXq7y+Qx4Pe1QP28x34VN6b3lpejmK/KGStIDXMpUhRtb7r/0AcABvCgsLQBloPha xl0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-transfer-encoding :content-id:mime-version:subject:cc:to:references:in-reply-to:from :organization:arc-authentication-results; bh=AX5+4m+AzhjN8SfwLSxLf8envElS686Y8FtpoNwYvGM=; b=TRdFlDVnpzwpfTxf66dpKseOrovnbbIeLyH9teHXpcWAwPl1+ueaEpikPARgjibKgw jDvFjfae1eqVD7UmIieata415F5Mu0AQyDjiooQy9OU91Zq/2GxhvQJgVR6rHNUWF+Ll CnYpn+fPT+jJC48UW4K57xF+bzN97LI1nxfQ9fIUURgaXukH/0+3e01CwNX2ozlZexXB wnq/ZHuYjfkJJIfx9dJ9U0uDlgweYl+wbscP0Bha3MMvL3lZThyNmz7tfj19xSVSlhkc g+fMNGEooGG9fhpwppSYJSAkPNJ943cuWu9B3xygETBKUdfGuBUvABX3FYllr/q/LE60 r6Aw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay8-v6si9701641plb.244.2018.05.01.07.29.32; Tue, 01 May 2018 07:29:46 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756018AbeEAO3O convert rfc822-to-8bit (ORCPT + 99 others); Tue, 1 May 2018 10:29:14 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43858 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755935AbeEAO3M (ORCPT ); Tue, 1 May 2018 10:29:12 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BC09B401DECE; Tue, 1 May 2018 14:29:11 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-121-117.rdu2.redhat.com [10.10.121.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id C9FFB215CDA7; Tue, 1 May 2018 14:29:10 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <05034a85-013b-30b6-ce17-4c95d4cab195@infradead.org> References: <05034a85-013b-30b6-ce17-4c95d4cab195@infradead.org> <152414466005.23902.12967974041384198114.stgit@warthog.procyon.org.uk> <152414468332.23902.3065751107691714414.stgit@warthog.procyon.org.uk> To: Randy Dunlap Cc: dhowells@redhat.com, viro@zeniv.linux.org.uk, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org Subject: Re: [PATCH 03/24] VFS: Introduce the structs and doc for a filesystem context [ver #7] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <8449.1525184950.1@warthog.procyon.org.uk> Content-Transfer-Encoding: 8BIT Date: Tue, 01 May 2018 15:29:10 +0100 Message-ID: <8450.1525184950@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 01 May 2018 14:29:11 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 01 May 2018 14:29:11 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Randy Dunlap wrote: > > + (2) Parse the options and attach them to the context. Options may be passed > > + individually from userspace. > > Does this say that step (2) can be multiple small steps? Perhaps "phase (2)" would be a better name than "step (2)". During (2), multiple argument-supplying calls may be made. > How does step (2) know when userspace has completed sending individual > options? Moving to phase (3) terminates phase (2). This is triggered by userspace writing "x create" or "x reconfigure" to the fd as things stand. > > + (6) Return an error message attached to the context. > > where/how is this done? That got taken out and made general - which Linus then objected to. I need to reinsert this and make it fscontext-specific as most people would really like to have it, the mount process being able to produce so many weird and wonderful errors. > > +When the VFS creates this, it allocates ->fs_context_size bytes (as specified > > +by the file_system_type object) to hold both the fs_context struct and any > > +extra data required by the filesystem. The fs_context struct is placed at the > > +beginning of this space. Any extra space beyond that is for use by the > > +filesystem. The filesystem should wrap the struct in its own, e.g.: > > in its own struct, e.g.: How about "... The filesystem should wrap the struct in one of its own, e.g."? > > + (*) int security_fs_context_parse_option(struct fs_context *fc, char *opt); > > + > > + Called for each mount option. The arguments are as for the > > + ->parse_option() method. An active LSM may reject one with an error, pass > > + one over and return 0 or consume one and return 1. If consumed, the > > What does "pass one over" mean? How about: An active LSM may return 0 to pass the option on to the filesystem, 1 to cause the option to be discarded or an error to cause the option to be rejected. David