Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp734872imm; Wed, 17 Oct 2018 07:32:15 -0700 (PDT) X-Google-Smtp-Source: ACcGV61lKUdUs4m4/b60uy10G/5ItlL5jJDtRChnwsgZJsJmQeRuJBGurkVzkZAcFNT4LrVU0UCX X-Received: by 2002:a63:e141:: with SMTP id h1-v6mr24692398pgk.47.1539786735375; Wed, 17 Oct 2018 07:32:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539786735; cv=none; d=google.com; s=arc-20160816; b=UAxwkD0AkwZ3QvVoRvZN2ldanmbIByabA+bIyjVKm78THxpfo9bELsc5dXKiOuHYj9 GrjW+1N7mVbVdq9NeZ2RuqEbhR15lTZCV5rTvnP96zxvRiaE++I9gy/M0pncy8RYemfc 3JKT8aPoOorp4xFuaNJSk1x4E3oIMrG4JNIBEOU9fgOb9rlUx3ElX3PkzHD2LNhapbve uZ3MSIh+XLA+btT11uJl0u5jtmhOT98A8OE3FDIIffro55txa9penavL/PrLwa31XwV6 BJsneALmYo4NiGDDqKknTeU23tInLGp8zOMVjK+DzU1hixsG0i+eE1bvY9ii/idFgS0A 1/dw== 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; bh=NPIKIPq9BbMekCEEtHCrFC8HC9DTO2TYmRrXrWkDHxw=; b=Ex/ugkvDKG1OUZepwp7W3bbYRGwVLqJUV8sEU+sMGTbDrGUaLh3wRVlCV3C0WOVhyO zGAWSlm4bTQ8ZYfU8gfXPH+TO29KsocWCetzz9nejKEFbJkG6NU0e2w7XL0V0g+HnoiR mNEmLS72tihJx+838itVuN1YIG1reBlKaoBw0KymWEiHPI2OqBkq5kvWMCZG3nmvY1qe m5gIYgDuskvKQI8JzKIFgs/sQRa3F835IFIFnfgkwxwaNQ8p+4/3deFWTCQYjiOEYx7i Lv198WrBpDLwYhDk6Bt5+z32/l1LajE+6YiW6revUGkgR4TLc8C/BKDOTLTAdumjuoty 4Ucg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="j1juynr/"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s1-v6si16994621plr.141.2018.10.17.07.31.59; Wed, 17 Oct 2018 07:32:15 -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=@gmail.com header.s=20161025 header.b="j1juynr/"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727483AbeJQW12 (ORCPT + 99 others); Wed, 17 Oct 2018 18:27:28 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36820 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727032AbeJQW11 (ORCPT ); Wed, 17 Oct 2018 18:27:27 -0400 Received: by mail-wr1-f66.google.com with SMTP id y16so29967544wrw.3; Wed, 17 Oct 2018 07:31:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=NPIKIPq9BbMekCEEtHCrFC8HC9DTO2TYmRrXrWkDHxw=; b=j1juynr/i2dCIkzhfUeh6nL6KKDp/J0ds9pWT0rz09kdh66T0V7Cy/rKv5lAwwqk7G j1UoSL2814JqvIr2fBWqlkw5LNwqTjOjzH+Z/5rGs64BSMvys0YbpfSfVaRVWrMucotY 0MioKQOU7EMPg0rQCS61OcSVKodGkgvYbB4fgOc57JeMJ5S9M0IaWwWUGo+E70wAZ0bJ tXdZ10Bt/5zSZrOGI9/1orWxVYjtJgpVhogF7GvptWzlXQ3ZUtNNgD5/emaofREcTHI8 hg4OSFsFunWJ+Odr8jctaubqgPJS3lyCMvhBFHS2rO/yR/63ob+G9nXh1rlbYmXN2+tP hozA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=NPIKIPq9BbMekCEEtHCrFC8HC9DTO2TYmRrXrWkDHxw=; b=BF9RiU/bx6W45eCVZU63DzZd6iIrfNGZ1Nfw9KtN2HxJYc4aLzgC3R3CvjLHpwGWRb W9j7VTAWZwTbRxeMuckR1uF8cv8i7fiisrLbbJQjdFuXjVzgJlX+J4PWiFh/u8qA6Ul2 9mECnIhkqy/tHnnz8C9Se4vXLfelIYSPILU7yXYMQOxUhuHga25ZxgVU6TOHJ0Krf/vr qnKtWg5zAlYMx3r4EhhbClbPapvezXKmOS/tk+Sl6TnuDk7uwStDUO3Lff69cwlmjLv+ KMmF4XGyp+be9eHNzzk81rwVjWEGEUMuMbIeOX0bG9/sSYTUKR8pfR4bKCdm65/QWfRD 8ZTw== X-Gm-Message-State: ABuFfohNmQH45TvSJcn7p8SyFJlogS16h+W0IfJ9CM35Sk/MVr5D6G0d N6NDi98CVpHFKvw8ofhIba9MO0vMUW0= X-Received: by 2002:a05:6000:12c5:: with SMTP id l5mr23251940wrx.215.1539786688298; Wed, 17 Oct 2018 07:31:28 -0700 (PDT) Received: from [172.16.1.192] (host-89-243-172-161.as13285.net. [89.243.172.161]) by smtp.gmail.com with ESMTPSA id w11-v6sm27541529wrn.65.2018.10.17.07.31.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Oct 2018 07:31:27 -0700 (PDT) Subject: Re: [PATCH 31/34] vfs: syscall: Add fspick() to select a superblock for reconfiguration [ver #12] To: David Howells Cc: Al Viro , linux-api@vger.kernel.org, torvalds@linux-foundation.org, ebiederm@xmission.com, 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> From: Alan Jenkins Message-ID: Date: Wed, 17 Oct 2018 15:31:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <28710.1539782412@warthog.procyon.org.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. */ Thanks Alan > --- > 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)) { >