From patchwork Wed Jun 19 12:30:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 11004073 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 02ADD924 for ; Wed, 19 Jun 2019 12:32:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E809E2882F for ; Wed, 19 Jun 2019 12:32:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB9B7288B7; Wed, 19 Jun 2019 12:32:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 764F228A1A for ; Wed, 19 Jun 2019 12:32:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731708AbfFSMa2 (ORCPT ); Wed, 19 Jun 2019 08:30:28 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38204 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727457AbfFSMa2 (ORCPT ); Wed, 19 Jun 2019 08:30:28 -0400 Received: by mail-wr1-f66.google.com with SMTP id d18so3211673wrs.5 for ; Wed, 19 Jun 2019 05:30:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZQFy3noIgLzCKKvfJTpCDEkL2tduUrGhw500s5XjKOM=; b=g0BTj9yauutw14/4gfPtBttftwnfRexlk0M4VoLCcgXE38LwSsU0st19h51tPKGAyd 81ZTIJsoW8bFaIYdbvIxetrrAKzZ/c9FCAFZe9HOkMdXTlikl6wUV7ZIoF97tIXnenU5 ztPNAjGHTCW1c+iOpzil4J0GLm2cZJUEsN0XmvcMjCTlMR3Si7k++UQQsc8EA7mwkM5F KSHmj8Y+gT6mIEfRaMWuAqlB4MDfCeTX+2zCPnEl4XgoeF7YD04PwolBTGJnWiArA1mv uXn+gEGJ2p75sXuhLg2olxDNvX/1wIUmR9AT6kVZiUd1VVns79Kz/VvB93PonLLl0eyl owBg== X-Gm-Message-State: APjAAAWnXJXPTkT5TYUNhqD/LQWwlJNGvQWUK35008XJ2FLjegy1K7Wk C4b98bY8jOKlN1uTon6TfI216A== X-Google-Smtp-Source: APXvYqyM0eIINJF5V89HnKZUprBMY1GZ2O4C7V7moar/rzzhLkG1oS4KKMtGfJ/P9Up2vnllSLiCCw== X-Received: by 2002:adf:ec0f:: with SMTP id x15mr87257157wrn.165.1560947425796; Wed, 19 Jun 2019 05:30:25 -0700 (PDT) Received: from miu.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id 11sm1837513wmd.23.2019.06.19.05.30.23 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 05:30:24 -0700 (PDT) From: Miklos Szeredi To: David Howells Cc: Al Viro , Ian Kent , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/13] vfs: verify param type in vfs_parse_sb_flag() Date: Wed, 19 Jun 2019 14:30:07 +0200 Message-Id: <20190619123019.30032-1-mszeredi@redhat.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP vfs_parse_sb_flag() accepted any kind of param with a matching key, not just a flag. This is wrong, only allow flag type and return -EINVAL otherwise. Signed-off-by: Miklos Szeredi --- fs/fs_context.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/fs/fs_context.c b/fs/fs_context.c index 103643c68e3f..e56310fd8c75 100644 --- a/fs/fs_context.c +++ b/fs/fs_context.c @@ -81,30 +81,29 @@ static const char *const forbidden_sb_flag[] = { /* * Check for a common mount option that manipulates s_flags. */ -static int vfs_parse_sb_flag(struct fs_context *fc, const char *key) +static int vfs_parse_sb_flag(struct fs_context *fc, struct fs_parameter *param) { - unsigned int token; + const char *key = param->key; + unsigned int set, clear; unsigned int i; for (i = 0; i < ARRAY_SIZE(forbidden_sb_flag); i++) if (strcmp(key, forbidden_sb_flag[i]) == 0) return -EINVAL; - token = lookup_constant(common_set_sb_flag, key, 0); - if (token) { - fc->sb_flags |= token; - fc->sb_flags_mask |= token; - return 0; - } + set = lookup_constant(common_set_sb_flag, key, 0); + clear = lookup_constant(common_clear_sb_flag, key, 0); + if (!set && !clear) + return -ENOPARAM; - token = lookup_constant(common_clear_sb_flag, key, 0); - if (token) { - fc->sb_flags &= ~token; - fc->sb_flags_mask |= token; - return 0; - } + if (param->type != fs_value_is_flag) + return invalf(fc, "%s: Unexpected value for '%s'", + fc->fs_type->name, param->key); - return -ENOPARAM; + fc->sb_flags |= set; + fc->sb_flags &= ~clear; + fc->sb_flags_mask |= set | clear; + return 0; } /** @@ -130,7 +129,7 @@ int vfs_parse_fs_param(struct fs_context *fc, struct fs_parameter *param) if (!param->key) return invalf(fc, "Unnamed parameter\n"); - ret = vfs_parse_sb_flag(fc, param->key); + ret = vfs_parse_sb_flag(fc, param); if (ret != -ENOPARAM) return ret; From patchwork Wed Jun 19 12:30:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 11004029 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8FA17112C for ; Wed, 19 Jun 2019 12:30:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D1D1283C3 for ; Wed, 19 Jun 2019 12:30:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71135288B7; Wed, 19 Jun 2019 12:30:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A9EC28803 for ; Wed, 19 Jun 2019 12:30:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731790AbfFSMab (ORCPT ); Wed, 19 Jun 2019 08:30:31 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:51624 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731427AbfFSMaa (ORCPT ); Wed, 19 Jun 2019 08:30:30 -0400 Received: by mail-wm1-f68.google.com with SMTP id 207so1588733wma.1 for ; Wed, 19 Jun 2019 05:30:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NVPnLeIv971f025k0CXEVACXNX2ckV29nGAgqfri3so=; b=o9ryebJtyFJjq43yQIKfwAz9K5Kf7LEZOgnGoIQEI94chN7svmZ15ob2/D3EBJxwzr 2rWBdIZxzmIBs7RIdyYOlW7j0P4hXj7yIpgS7rx+Xn9tUBGoH02ukF8zKVqTQn5rYOEy DN0yDqWQ0thqWDM7OWC5UFOW4QvHp76OXRbZIM8pwCo6V+bXXenKnStQ5tBqGFij9reZ b6A0Ub1N6uct2YEoU4O2OYiAm6z+zq0Tbxdh4X1ko+ivpzbdewQtE84xZmdKm29ONw+E QPP8ZdZHXz/7ko7HkHcwRkdpI9zj03bkzu+RCdjVmMuSa9OsCaNEc9Puq/4Sui0nrVN1 4lmQ== X-Gm-Message-State: APjAAAVukXzOYzAWHOrVUDSVrvdiPmyYiPsqSUoqUGeyCM2uztMYe/bq eKjwIMO0kHM3LqNY7hjl9Oc7TA== X-Google-Smtp-Source: APXvYqzncdXtuPhfGwULjbWMrB268X3YQkOcb42lp3YuSywCSatwWWMFFsHdc7kraOvkXl4lQKZrMQ== X-Received: by 2002:a7b:ca43:: with SMTP id m3mr8465369wml.45.1560947427727; Wed, 19 Jun 2019 05:30:27 -0700 (PDT) Received: from miu.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id 11sm1837513wmd.23.2019.06.19.05.30.25 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 05:30:26 -0700 (PDT) From: Miklos Szeredi To: David Howells Cc: Al Viro , Ian Kent , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/13] vfs: move vfs_parse_sb_flag() calls into filesystems Date: Wed, 19 Jun 2019 14:30:08 +0200 Message-Id: <20190619123019.30032-2-mszeredi@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190619123019.30032-1-mszeredi@redhat.com> References: <20190619123019.30032-1-mszeredi@redhat.com> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move parsing "standard" options into filesystems' ->parse_param(). This patch doesn't change behavior. This is in preparation for allowing filesystems to reject options that they don't support. Signed-off-by: Miklos Szeredi --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 6 +++++- fs/afs/super.c | 6 +++++- fs/fs_context.c | 12 +++++++----- fs/fuse/control.c | 1 + fs/hugetlbfs/inode.c | 6 +++++- fs/proc/root.c | 6 +++++- fs/sysfs/mount.c | 1 + include/linux/fs_context.h | 1 + ipc/mqueue.c | 1 + kernel/cgroup/cgroup-v1.c | 6 +++++- kernel/cgroup/cgroup.c | 6 +++++- kernel/cgroup/cpuset.c | 1 + 12 files changed, 42 insertions(+), 11 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 2131b8bbaad7..83d3c358f95e 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -2051,7 +2051,11 @@ static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param) { struct rdt_fs_context *ctx = rdt_fc2context(fc); struct fs_parse_result result; - int opt; + int ret, opt; + + ret = vfs_parse_sb_flag(fc, param); + if (ret != -ENOPARAM) + return ret; opt = fs_parse(fc, &rdt_fs_parameters, param, &result); if (opt < 0) diff --git a/fs/afs/super.c b/fs/afs/super.c index f18911e8d770..7f032d08781b 100644 --- a/fs/afs/super.c +++ b/fs/afs/super.c @@ -321,7 +321,11 @@ static int afs_parse_param(struct fs_context *fc, struct fs_parameter *param) { struct fs_parse_result result; struct afs_fs_context *ctx = fc->fs_private; - int opt; + int ret, opt; + + ret = vfs_parse_sb_flag(fc, param); + if (ret != -ENOPARAM) + return ret; opt = fs_parse(fc, &afs_fs_parameters, param, &result); if (opt < 0) diff --git a/fs/fs_context.c b/fs/fs_context.c index e56310fd8c75..a9f314390b99 100644 --- a/fs/fs_context.c +++ b/fs/fs_context.c @@ -81,7 +81,7 @@ static const char *const forbidden_sb_flag[] = { /* * Check for a common mount option that manipulates s_flags. */ -static int vfs_parse_sb_flag(struct fs_context *fc, struct fs_parameter *param) +int vfs_parse_sb_flag(struct fs_context *fc, struct fs_parameter *param) { const char *key = param->key; unsigned int set, clear; @@ -105,6 +105,7 @@ static int vfs_parse_sb_flag(struct fs_context *fc, struct fs_parameter *param) fc->sb_flags_mask |= set | clear; return 0; } +EXPORT_SYMBOL(vfs_parse_sb_flag); /** * vfs_parse_fs_param - Add a single parameter to a superblock config @@ -129,10 +130,6 @@ int vfs_parse_fs_param(struct fs_context *fc, struct fs_parameter *param) if (!param->key) return invalf(fc, "Unnamed parameter\n"); - ret = vfs_parse_sb_flag(fc, param); - if (ret != -ENOPARAM) - return ret; - ret = security_fs_context_parse_param(fc, param); if (ret != -ENOPARAM) /* Param belongs to the LSM or is disallowed by the LSM; so @@ -561,6 +558,11 @@ static int legacy_parse_param(struct fs_context *fc, struct fs_parameter *param) struct legacy_fs_context *ctx = fc->fs_private; unsigned int size = ctx->data_size; size_t len = 0; + int ret; + + ret = vfs_parse_sb_flag(fc, param); + if (ret != -ENOPARAM) + return ret; if (strcmp(param->key, "source") == 0) { if (param->type != fs_value_is_string) diff --git a/fs/fuse/control.c b/fs/fuse/control.c index 14ce1e47f980..c35013ed7f65 100644 --- a/fs/fuse/control.c +++ b/fs/fuse/control.c @@ -351,6 +351,7 @@ static int fuse_ctl_get_tree(struct fs_context *fc) static const struct fs_context_operations fuse_ctl_context_ops = { .get_tree = fuse_ctl_get_tree, + .parse_param = vfs_parse_fs_param, }; static int fuse_ctl_init_fs_context(struct fs_context *fc) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 1dcc57189382..89125cc36d0e 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -1149,7 +1149,11 @@ static int hugetlbfs_parse_param(struct fs_context *fc, struct fs_parameter *par struct fs_parse_result result; char *rest; unsigned long ps; - int opt; + int ret, opt; + + ret = vfs_parse_sb_flag(fc, param); + if (ret != -ENOPARAM) + return ret; opt = fs_parse(fc, &hugetlb_fs_parameters, param, &result); if (opt < 0) diff --git a/fs/proc/root.c b/fs/proc/root.c index 8b145e7b9661..6ef1527ad975 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c @@ -56,7 +56,11 @@ static int proc_parse_param(struct fs_context *fc, struct fs_parameter *param) { struct proc_fs_context *ctx = fc->fs_private; struct fs_parse_result result; - int opt; + int ret, opt; + + ret = vfs_parse_sb_flag(fc, param); + if (ret != -ENOPARAM) + return ret; opt = fs_parse(fc, &proc_fs_parameters, param, &result); if (opt < 0) diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c index 1b56686ab178..ba576a976e8c 100644 --- a/fs/sysfs/mount.c +++ b/fs/sysfs/mount.c @@ -49,6 +49,7 @@ static void sysfs_fs_context_free(struct fs_context *fc) static const struct fs_context_operations sysfs_fs_context_ops = { .free = sysfs_fs_context_free, + .parse_param = vfs_parse_sb_flag, .get_tree = sysfs_get_tree, }; diff --git a/include/linux/fs_context.h b/include/linux/fs_context.h index d476ff0c10df..39f4d8b0a390 100644 --- a/include/linux/fs_context.h +++ b/include/linux/fs_context.h @@ -127,6 +127,7 @@ extern struct fs_context *fs_context_for_submount(struct file_system_type *fs_ty struct dentry *reference); extern struct fs_context *vfs_dup_fs_context(struct fs_context *fc); +extern int vfs_parse_sb_flag(struct fs_context *fc, struct fs_parameter *param); extern int vfs_parse_fs_param(struct fs_context *fc, struct fs_parameter *param); extern int vfs_parse_fs_string(struct fs_context *fc, const char *key, const char *value, size_t v_size); diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 216cad1ff0d0..557aa887996a 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -1577,6 +1577,7 @@ static const struct super_operations mqueue_super_ops = { static const struct fs_context_operations mqueue_fs_context_ops = { .free = mqueue_fs_context_free, + .parse_param = vfs_parse_sb_flag, .get_tree = mqueue_get_tree, }; diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c index 88006be40ea3..f960e6149311 100644 --- a/kernel/cgroup/cgroup-v1.c +++ b/kernel/cgroup/cgroup-v1.c @@ -927,7 +927,11 @@ int cgroup1_parse_param(struct fs_context *fc, struct fs_parameter *param) struct cgroup_fs_context *ctx = cgroup_fc2context(fc); struct cgroup_subsys *ss; struct fs_parse_result result; - int opt, i; + int ret, opt, i; + + ret = vfs_parse_sb_flag(fc, param); + if (ret != -ENOPARAM) + return ret; opt = fs_parse(fc, &cgroup1_fs_parameters, param, &result); if (opt == -ENOPARAM) { diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index bf9dbffd46b1..93890285b510 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -1834,7 +1834,11 @@ static int cgroup2_parse_param(struct fs_context *fc, struct fs_parameter *param { struct cgroup_fs_context *ctx = cgroup_fc2context(fc); struct fs_parse_result result; - int opt; + int ret, opt; + + ret = vfs_parse_sb_flag(fc, param); + if (ret != -ENOPARAM) + return ret; opt = fs_parse(fc, &cgroup2_fs_parameters, param, &result); if (opt < 0) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 515525ff1cfd..025f6c6083a3 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -394,6 +394,7 @@ static int cpuset_get_tree(struct fs_context *fc) } static const struct fs_context_operations cpuset_fs_context_ops = { + .parse_param = vfs_parse_sb_flag, .get_tree = cpuset_get_tree, }; From patchwork Wed Jun 19 12:30:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 11004031 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 376101580 for ; Wed, 19 Jun 2019 12:30:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27EE5283C3 for ; Wed, 19 Jun 2019 12:30:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2646D28803; Wed, 19 Jun 2019 12:30:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFF812887B for ; Wed, 19 Jun 2019 12:30:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731799AbfFSMab (ORCPT ); Wed, 19 Jun 2019 08:30:31 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:44303 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731786AbfFSMab (ORCPT ); Wed, 19 Jun 2019 08:30:31 -0400 Received: by mail-wr1-f67.google.com with SMTP id r16so20486wrl.11 for ; Wed, 19 Jun 2019 05:30:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=syOsz+pCnNIc/qrQgZM4/GIrteB9uldeCUT6WZA8hVM=; b=pigQAMdpk+6PC+9aWFTYUsXx5C1YWifYLNlVK0HCHPmNfJ5CvCDoGh4GRXUEj4Xn35 q6w4qDWJFPlbCRgrXazl5pn1CvdA8rATYOw7F9HYE4pPZKAK1hlemXq7CROeJlOA7WYZ 6wJrx1IoQ0soifmH3FMlIo+wc6wivvSX5WNNLv6uDoVAFD8FYpVRv0SbxgvhwWygbZfG 7pQ7Ft/J2VmBufGm5ExanbKIQ8jx7QJPzc3scU+Ne9OfICWnMiAaLXM/SSaCRpAfKVng 4wMhPOqTLGw8LSaBdwCtPXWza+Lu1//74is2Og148m1SUzlEDHvqoMKVFVQyNvxEk7cQ rdiQ== X-Gm-Message-State: APjAAAWxQUIMHyucxu9gAgO95EDP3Umsq6NPwofU0PrrtCdi636W2tUf bs+UUzv+29Sos+2V5hQnjxpZMw== X-Google-Smtp-Source: APXvYqyjzkTgS7F88coETlRjgqd7E9iaHcb9QaeY+SJUGxkfZmk3cECPjwg/IA9yNUyKVxPD4Cdb2g== X-Received: by 2002:a5d:56c1:: with SMTP id m1mr3035374wrw.26.1560947429205; Wed, 19 Jun 2019 05:30:29 -0700 (PDT) Received: from miu.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id 11sm1837513wmd.23.2019.06.19.05.30.27 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 05:30:28 -0700 (PDT) From: Miklos Szeredi To: David Howells Cc: Al Viro , Ian Kent , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/13] vfs: don't parse forbidden flags Date: Wed, 19 Jun 2019 14:30:09 +0200 Message-Id: <20190619123019.30032-3-mszeredi@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190619123019.30032-1-mszeredi@redhat.com> References: <20190619123019.30032-1-mszeredi@redhat.com> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Impossible to keep this blacklist properly synced with what mount(8) parses and what it doesn't. E.g. it has various forms of "*atime" options, but not "atime"... Other than being impossible to maintain, it also makes little sense. So just get rid of it. Signed-off-by: Miklos Szeredi --- fs/fs_context.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/fs/fs_context.c b/fs/fs_context.c index a9f314390b99..cbf89117a507 100644 --- a/fs/fs_context.c +++ b/fs/fs_context.c @@ -55,29 +55,6 @@ static const struct constant_table common_clear_sb_flag[] = { { "silent", SB_SILENT }, }; -static const char *const forbidden_sb_flag[] = { - "bind", - "dev", - "exec", - "move", - "noatime", - "nodev", - "nodiratime", - "noexec", - "norelatime", - "nostrictatime", - "nosuid", - "private", - "rec", - "relatime", - "remount", - "shared", - "slave", - "strictatime", - "suid", - "unbindable", -}; - /* * Check for a common mount option that manipulates s_flags. */ @@ -85,11 +62,6 @@ int vfs_parse_sb_flag(struct fs_context *fc, struct fs_parameter *param) { const char *key = param->key; unsigned int set, clear; - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(forbidden_sb_flag); i++) - if (strcmp(key, forbidden_sb_flag[i]) == 0) - return -EINVAL; set = lookup_constant(common_set_sb_flag, key, 0); clear = lookup_constant(common_clear_sb_flag, key, 0); From patchwork Wed Jun 19 12:30:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 11004069 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2C9EE924 for ; Wed, 19 Jun 2019 12:31:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CA93283AD for ; Wed, 19 Jun 2019 12:31:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1136E28818; Wed, 19 Jun 2019 12:31:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD341283AD for ; Wed, 19 Jun 2019 12:31:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731814AbfFSMad (ORCPT ); Wed, 19 Jun 2019 08:30:33 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36968 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731427AbfFSMac (ORCPT ); Wed, 19 Jun 2019 08:30:32 -0400 Received: by mail-wr1-f66.google.com with SMTP id v14so3213138wrr.4 for ; Wed, 19 Jun 2019 05:30:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Vz+znNR3F5kjJHoZn9Crk81ccCGx1/tiF7Xfm+PRQVc=; b=nkheu9B/7aEURQMMqQuchxG0miiWUHHQNpz8MZLHm+x+RLDTi/n/hLnNtdlAOnzF09 TM5GhswmWpSRfnidvUvMZ9Y6mR3sDtSnMb59f/9Uq6xer8BMrAUXjjj2Mi+2ugzwHArc 9U/pf+xTZkJU3jNORp489Y5rV4y94dDgzsvHLe69aIg3a9y+nx8lAt0/9rTyScHdAQ9Q xR1bLh/z+8XY8TTy8+sYGSF1gpdbR3MG5jq//JSEwFsR/yrrLIRC5uNjnGCqySSaABn3 kNUofnVc4DlmOAKLOD7/g249gl8G1INW6DKH7z92v01CTXFeyaiih2nYfwadBWpDjZoJ 9Q2A== X-Gm-Message-State: APjAAAUXttAnyZsn12ltQZU+VkNt0tq3wSJXI6LnxJqQXxsjUP4R48DE /MbyhhG6G6DftPHFXjq/s3E3svy18ao= X-Google-Smtp-Source: APXvYqwz5ogA7h2G+mp6k4mHrwtXmsKu8SbTaB/WQVZOvIU+slS295oTNMYD8Kyv4OO88vNv8l44ig== X-Received: by 2002:a5d:6549:: with SMTP id z9mr22487471wrv.63.1560947430518; Wed, 19 Jun 2019 05:30:30 -0700 (PDT) Received: from miu.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id 11sm1837513wmd.23.2019.06.19.05.30.29 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 05:30:29 -0700 (PDT) From: Miklos Szeredi To: David Howells Cc: Al Viro , Ian Kent , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/13] vfs: don't parse "posixacl" option Date: Wed, 19 Jun 2019 14:30:10 +0200 Message-Id: <20190619123019.30032-4-mszeredi@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190619123019.30032-1-mszeredi@redhat.com> References: <20190619123019.30032-1-mszeredi@redhat.com> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Unlike the others, this is _not_ a standard option accepted by mount(8). In fact SB_POSIXACL is an internal flag, and accepting MS_POSIXACL on the mount(2) interface is possibly a bug. The only filesystem that apparently wants to handle the "posixacl" option is 9p, but it has special handling of that option besides setting SB_POSIXACL. Signed-off-by: Miklos Szeredi --- fs/fs_context.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/fs_context.c b/fs/fs_context.c index cbf89117a507..49636e541293 100644 --- a/fs/fs_context.c +++ b/fs/fs_context.c @@ -42,7 +42,6 @@ static const struct constant_table common_set_sb_flag[] = { { "dirsync", SB_DIRSYNC }, { "lazytime", SB_LAZYTIME }, { "mand", SB_MANDLOCK }, - { "posixacl", SB_POSIXACL }, { "ro", SB_RDONLY }, { "sync", SB_SYNCHRONOUS }, }; From patchwork Wed Jun 19 12:30:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 11004033 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C0F25924 for ; Wed, 19 Jun 2019 12:30:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B16E2283AD for ; Wed, 19 Jun 2019 12:30:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A61342887B; Wed, 19 Jun 2019 12:30:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 531A828681 for ; Wed, 19 Jun 2019 12:30:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731838AbfFSMae (ORCPT ); Wed, 19 Jun 2019 08:30:34 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:51631 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731804AbfFSMad (ORCPT ); Wed, 19 Jun 2019 08:30:33 -0400 Received: by mail-wm1-f67.google.com with SMTP id 207so1588985wma.1 for ; Wed, 19 Jun 2019 05:30:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Mkwu/3OEXZGqXJyUnO5ri3H818oiUy7gpX5xDSptxL0=; b=TSyXhLLf4CmFTkGNCOoBtHFmO22rt36UCLr/PsfHCH7ImaZ54RBRFe6VncExwFywEA Oy5WWy1A6s+naf4fFJaxYZoA520H58ttaMPGi42XXOd2EjAg7vMJihDH5wc9ba9Qbg9f 2KCVXR4lg7P2Qa2CnXuyaCCXP9tia3qpPbOzKKRaPU/r2x6I133l63iJVIBiI79DbZlB A+BlSiPv+qzIQJAahuIuAIXKaAdKPEDTfQXQGcCGVyx8qLkBDQgkU0Xab2qYEVbdJXvh tAm1LKEOFFVYJ12kd6ZUnGerW4QmrpuAl1p1SaAHb1p6BuXN1YbYOMejqZlhPIIpAoL8 J5FQ== X-Gm-Message-State: APjAAAXHRsbx0DXFwFm3CkumTLVo+B+EjOwpReRPvuMfm7XQXVVxbNie oqUHhEO6iQJkMXDOHzS6n15Ebg== X-Google-Smtp-Source: APXvYqzhG/Ojq+ugu+NGlKLRr7Xa/HPx8OL4GK+QnjWlXZC3Xx84s21vw7gBF3qzuyD/LyRnzB0ihw== X-Received: by 2002:a1c:7d56:: with SMTP id y83mr8459959wmc.77.1560947431788; Wed, 19 Jun 2019 05:30:31 -0700 (PDT) Received: from miu.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id 11sm1837513wmd.23.2019.06.19.05.30.30 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 05:30:31 -0700 (PDT) From: Miklos Szeredi To: David Howells Cc: Al Viro , Ian Kent , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/13] vfs: don't parse "silent" option Date: Wed, 19 Jun 2019 14:30:11 +0200 Message-Id: <20190619123019.30032-5-mszeredi@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190619123019.30032-1-mszeredi@redhat.com> References: <20190619123019.30032-1-mszeredi@redhat.com> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP While this is a standard option as documented in mount(8), it is ignored by most filesystems. So reject, unless filesystem explicitly wants to handle it. The exception is unconverted filesystems, where it is unknown if the filesystem handles this or not. Any implementation, such as mount(8) that needs to parse this option without failing should simply ignore the return value from fsconfig(). Signed-off-by: Miklos Szeredi --- fs/fs_context.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/fs_context.c b/fs/fs_context.c index 49636e541293..c26b353aa858 100644 --- a/fs/fs_context.c +++ b/fs/fs_context.c @@ -51,7 +51,6 @@ static const struct constant_table common_clear_sb_flag[] = { { "nolazytime", SB_LAZYTIME }, { "nomand", SB_MANDLOCK }, { "rw", SB_RDONLY }, - { "silent", SB_SILENT }, }; /* @@ -535,6 +534,9 @@ static int legacy_parse_param(struct fs_context *fc, struct fs_parameter *param) if (ret != -ENOPARAM) return ret; + if (strcmp(param->key, "silent") == 0) + fc->sb_flags |= SB_SILENT; + if (strcmp(param->key, "source") == 0) { if (param->type != fs_value_is_string) return invalf(fc, "VFS: Legacy: Non-string source"); From patchwork Wed Jun 19 12:30:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 11004051 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3A334924 for ; Wed, 19 Jun 2019 12:31:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A00422BF1 for ; Wed, 19 Jun 2019 12:31:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E74A28767; Wed, 19 Jun 2019 12:31:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE6FD2867C for ; Wed, 19 Jun 2019 12:31:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731851AbfFSMah (ORCPT ); Wed, 19 Jun 2019 08:30:37 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:42888 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731796AbfFSMah (ORCPT ); Wed, 19 Jun 2019 08:30:37 -0400 Received: by mail-wr1-f65.google.com with SMTP id x17so3172962wrl.9 for ; Wed, 19 Jun 2019 05:30:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aEJZvAaP0gZ3BGwiRkcb3jZB35A1QSUJKdWyF6hsB/4=; b=jPhxz51lcC5kXxoQgrVuxN7AYq1VyMXbNS17mdRAIG178sdXkyGyTch5uWM6GzCkhr 5LlcbvrfE1oPQg9L33jvgWpX5+CQHnf4H8c1cfU0skcoLrblsE9Atb/Ea++X+T2acIuJ fWQFJXhAFpqdfURHojLiV3jPzsvLEMAb3rzZUOKVBNiy01jy+Z4xlW/INE4R9U9E8GsR w/9FNzX3QokIQB1AMOK8PM7z89YBfgLnGqMaeTA2FV1cUiy/N23DnccL3BWg0c7/JGkM 49TjCnlLgIAvUcD5hOHAYdUJyCSREmGlYLrGGs5k3NDMdyoRky9GAI1ygFcKbElwGXzl QJhA== X-Gm-Message-State: APjAAAVRROAI9kQ+5xPEEesyvnnua+DR8awtuxIZgMskwROKFcjSl6n/ zKiZMtpRIbMI13XQyWUh1hSi8g== X-Google-Smtp-Source: APXvYqx+pORYHinPI1RPJLOFGKWiPjDYT7ZAsQ/FYO/zLto8APQKogtIGI+TjNYrCayP0MLlUNfRAg== X-Received: by 2002:adf:fc85:: with SMTP id g5mr86528327wrr.324.1560947435212; Wed, 19 Jun 2019 05:30:35 -0700 (PDT) Received: from miu.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id 11sm1837513wmd.23.2019.06.19.05.30.33 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 05:30:33 -0700 (PDT) From: Miklos Szeredi To: David Howells Cc: Al Viro , Ian Kent , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/13] vfs: new helper: vfs_parse_ro_rw() Date: Wed, 19 Jun 2019 14:30:12 +0200 Message-Id: <20190619123019.30032-6-mszeredi@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190619123019.30032-1-mszeredi@redhat.com> References: <20190619123019.30032-1-mszeredi@redhat.com> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This just parses the "ro" and "rw" options and sets sb_flags accordingly. Signed-off-by: Miklos Szeredi --- fs/fs_context.c | 18 ++++++++++++++++++ include/linux/fs_context.h | 1 + 2 files changed, 19 insertions(+) diff --git a/fs/fs_context.c b/fs/fs_context.c index c26b353aa858..5012ab7650ec 100644 --- a/fs/fs_context.c +++ b/fs/fs_context.c @@ -77,6 +77,24 @@ int vfs_parse_sb_flag(struct fs_context *fc, struct fs_parameter *param) } EXPORT_SYMBOL(vfs_parse_sb_flag); +int vfs_parse_ro_rw(struct fs_context *fc, struct fs_parameter *param) +{ + if (strcmp(param->key, "ro") == 0) + fc->sb_flags |= SB_RDONLY; + else if (strcmp(param->key, "rw") == 0) + fc->sb_flags &= ~SB_RDONLY; + else + return -ENOPARAM; + + if (param->type != fs_value_is_flag) + return invalf(fc, "%s: Unexpected value for '%s'", + fc->fs_type->name, param->key); + + fc->sb_flags_mask |= SB_RDONLY; + return 0; +} +EXPORT_SYMBOL(vfs_parse_ro_rw); + /** * vfs_parse_fs_param - Add a single parameter to a superblock config * @fc: The filesystem context to modify diff --git a/include/linux/fs_context.h b/include/linux/fs_context.h index 39f4d8b0a390..bff6796a89ef 100644 --- a/include/linux/fs_context.h +++ b/include/linux/fs_context.h @@ -128,6 +128,7 @@ extern struct fs_context *fs_context_for_submount(struct file_system_type *fs_ty extern struct fs_context *vfs_dup_fs_context(struct fs_context *fc); extern int vfs_parse_sb_flag(struct fs_context *fc, struct fs_parameter *param); +extern int vfs_parse_ro_rw(struct fs_context *fc, struct fs_parameter *param); extern int vfs_parse_fs_param(struct fs_context *fc, struct fs_parameter *param); extern int vfs_parse_fs_string(struct fs_context *fc, const char *key, const char *value, size_t v_size); From patchwork Wed Jun 19 12:30:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 11004049 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 09C79924 for ; Wed, 19 Jun 2019 12:31:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE7B327C0B for ; Wed, 19 Jun 2019 12:31:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2FFD28767; Wed, 19 Jun 2019 12:31:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 908692853E for ; Wed, 19 Jun 2019 12:31:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731859AbfFSMbM (ORCPT ); Wed, 19 Jun 2019 08:31:12 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:39278 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731846AbfFSMai (ORCPT ); Wed, 19 Jun 2019 08:30:38 -0400 Received: by mail-wm1-f68.google.com with SMTP id z23so1644123wma.4 for ; Wed, 19 Jun 2019 05:30:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zH+k6ndWzHXcUGt/1dQWHzCs9DtuO0deMfiOOMoKDp4=; b=spvvZjMOjVAkWyORI9b37NHQqZkuL/TY8zlw77GlVWts/tq6EsH44u9pjIHZVl6kJQ pSe/p+pNKZlQizmlIZToNUWIT3CZaIT/Qktt0qvu2RPHSaGryycKkaW+Nta9yKzpTsIo MbmUlXJjK1reYHR7cF3JkqXYHMSdVwbYl5fXgY+UJXwEnqsp5qeeuum8syDreYkZzskD 8HkQkxAtwbvftUkzFFR9VBnZzsYRY3I2u2nULz0xtY+pPHLw7GwTmoCGYSxgWH64g9I0 PeQWEBjRRyAD6NKm6DtC9OSdnj84bAZNGP3JKgFG2/vchf3c6eMxV8JrPfglbylV8nbn 544g== X-Gm-Message-State: APjAAAXWWFTc+v5fDCxXaf3VR7QZPfEaB9/3VcaBYL0RxgmcYhAdEn3I GnKTa0/x1Z7EYhQW1HYhh8TKww== X-Google-Smtp-Source: APXvYqzuyPwUZiu30WPoQqiKG/EAE+hhjNevOIChGgYRXYTK/dXvHdqIoIpAjRdiAlQh9pVuex6Smw== X-Received: by 2002:a1c:6585:: with SMTP id z127mr8881330wmb.25.1560947436334; Wed, 19 Jun 2019 05:30:36 -0700 (PDT) Received: from miu.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id 11sm1837513wmd.23.2019.06.19.05.30.35 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 05:30:35 -0700 (PDT) From: Miklos Szeredi To: David Howells Cc: Al Viro , Ian Kent , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/13] proc: don't ignore options Date: Wed, 19 Jun 2019 14:30:13 +0200 Message-Id: <20190619123019.30032-7-mszeredi@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190619123019.30032-1-mszeredi@redhat.com> References: <20190619123019.30032-1-mszeredi@redhat.com> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The options "sync", "async", "dirsync", "lazytime", "nolazytime", "mand" and "nomand" make no sense for the proc filesystem. If these options are supplied to fsconfig(FSCONFIG_SET_FLAG), then return -EINVAL instead of silently ignoring the option. Any implementation, such as mount(8) that needs to parse this option without failing should simply ignore the return value from fsconfig(). Signed-off-by: Miklos Szeredi --- fs/proc/root.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/proc/root.c b/fs/proc/root.c index 6ef1527ad975..70127eaba04d 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c @@ -58,7 +58,7 @@ static int proc_parse_param(struct fs_context *fc, struct fs_parameter *param) struct fs_parse_result result; int ret, opt; - ret = vfs_parse_sb_flag(fc, param); + ret = vfs_parse_ro_rw(fc, param); if (ret != -ENOPARAM) return ret; From patchwork Wed Jun 19 12:30:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 11004035 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E3A6E1580 for ; Wed, 19 Jun 2019 12:30:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3F5927C0B for ; Wed, 19 Jun 2019 12:30:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CEABD2856F; Wed, 19 Jun 2019 12:30:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7885B28803 for ; Wed, 19 Jun 2019 12:30:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731808AbfFSMak (ORCPT ); Wed, 19 Jun 2019 08:30:40 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:37419 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731857AbfFSMaj (ORCPT ); Wed, 19 Jun 2019 08:30:39 -0400 Received: by mail-wm1-f65.google.com with SMTP id f17so1646965wme.2 for ; Wed, 19 Jun 2019 05:30:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3XPGarDbNQvdg9HgXJCH37X+Od5kwHmLIcOjFshcWxM=; b=hAlfqUKJKxH1CtozGbhxNCIvoRpYgLHHuO+VyP5no3jt9BY+TNmDubu9IRLuVRAYXl y0Mk0V68OzfL+AZcYGl7vmitWDwm9Q/9/KIzUx3L5aU023v8ymPwzOcaDRYV4rU9HTTQ gmh21JcDpmhnFAFyOCCgncl6BsorALVrGVA7LOL7Qh2HhrUjVel3lNHWZo3fgJG8h2Qz lIsGQlH112KyCo9DS9Q0alieyt8PDrVkel7ZHAXdhR1RpoQyxj71+SKpmyTTgb3CuF6F mVyT/6ZKyVEz3hu6Izw6ZUGSLKZWkRGgATo930by+nD9E3F8/fZ/hKN9g9DLGh7GwTv7 6ASQ== X-Gm-Message-State: APjAAAUDyr+pgrEKPSRFQ+Fppo0BhF12+KIUDVYFUEfVF8E+G/LOMRla qgmGRXC3D3xH0nyvLc39Lq67hw== X-Google-Smtp-Source: APXvYqxRFzpttWVNpTPiQbdLpMWn0xb6IHJ5FyTailY17pShWafJilfmh1UScZ9oGl2gwVqFz8iRLA== X-Received: by 2002:a05:600c:214e:: with SMTP id v14mr8496323wml.96.1560947437553; Wed, 19 Jun 2019 05:30:37 -0700 (PDT) Received: from miu.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id 11sm1837513wmd.23.2019.06.19.05.30.36 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 05:30:37 -0700 (PDT) From: Miklos Szeredi To: David Howells Cc: Al Viro , Ian Kent , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/13] sysfs: don't ignore options Date: Wed, 19 Jun 2019 14:30:14 +0200 Message-Id: <20190619123019.30032-8-mszeredi@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190619123019.30032-1-mszeredi@redhat.com> References: <20190619123019.30032-1-mszeredi@redhat.com> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The options "sync", "async", "dirsync", "lazytime", "nolazytime", "mand" and "nomand" make no sense for the sysfs filesystem. If these options are supplied to fsconfig(FSCONFIG_SET_FLAG), then return -EINVAL instead of silently ignoring the option. Any implementation, such as mount(8) that needs to parse this option without failing should simply ignore the return value from fsconfig(). Signed-off-by: Miklos Szeredi --- fs/sysfs/mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c index ba576a976e8c..4797b7952fc5 100644 --- a/fs/sysfs/mount.c +++ b/fs/sysfs/mount.c @@ -49,7 +49,7 @@ static void sysfs_fs_context_free(struct fs_context *fc) static const struct fs_context_operations sysfs_fs_context_ops = { .free = sysfs_fs_context_free, - .parse_param = vfs_parse_sb_flag, + .parse_param = vfs_parse_ro_rw, .get_tree = sysfs_get_tree, }; From patchwork Wed Jun 19 12:30:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 11004047 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51E961580 for ; Wed, 19 Jun 2019 12:31:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42CE2283AD for ; Wed, 19 Jun 2019 12:31:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 376BC28767; Wed, 19 Jun 2019 12:31:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6384283AD for ; Wed, 19 Jun 2019 12:31:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731845AbfFSMbL (ORCPT ); Wed, 19 Jun 2019 08:31:11 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36994 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731869AbfFSMak (ORCPT ); Wed, 19 Jun 2019 08:30:40 -0400 Received: by mail-wr1-f68.google.com with SMTP id v14so3213685wrr.4 for ; Wed, 19 Jun 2019 05:30:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cdQVoNmmq/tpICs94VWnUfb4xhH0uHVfAUpoN+yDuN4=; b=Y62kbKkx7jGuoTK8UlQKUtExlnegycyWya9bGSmsjeb4SIwkCcaGqaJB4f6/E+d0UF /yHII4BxSBawOV8HYjBopu2ftTWkmIaxg8ItoGyTqOHEV8fP+pZrqqLDpWhz71yO3sY7 VfZJkcb3SknGCjUD1ht40qkb3oa4YraJ/4lwiUAlRcoOmbquZGSkPlikwB/Km11QaqMa k419FAdZzZ3ybJAGSQUCBKzYQwqz0HlNXTmBiPxP9Lq3s0POP8U/9NYxflRll/q7rdke 7uPotV3e9xbyXTZwfCScGy3XDDwZtGFfd2THX8CyC5mV4XzTvtbsCK+dulfI6Yk+uMxP G39A== X-Gm-Message-State: APjAAAVPbD1Z60O0s00mtqPyhId1+YnQai1opi7K1E47WjbQusnnYWsk f4+ukInjvZSPR62blBskzuMKXw== X-Google-Smtp-Source: APXvYqzgc/pTXrx3oLCjioNyxDtYbyoBKOJfXCsDmaWxhuRtivEE9x9bE9zw/wRPVqXoUt4DZF9cvQ== X-Received: by 2002:adf:efcb:: with SMTP id i11mr37772543wrp.188.1560947438884; Wed, 19 Jun 2019 05:30:38 -0700 (PDT) Received: from miu.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id 11sm1837513wmd.23.2019.06.19.05.30.37 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 05:30:38 -0700 (PDT) From: Miklos Szeredi To: David Howells Cc: Al Viro , Ian Kent , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/13] mqueue: don't ignore options Date: Wed, 19 Jun 2019 14:30:15 +0200 Message-Id: <20190619123019.30032-9-mszeredi@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190619123019.30032-1-mszeredi@redhat.com> References: <20190619123019.30032-1-mszeredi@redhat.com> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The options "sync", "async", "dirsync", "lazytime", "nolazytime", "mand" and "nomand" make no sense for the mqueue filesystem. If these options are supplied to fsconfig(FSCONFIG_SET_FLAG), then return -EINVAL instead of silently ignoring the option. Any implementation, such as mount(8) that needs to parse this option without failing should simply ignore the return value from fsconfig(). Signed-off-by: Miklos Szeredi --- ipc/mqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 557aa887996a..1e8567c20d6a 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -1577,7 +1577,7 @@ static const struct super_operations mqueue_super_ops = { static const struct fs_context_operations mqueue_fs_context_ops = { .free = mqueue_fs_context_free, - .parse_param = vfs_parse_sb_flag, + .parse_param = vfs_parse_ro_rw, .get_tree = mqueue_get_tree, }; From patchwork Wed Jun 19 12:30:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 11004041 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5DB9E924 for ; Wed, 19 Jun 2019 12:30:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DACA283AD for ; Wed, 19 Jun 2019 12:30:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41A6428617; Wed, 19 Jun 2019 12:30:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9BDC28508 for ; Wed, 19 Jun 2019 12:30:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731891AbfFSMao (ORCPT ); Wed, 19 Jun 2019 08:30:44 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:55093 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731878AbfFSMan (ORCPT ); Wed, 19 Jun 2019 08:30:43 -0400 Received: by mail-wm1-f67.google.com with SMTP id g135so1579405wme.4 for ; Wed, 19 Jun 2019 05:30:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U+fZF4p8UXoG115rrzAt76mcBbpeZ8uSJfCJdMqpJmo=; b=lb69jvKkz4vvnQo/2X6dzS8Nce6sWtVEbeheN6rcm+Pal7kN2gX99xBamVT/mftRs5 gM+i5bfMbH9YYBub8R/XMOVU9FHp0ZgEvksi9CBbjfaRhQ5VAuiZgCCfcAauq0nbASEO K/JdorWScQH/ALB2V/z9W75Vnbvj43zxl2YNC9RE6vSkHl1rJ7Ee6ZL6s+hOHC2ZobQM Czl1DwOphpb3ipDk0yhA9iWBoXs8hFpnyQUbLsqUnCFeb3EWSNYprJxyoQa65zFw6Fwi pbYrqSmnxX/uo9ArDwPVEpjYL8hHCniXDqJtXPqK/GrihaQxDHIqZNN0Ozr/xxoFA8IP LaAw== X-Gm-Message-State: APjAAAV75PKhHGMXdqlOMfJlAc9cNgPKhJkvkO0ksNNb5bXOhnpVbLYh RaGW4KWdbZtkE/vf5Iyo6wFVkw== X-Google-Smtp-Source: APXvYqxOFvgzAiwoliKXheRHN29zlWhShNiFpi+wWSWUHY8gLlo8vKWqRpXQ0haoqcTS2XPWsi/GyQ== X-Received: by 2002:a1c:6585:: with SMTP id z127mr8881636wmb.25.1560947441267; Wed, 19 Jun 2019 05:30:41 -0700 (PDT) Received: from miu.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id 11sm1837513wmd.23.2019.06.19.05.30.38 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 05:30:39 -0700 (PDT) From: Miklos Szeredi To: David Howells Cc: Al Viro , Ian Kent , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/13] cpuset: don't ignore options Date: Wed, 19 Jun 2019 14:30:16 +0200 Message-Id: <20190619123019.30032-10-mszeredi@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190619123019.30032-1-mszeredi@redhat.com> References: <20190619123019.30032-1-mszeredi@redhat.com> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The options "sync", "async", "dirsync", "lazytime", "nolazytime", "mand" and "nomand" make no sense for the cpuset filesystem. If these options are supplied to fsconfig(FSCONFIG_SET_FLAG), then return -EINVAL instead of silently ignoring the option. Any implementation, such as mount(8) that needs to parse this option without failing should simply ignore the return value from fsconfig(). Signed-off-by: Miklos Szeredi --- kernel/cgroup/cpuset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 025f6c6083a3..f6f6b5b44fc3 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -394,7 +394,7 @@ static int cpuset_get_tree(struct fs_context *fc) } static const struct fs_context_operations cpuset_fs_context_ops = { - .parse_param = vfs_parse_sb_flag, + .parse_param = vfs_parse_ro_rw, .get_tree = cpuset_get_tree, }; From patchwork Wed Jun 19 12:30:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 11004043 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C336B924 for ; Wed, 19 Jun 2019 12:31:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3A4725E13 for ; Wed, 19 Jun 2019 12:31:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A81952867C; Wed, 19 Jun 2019 12:31:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4ED2F25E13 for ; Wed, 19 Jun 2019 12:31:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731747AbfFSMa6 (ORCPT ); Wed, 19 Jun 2019 08:30:58 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:34203 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731886AbfFSMao (ORCPT ); Wed, 19 Jun 2019 08:30:44 -0400 Received: by mail-wr1-f65.google.com with SMTP id k11so3235668wrl.1 for ; Wed, 19 Jun 2019 05:30:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1nQV+HbwwVC5JDcFHvgQnxZlAQ2DeroGpuSkk8jd0Tk=; b=lMsGq3SrQyPmVErvJJxZRUXt7yjGvJmsagjwV1SLeIK1S1UE/nItGYdACZPDWNddSw 1MWEa/su9thg7q1A8LG/tFdjFEJESdT2mfGiINqv/l3a/DcvYNHgy6ErazcDHxCUJNg+ utGl0Lws6AaINUO60uhWuzF8WShekd8GISCgj8g3svguOn2+2kX2EB0m+In59zZcHy8r vP035v+CCb/eDZzXZocJFzjLz75Jr9TdeBgxUO9ZPDbqrpbsdn3JvYQfK+vzSL0WDVd2 CFSgrXZ3WxXez4YGBBTz8QYA6WXMyQTPIwSDyApGU7yBW1k1qy86Cd5mmVE5w352xfx+ yKzg== X-Gm-Message-State: APjAAAWsEyzBkG2v3IT8lAF/9Q5KPhnYWcrHJaCfFyOXJ2dpX+2mB8xQ wxtdM68iiPtNU/8G0PzDgPwIsQ== X-Google-Smtp-Source: APXvYqzHsHTMP8Vjwh/pAfZnm0GsX3Los4ghw0Tsr9S1GdEGtjlvPbrdctjrtSZCkpbDaeO0HjA9Bg== X-Received: by 2002:a5d:4908:: with SMTP id x8mr18266350wrq.290.1560947442583; Wed, 19 Jun 2019 05:30:42 -0700 (PDT) Received: from miu.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id 11sm1837513wmd.23.2019.06.19.05.30.41 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 05:30:42 -0700 (PDT) From: Miklos Szeredi To: David Howells Cc: Al Viro , Ian Kent , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/13] cgroup: don't ignore options Date: Wed, 19 Jun 2019 14:30:17 +0200 Message-Id: <20190619123019.30032-11-mszeredi@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190619123019.30032-1-mszeredi@redhat.com> References: <20190619123019.30032-1-mszeredi@redhat.com> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The options "sync", "async", "dirsync", "lazytime", "nolazytime", "mand" and "nomand" make no sense for the cgroup filesystem. If these options are supplied to fsconfig(FSCONFIG_SET_FLAG), then return -EINVAL instead of silently ignoring the option. Any implementation, such as mount(8) that needs to parse this option without failing should simply ignore the return value from fsconfig(). Signed-off-by: Miklos Szeredi --- kernel/cgroup/cgroup-v1.c | 2 +- kernel/cgroup/cgroup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c index f960e6149311..1f50d59f7f4e 100644 --- a/kernel/cgroup/cgroup-v1.c +++ b/kernel/cgroup/cgroup-v1.c @@ -929,7 +929,7 @@ int cgroup1_parse_param(struct fs_context *fc, struct fs_parameter *param) struct fs_parse_result result; int ret, opt, i; - ret = vfs_parse_sb_flag(fc, param); + ret = vfs_parse_ro_rw(fc, param); if (ret != -ENOPARAM) return ret; diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 93890285b510..f2e86b3942b3 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -1836,7 +1836,7 @@ static int cgroup2_parse_param(struct fs_context *fc, struct fs_parameter *param struct fs_parse_result result; int ret, opt; - ret = vfs_parse_sb_flag(fc, param); + ret = vfs_parse_ro_rw(fc, param); if (ret != -ENOPARAM) return ret; From patchwork Wed Jun 19 12:30:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 11004039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4E836924 for ; Wed, 19 Jun 2019 12:30:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C97225E13 for ; Wed, 19 Jun 2019 12:30:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30C7828617; Wed, 19 Jun 2019 12:30:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1D5C25E13 for ; Wed, 19 Jun 2019 12:30:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731911AbfFSMar (ORCPT ); Wed, 19 Jun 2019 08:30:47 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:36839 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731897AbfFSMaq (ORCPT ); Wed, 19 Jun 2019 08:30:46 -0400 Received: by mail-wm1-f68.google.com with SMTP id u8so1658916wmm.1 for ; Wed, 19 Jun 2019 05:30:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z4INWegdUTe8Q6ns0c8f39S93Wy18nSWojE+tUkgp2w=; b=HljfZpVwWxhCDBpZjDGkJ6tUj8ficPRpAv2P6HSKZX9ihBKfij1qlWOqVUEN8j+pw1 T+vYVWIBL/HwLRqzamnDmJRdk8VM9jSJHMBKPnwZodE7g5HEuNUqctwvIAOT2PR0WY3J H8Ee3Zcspyb5GJ8G1YNMHuWFmH804MWH8MRyNB1fbRvly5K9FpHoK9pbfmF0zY2e9p2Y K8/1YX/tnZNeDA7HvDs0DD9pwQi4FfxntHSNfPwpFYt/Tv43uYr5SKXAngRrwtPy2EAc m1w3VrNjbyFkmNz9+kzmLeXAjomU/oDoaL/f1FCIJ1ndCVMYcyTqNnYVu+mWR7DdiNk6 4JGw== X-Gm-Message-State: APjAAAVqTAJ+eEyxAgXQjaiFbWt/7vWAVFrwjSt8DxUbxPS46bFoVmIt rq1IdOq0qzkb1/dYCYWvY7KcfBj3mpw= X-Google-Smtp-Source: APXvYqwjHs6lmB/m746hPFbtEy06SjhOEIMC6yffNLPHqQEgXE5XeQUFxlR0BzlXmc26vAqECvSlhg== X-Received: by 2002:a7b:c74a:: with SMTP id w10mr7804571wmk.99.1560947444548; Wed, 19 Jun 2019 05:30:44 -0700 (PDT) Received: from miu.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id 11sm1837513wmd.23.2019.06.19.05.30.42 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 05:30:43 -0700 (PDT) From: Miklos Szeredi To: David Howells Cc: Al Viro , Ian Kent , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/13] fusectl: don't ignore options Date: Wed, 19 Jun 2019 14:30:18 +0200 Message-Id: <20190619123019.30032-12-mszeredi@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190619123019.30032-1-mszeredi@redhat.com> References: <20190619123019.30032-1-mszeredi@redhat.com> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The options "sync", "async", "dirsync", "lazytime", "nolazytime", "mand" and "nomand" make no sense for the fusectl filesystem. If these options are supplied to fsconfig(FSCONFIG_SET_FLAG), then return -EINVAL instead of silently ignoring the option. Any implementation, such as mount(8) that needs to parse this option without failing should simply ignore the return value from fsconfig(). Signed-off-by: Miklos Szeredi --- fs/fuse/control.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fuse/control.c b/fs/fuse/control.c index c35013ed7f65..f3aab288929f 100644 --- a/fs/fuse/control.c +++ b/fs/fuse/control.c @@ -351,7 +351,7 @@ static int fuse_ctl_get_tree(struct fs_context *fc) static const struct fs_context_operations fuse_ctl_context_ops = { .get_tree = fuse_ctl_get_tree, - .parse_param = vfs_parse_fs_param, + .parse_param = vfs_parse_ro_rw, }; static int fuse_ctl_init_fs_context(struct fs_context *fc) From patchwork Wed Jun 19 12:30:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 11004037 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3CDE2924 for ; Wed, 19 Jun 2019 12:30:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C7A427C0B for ; Wed, 19 Jun 2019 12:30:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20BEE28949; Wed, 19 Jun 2019 12:30:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD0E827C0B for ; Wed, 19 Jun 2019 12:30:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731719AbfFSMaz (ORCPT ); Wed, 19 Jun 2019 08:30:55 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:50842 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731904AbfFSMar (ORCPT ); Wed, 19 Jun 2019 08:30:47 -0400 Received: by mail-wm1-f68.google.com with SMTP id c66so1588714wmf.0 for ; Wed, 19 Jun 2019 05:30:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XNbb6ySXfk0LsxFqiydMR/t6l2T9CSD+Rib4fd27MSM=; b=eqOyg7g/0mJgsqlNmXLBR5YOaJFlrH19/0P++tjLFSFMSOUEh/YX9NRlTUPN+TtOGl +pdFYCHUM/YtaGkvjFvsTvQZpM9T9FnxiYbwchSLopKYU5A/B+MAUyLYTI10kgQXPvH3 i4Lk65CGWQH4+vD0CXuNHNfXtGqfhH3ZitAJbTYL0Eiqm3ITnfidLYg/zuOzZmiUQh56 2HKy7SjZtQ3XAurwmtpTQTr+o3SZ8uKA36Ih1tMhYwdeYsFCCqALH64DWsP72N7Cg9M3 0OCPGJ4b4nKliIS8/h9GR39d+oUslKqtoaXKzeUchoC1A+EIqsjHYzCCauvjMlPq7dUb q9SA== X-Gm-Message-State: APjAAAXtlIgJY+G9zEHRNrVs3tVTpYHdQa00/1ZDDoXqMWyg/hUUBPrH 8KPizvvXOh1i17HWapJ8BDpIyQ== X-Google-Smtp-Source: APXvYqzDtNt23rFHKuVaUEO5oLhVSqmtdo5dNeWIEYEQF22eYOjWI12j/aKbz0NzzlQAmjdhiRPz6Q== X-Received: by 2002:a1c:b757:: with SMTP id h84mr8627226wmf.127.1560947445793; Wed, 19 Jun 2019 05:30:45 -0700 (PDT) Received: from miu.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id 11sm1837513wmd.23.2019.06.19.05.30.44 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 05:30:45 -0700 (PDT) From: Miklos Szeredi To: David Howells Cc: Al Viro , Ian Kent , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 13/13] resctrl: don't ignore options Date: Wed, 19 Jun 2019 14:30:19 +0200 Message-Id: <20190619123019.30032-13-mszeredi@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190619123019.30032-1-mszeredi@redhat.com> References: <20190619123019.30032-1-mszeredi@redhat.com> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The options "sync", "async", "dirsync", "lazytime", "nolazytime", "mand" and "nomand" make no sense for the resctrl filesystem. If these options are supplied to fsconfig(FSCONFIG_SET_FLAG), then return -EINVAL instead of silently ignoring the option. Any implementation, such as mount(8) that needs to parse this option without failing should simply ignore the return value from fsconfig(). Signed-off-by: Miklos Szeredi --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 83d3c358f95e..16b110d31457 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -2053,7 +2053,7 @@ static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param) struct fs_parse_result result; int ret, opt; - ret = vfs_parse_sb_flag(fc, param); + ret = vfs_parse_ro_rw(fc, param); if (ret != -ENOPARAM) return ret;