Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp740409imm; Wed, 17 Oct 2018 07:37:00 -0700 (PDT) X-Google-Smtp-Source: ACcGV63bn1UaqykewrNGtyAtYxLqdu1y/SKKN7rXaDJvH6RmU2BRQ8Yzg2tyX72edRrciXehCV7Y X-Received: by 2002:a65:648f:: with SMTP id e15-v6mr25336529pgv.250.1539787020445; Wed, 17 Oct 2018 07:37:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539787020; cv=none; d=google.com; s=arc-20160816; b=Eettrr4/SIoJZwMgcYAf4g8Cvuwb/KfPaQ9vXuy79F2dOiprm09YKkwi3FOmXWii+2 7NHVq7XbMLQaM9UffLGPrENteDiiLp6Woz01VZmS37CEn9SHJLMLMLpCbf64zSPEp7VY xq+2uA8ngbRWjIJIeNqgl9XNTqkF0sMadmMx8g2WZUFnjcIMFxvMwgg3AS7ztrWK00RI +WxeCkAi9+hOrZkZGQMenJfPPB1B4cl6AfNYvu6BiOFIMraT6GjEu44TVndEOCzf3W+1 WPbNAHUsX7/qbFvgPEf/nqA8pzyNbeq81uNm2P8pwX1PyUbFbVmAxN46Cl0kGQ516ToQ fxhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:user-agent:message-id:in-reply-to:date:references:cc :to:from; bh=Gum8o2hqhHGAr9+XI/McyYRZ6k/BYwZV8fCl6s/S0bA=; b=YmnADTwHkgGV7ooC8uBJQ0SPZdrzUFc7D5FtUZHDrFFILDZ+cLXR01VMLWnW1EeqBy ZHVvGbk4MwF5yvjg+cUqIj6Q1XjXmeBSN6JgBFSfZCyGCYYIKLdAOD6D3Is/lHiMPsiq 1Rz8wrrOr2AjM+vEL6IoSNHlhQ8iviPjiF7LmqfKbtL8mC6zJZf0QbKHLscuF8MjZcCT ATdMoRPwCazEXmXsL3GNizo20c8gUBDutErXpTiDD00HIELQWb6JBaMqnqwjdj3I9mSA Gj8dq0BZYok6l2c3VhNT8gG2EG88FuUVdJ/DqxWQ+DLizH5zS+Qxyg9K8bhmdqaaAhBT z59A== 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 h33-v6si14550115plh.56.2018.10.17.07.36.44; Wed, 17 Oct 2018 07:37:00 -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 S1727410AbeJQWcD convert rfc822-to-8bit (ORCPT + 99 others); Wed, 17 Oct 2018 18:32:03 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:54666 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727040AbeJQWcD (ORCPT ); Wed, 17 Oct 2018 18:32:03 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1gCmvb-0000oe-W0; Wed, 17 Oct 2018 08:36:04 -0600 Received: from 67-3-154-154.omah.qwest.net ([67.3.154.154] 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 1gCmvb-0002fB-0g; Wed, 17 Oct 2018 08:36:03 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Alan Jenkins Cc: David Howells , Al Viro , linux-api@vger.kernel.org, torvalds@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, mszeredi@redhat.com References: <19866.1539782101@warthog.procyon.org.uk> <68a2107f-bf70-055b-86cf-1ba2ba9422bf@gmail.com> <153754740781.17872.7869536526927736855.stgit@warthog.procyon.org.uk> <153754766004.17872.9829232103614083565.stgit@warthog.procyon.org.uk> <9b8bf436-65de-13b9-0002-0479d11c18ca@gmail.com> <20181013061141.GR32577@ZenIV.linux.org.uk> <28710.1539782412@warthog.procyon.org.uk> Date: Wed, 17 Oct 2018 09:35:45 -0500 In-Reply-To: (Alan Jenkins's message of "Wed, 17 Oct 2018 15:31:26 +0100") Message-ID: <87woqgiqta.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-XM-SPF: eid=1gCmvb-0002fB-0g;;;mid=<87woqgiqta.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=67.3.154.154;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19hcb5RQKjAH6x0dAjbhxUx+4sBQrfVGB4= X-SA-Exim-Connect-IP: 67.3.154.154 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=2.0 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,TVD_RCVD_IP,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01, T_TooManySym_02,XMNoVowels,XMSubLong autolearn=disabled version=3.4.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4994] * 0.0 TVD_RCVD_IP Message was received from an IP address * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa05 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.0 T_TooManySym_02 5+ unique symbols in subject X-Spam-DCC: XMission; sa05 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Alan Jenkins X-Spam-Relay-Country: X-Spam-Timing: total 152 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 2.4 (1.6%), b_tie_ro: 1.72 (1.1%), parse: 0.67 (0.4%), extract_message_metadata: 2.3 (1.5%), get_uri_detail_list: 0.90 (0.6%), tests_pri_-1000: 3.1 (2.0%), tests_pri_-950: 0.98 (0.6%), tests_pri_-900: 0.78 (0.5%), tests_pri_-400: 17 (11.3%), check_bayes: 16 (10.6%), b_tokenize: 4.7 (3.1%), b_tok_get_all: 6 (3.7%), b_comp_prob: 1.46 (1.0%), b_tok_touch_all: 2.7 (1.8%), b_finish: 0.56 (0.4%), tests_pri_0: 111 (73.1%), check_dkim_signature: 0.42 (0.3%), check_dkim_adsp: 3.1 (2.0%), tests_pri_10: 1.70 (1.1%), tests_pri_500: 6 (3.8%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 31/34] vfs: syscall: Add fspick() to select a superblock for reconfiguration [ver #12] 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 Alan Jenkins writes: > On 17/10/2018 14:20, David Howells wrote: >> David Howells wrote: >> >>> I should probably check that the picked point is actually a mountpoint. >> The root of the mount object at the path specified, that is, perhaps with >> something like the attached. >> >> David > > > I agree.  I'm happy to see this is using the same check as do_remount(). > > > * change filesystem flags. dir should be a physical root of filesystem. > * If you've mounted a non-root directory somewhere and want to do remount > * on it - tough luck. > */ Davids check will work for bind mounts as well. It just won't work it just won't work for files or subdirectories of some mountpoint. Eric >> --- >> diff --git a/fs/fsopen.c b/fs/fsopen.c >> index f673e93ac456..aaaaa17a233c 100644 >> --- a/fs/fsopen.c >> +++ b/fs/fsopen.c >> @@ -186,6 +186,10 @@ SYSCALL_DEFINE3(fspick, int, dfd, const char __user *, path, unsigned int, flags >> if (ret < 0) >> goto err; >> + ret = -EINVAL; >> + if (target.mnt->mnt_root != target.dentry) >> + goto err_path; >> + >> fc = vfs_new_fs_context(target.dentry->d_sb->s_type, target.dentry, >> 0, 0, FS_CONTEXT_FOR_RECONFIGURE); >> if (IS_ERR(fc)) { >>