Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp76988imm; Fri, 10 Aug 2018 07:53:57 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzes5/fpCmMSnjpf7qJ4DEJG0BNuixngMeN8sN8A0ipEiFJw9fpJKbVyggYxqUJPrUgcHVc X-Received: by 2002:a65:4b87:: with SMTP id t7-v6mr6636820pgq.391.1533912837396; Fri, 10 Aug 2018 07:53:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533912837; cv=none; d=google.com; s=arc-20160816; b=yxjcHK+XwT/Fh7qNl3iwpC21Cz0Pw8pNzXfzRXPurrOrLUwSvBg1T5AtMGa8d80wbr bF6tZttL665os3/e2lMg2uuZFdtE/N0/1ZT6eeE7LuAEkpiATgNf5Cn8pDonmzm8mowe DLo515B4V/t/wSnX/71QOjhgDtOa3WIVLFCjdLRp1u9QfROA7SUXqUoaXu/MunEaj2dS 9FBWeQj+Zw4WDdnKVgBL/0rv2YurKgMpEm/gvm75JcDpnY5l+5S7r4VSSA2i5nCkK0x5 PTEYiQ9eLIiRuKVTMooPG+6dWHLs11bdw4wfhCipw7AFBRsYxFt2nozLOJ/0NA7keiJd DRfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:mime-version:user-agent :message-id:in-reply-to:date:references:cc:to:from :arc-authentication-results; bh=nbVE0DbDArPTS2U+qnVuiifIfmtqiXv4D6aPPqgVK5Q=; b=X5rYRMzmitT5Sf3RWUeyjcPGtl+RkWPOLTN+S3+pCzXc5/jhsEwTNSRN23+54qjfwz tIWFZVa9d/6xpdow8fOLd6KfATeZTbtw5by6vByOqTdbOg2PWoWO5rT69RigLboLjLdI RPfHMc3Zm4+zaReGV/dL9CdykTNvlqNtqMi40+f9AJltQ9PixWccA3e9dQGbhSrYWWlO /3VHxPGHk2kv9xQ+cNdQOdkkmuXCxwKP1jVuHHEpGuuMElnG+JyEvcRgG8wMkLk/ZwHM +//CXxWkvgR15QSmk5tN94/qlj2jhK4+fUXFZGbBLwBXo9xpPoaxhceAp7KKMBygtrvZ qNGw== 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 d30-v6si7766474pla.64.2018.08.10.07.53.42; Fri, 10 Aug 2018 07:53:57 -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 S1727980AbeHJQfs (ORCPT + 99 others); Fri, 10 Aug 2018 12:35:48 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:59438 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727209AbeHJQfs (ORCPT ); Fri, 10 Aug 2018 12:35:48 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fo82t-0000WJ-CF; Fri, 10 Aug 2018 08:05:39 -0600 Received: from [97.119.167.31] (helo=x220.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fo82s-0003iQ-KM; Fri, 10 Aug 2018 08:05:39 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: David Howells Cc: viro@zeniv.linux.org.uk, John Johansen , Tejun Heo , selinux@tycho.nsa.gov, Paul Moore , Li Zefan , linux-api@vger.kernel.org, apparmor@lists.ubuntu.com, Casey Schaufler , 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, "Theodore Y. Ts'o" , Miklos Szeredi References: <153313703562.13253.5766498657900728120.stgit@warthog.procyon.org.uk> Date: Fri, 10 Aug 2018 09:05:22 -0500 In-Reply-To: <153313703562.13253.5766498657900728120.stgit@warthog.procyon.org.uk> (David Howells's message of "Wed, 01 Aug 2018 16:23:56 +0100") Message-ID: <87d0uqpba5.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1fo82s-0003iQ-KM;;;mid=<87d0uqpba5.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.119.167.31;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+56a5RGWuqSbdDITYOIfsW1/M5QV9eOGs= X-SA-Exim-Connect-IP: 97.119.167.31 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa05.xmission.com X-Spam-Level: X-Spam-Status: No, score=-0.2 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG autolearn=disabled version=3.4.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4996] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa05 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa05 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;David Howells X-Spam-Relay-Country: X-Spam-Timing: total 271 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 2.4 (0.9%), b_tie_ro: 1.61 (0.6%), parse: 0.83 (0.3%), extract_message_metadata: 10 (3.7%), get_uri_detail_list: 1.76 (0.6%), tests_pri_-1000: 6 (2.0%), tests_pri_-950: 1.16 (0.4%), tests_pri_-900: 0.99 (0.4%), tests_pri_-400: 27 (10.1%), check_bayes: 26 (9.8%), b_tokenize: 9 (3.3%), b_tok_get_all: 9 (3.4%), b_comp_prob: 2.5 (0.9%), b_tok_touch_all: 3.9 (1.4%), b_finish: 0.59 (0.2%), tests_pri_0: 215 (79.5%), check_dkim_signature: 0.54 (0.2%), check_dkim_adsp: 4.2 (1.5%), tests_pri_500: 4.4 (1.6%), rewrite_mail: 0.00 (0.0%) Subject: BUG: Mount ignores mount options X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is a serious problem with mount options today that fsopen does not address. The problem is that mount options are ignored for block based filesystems, and any other type of filesystem that follows the same pattern. The script below demonstrates this bug. Showing this bug can cause the ext4 "acl" "quota" and "user_xattr" options to be silently ignored. fsopen has my nack until it addresses this issue. I don't know if we can fix this in the context of sys_mount. But we if we are redoing the option parsing of how we mount filesystems this needs to be fixed before we start worrying about bug compatibility. Hopefully this report is simple and clear enough that we can at least agree on the problem. Eric # cat ~/bin/bdev-loop0.sh #!/bin/sh set -x set -e LOOP=loop0 dd if=/dev/zero bs=1024 count=1048576 of=$LOOP-file losetup /dev/$LOOP $LOOP-file mkfs.ext4 /dev/$LOOP mkdir $LOOP-noacl-noquota-nouser_xattr mount -t ext4 /dev/$LOOP -o "noacl,noquota,nouser_xattr" $LOOP-noacl-noquota-nouser_xattr mkdir $LOOP-acl-quota-user_xattr mount -t ext4 /dev/$LOOP -o "acl,quota,user_xattr" $LOOP-acl-quota-user_xattr cat /proc/mounts | grep loop0 root@finagle:~# ~/bin/bdev-loop0.sh + set -e + LOOP=loop0 + dd if=/dev/zero bs=1024 count=1048576 of=loop0-file 1048576+0 records in 1048576+0 records out 1073741824 bytes (1.1 GB) copied, 4.37645 s, 245 MB/s + losetup /dev/loop0 loop0-file + mkfs.ext4 /dev/loop0 mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 65536 inodes, 262144 blocks 13107 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=268435456 8 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376 Writing inode tables: done Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 29 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. + mkdir loop0-noacl-noquota-nouser_xattr + mount -t ext4 /dev/loop0 -o noacl,noquota,nouser_xattr loop0-noacl-noquota-nouser_xattr + mkdir loop0-acl-quota-user_xattr + mount -t ext4 /dev/loop0 -o acl,quota,user_xattr loop0-acl-quota-user_xattr + + grep loop0 cat /proc/mounts /dev/loop0 /root/loop0-noacl-noquota-nouser_xattr ext4 rw,relatime,nouser_xattr,noacl 0 0 /dev/loop0 /root/loop0-acl-quota-user_xattr ext4 rw,relatime,nouser_xattr,noacl 0 0