Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1411012imm; Sat, 11 Aug 2018 12:52:32 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyyAdQf4TmCoF5pKBefDbtNSTOSpQhlOvyPkNGdr7/HqKIq5I3Hir0or4kqfFb1l+vz2KBX X-Received: by 2002:a65:4c87:: with SMTP id m7-v6mr11056043pgt.98.1534017151945; Sat, 11 Aug 2018 12:52:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534017151; cv=none; d=google.com; s=arc-20160816; b=o+4G+gMHfhTl5Pag3rGP23nY0YQ35tTQcQcMZ+oI9uMmbpPptP7/ndeW1PCBlrUuJZ X2oR/lDj3JRnjWWGiaZMDs5OSeP0ix3xB5ObuOkGlfkJDMGyDZzbk/+jJs+KGgSBzh+E 1HxuOHsHxlDX6rhB/DhO5qkBb/+yrr9hmmCFgk2fhyp2bezO/I3A/tdiPz54ZGV+GDr+ dUCloqosqxAIzlz7lVM0I6+DClK0Cc1dxZTK4MfBMQFkCYInkqS3OtOnifdnkS9MlV0v u7HFsjAhArxNC50cy+CVmWGPYEgrAku9Sfsa5vYkEnhgOGjEVhQhJ2dFdNDoWdZeFnSO y+Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=sf4khYezCdxrT+rmqNy8MWwtEJ/vcYtOYusNjA8nknA=; b=m4eHpUX5rbGlfs0IJ9XjljqGerv9eXsVH7T/dSKXqXc1lIyOIZzE++FgavOHZAhwXn N29DP/Skt6yvH8wOAmEk5C6hnaGn48zVV0QDZlCTbIHYfHSsEf7vJjtNrZvyfaqWTjS8 s9GgB55P44iVaCs9ZkhryU5p2StBOHza/22480Yco9aqqU8btfClhOw+wND8EnFZmopI 4GTaHQnrE8VU0+jUPDQe/7pyKD6r7uAmg8mwhrVEhgTFGaFj2TzeI0tE+1mMHzthWH5/ LDXbWIFW4UMtW00KNn3GSVwDYw6hNVWYo73zx2AXxsufbD3ZPXgeW3bnWQFsENfz/I9M x2ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=TqEMiEkC; 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 d191-v6si11527246pga.157.2018.08.11.12.51.43; Sat, 11 Aug 2018 12:52:31 -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; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=TqEMiEkC; 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 S1727547AbeHKWX1 (ORCPT + 99 others); Sat, 11 Aug 2018 18:23:27 -0400 Received: from sonic311-20.consmr.mail.bf2.yahoo.com ([74.6.131.194]:43331 "EHLO sonic311-20.consmr.mail.bf2.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727514AbeHKWX0 (ORCPT ); Sat, 11 Aug 2018 18:23:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1534016894; bh=sf4khYezCdxrT+rmqNy8MWwtEJ/vcYtOYusNjA8nknA=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=TqEMiEkCy5ofOPn4MVtWVxgz2k5WWxAl4NTlDNu/dCl3FUfrHVxTPDErM9GQDvD1nGEfKc0E1NMN58ZczV3slUU4o9v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uAdpllqUGX ysysAg4E3bzxsE.0W_Zjq7kIgv69z4.bAuqCV_J7f_z1ssFSgbIlcJ4WIkPQ0Ijd.HCZ57N6Y4gh 3QxZcQdVPnFv4afRrAvTvJjhELWTu_BY2mVVByysAcYhC3dWSfxGJBOJ.lSRl.3WnubGnr7ptH51 du9i0Rcs9iLu3tlKB0U9fF2BY133QXj5slF7F8H2rPiLGOLcCLrIArv9EI8TwTenswmI- Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.bf2.yahoo.com with HTTP; Sat, 11 Aug 2018 19:48:14 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO [192.168.0.102]) ([67.169.65.224]) by smtp420.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 023c21f71d5c09aba96ed487ecc5ad84; Sat, 11 Aug 2018 17:48:00 +0000 (UTC) Subject: Re: BUG: Mount ignores mount options To: "Eric W. Biederman" , "Theodore Y. Ts'o" Cc: Al Viro , David Howells , John Johansen , Tejun Heo , selinux@tycho.nsa.gov, Paul Moore , Li Zefan , linux-api@vger.kernel.org, apparmor@lists.ubuntu.com, fenghua.yu@intel.com, Greg Kroah-Hartman , Eric Biggers , linux-security-module@vger.kernel.org, Tetsuo Handa , Johannes Weiner , Stephen Smalley , tomoyo-dev-en@lists.sourceforge.jp, cgroups@vger.kernel.org, torvalds@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Miklos Szeredi References: <153313703562.13253.5766498657900728120.stgit@warthog.procyon.org.uk> <87d0uqpba5.fsf@xmission.com> <20180810151606.GA6515@ZenIV.linux.org.uk> <87pnypiufr.fsf@xmission.com> <20180811014619.GA14368@thunk.org> <8736vlo6ef.fsf@xmission.com> From: Casey Schaufler Message-ID: <001a1608-d0fa-84c1-9c54-ae36df95fd89@schaufler-ca.com> Date: Sat, 11 Aug 2018 10:47:50 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <8736vlo6ef.fsf@xmission.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/10/2018 9:48 PM, Eric W. Biederman wrote: > "Theodore Y. Ts'o" writes: > >> On Fri, Aug 10, 2018 at 08:05:44PM -0500, Eric W. Biederman wrote: >>> My complaint is that the current implemented behavior of practically >>> every filesystem in the kernel, is that it will ignore mount options >>> when mounted a second time. >> The file system is ***not*** mounted a second time. >> >> The design bug is that we allow bind mounts to be specified via a >> block device. A bind mount is not "a second mount" of the file >> system. Bind mounts != mounts. >> >> I had assumed we had allowed bind mounts to be specified via the block >> device because of container use cases. If the container folks don't >> want it, I would be pushing to simply not allow bind mounts to be >> specified via block device at all. > No it is not a container thing. Inigo: "Hello. My name is Inigo Montoya. You killed my father. Prepare to die." Rugen: "Stop saying that!" Eric: "It is not a container thing." Casey: "Stop saying that!" Yes, Virginia, it *is* a container thing. Your container manager expects all filesystems to be server-client based. It makes bad assumptions. It is doing things that we would fire a sysadmin for doing. Don't blame the filesystems for behaving as documented. Export the filesystem using NFS and mount them using the NFS mechanism, which is designed to do what you're asking for. The problem is not in the mount mechanism, it's in the way you want to abuse it. >> The only reason why we should support it is because we don't want to >> break scripts; and if the goal is not to break scripts, then we have >> to keep to the current semantics, however broken you think it is. > But we don't have to support returning filesystems with mismatched mount > options in the new fsopen api. That is my concern. Confusing > userspace this way has been shown to be harmful let's not keep doing it. It's not "userspace" that's confused. Developers of userspace code implementing system behavior (e.g. systemd, container managers) need to understand how the system works. The container manager needs to know that it can't mount filesystems with different options. That's the kind of thing "managers" do. If it has to go to the mount table and check on how the device is already mounted before doing a mount, so be it. Unless, of course, you want the concept of "container" introduced into the kernel. There's a whole lot of feldercarb that container managers have to deal with that would be lots easier to deal with down below. I'm not advocating that, and I understand the arguments against it. On the other hand, if you want a platform that is optimized for a container environment ... > Eric