vfs: add FS_USERNS_DELEGATABLE flag and set it for NFS
Subsystems (4)
Jeff Layton
maintainerPATCH 1/1 vfs: add FS_USERNS_DELEGATABLE flag and set it for NFS
Commit e1c5ae59c0f2 ("fs: don't allow non-init s_user_ns for filesystems without FS_USERNS_MOUNT") prevents the mount of any filesystem inside a container that doesn't have FS_USERNS_MOUNT set.
This broke NFS mounts in our containerized environment. We have a daemon somewhat like systemd-mountfsd running in the init_ns. A process does a fsopen() inside the container and passes it to the daemon via unix socket.
The daemon then vets that the request is for an allowed NFS server and performs the mount. This now fails because the fc->user_ns is set to the value in the container and NFS doesn't set FS_USERNS_MOUNT. We don't want to add FS_USERNS_MOUNT to NFS since that would allow the container to mount any NFS server (even malicious ones).
Add a new FS_USERNS_DELEGATABLE flag, and enable it on NFS.
--- fs/nfs/fs_context.c | 8 ++++++-- fs/super.c | 11 ++++++----- include/linux/fs.h | 1 + 3 files changed, 13 insertions(+), 7 deletions(-)
fs/nfs/fs_context.c +6 -2
@@ -1768,7 +1768,9 @@ struct file_system_type nfs_fs_type = { .init_fs_context = nfs_init_fs_context, .parameters = nfs_fs_parameters, .kill_sb = nfs_kill_super, - .fs_flags = FS_RENAME_DOES_D_MOVE|FS_BINARY_MOUNTDATA, + .fs_flags =FS_RENAME_DOES_D_MOVE | +FS_BINARY_MOUNTDATA | + FS_USERNS_DELEGATABLE, };MODULE_ALIAS_FS ("nfs" );EXPORT_SYMBOL_GPL (nfs_fs_type);
@@ -1780,7 +1782,9 @@ struct file_system_type nfs4_fs_type = { .init_fs_context = nfs_init_fs_context, .parameters = nfs_fs_parameters, .kill_sb = nfs_kill_super, - .fs_flags = FS_RENAME_DOES_D_MOVE|FS_BINARY_MOUNTDATA, + .fs_flags =FS_RENAME_DOES_D_MOVE | +FS_BINARY_MOUNTDATA | + FS_USERNS_DELEGATABLE, };MODULE_ALIAS_FS ("nfs4" );MODULE_ALIAS ("nfs4" );
fs/super.c +6 -5
@@ -738,12 +738,13 @@ struct super_block *sget_fc(struct fs_context *fc,int err;/* -* Never allow s_user_ns != &init_user_ns when FS_USERNS_MOUNT is -* not set, as the filesystem is likely unprepared to handle it. -* This can happen when fsconfig() is called from init_user_ns with -* an fs_fd opened in another user namespace. +* Never allow s_user_ns != &init_user_ns when FS_USERNS_MOUNT or +* FS_USERNS_DELEGATABLE is not set, as the filesystem is likely +* unprepared to handle it. This can happen when fsconfig() is called +* from init_user_ns with an fs_fd opened in another user namespace. */ -if (user_ns != &init_user_ns && !(fc->fs_type->fs_flags &FS_USERNS_MOUNT )) { +if (user_ns != &init_user_ns && + !(fc->fs_type->fs_flags & (FS_USERNS_MOUNT |FS_USERNS_DELEGATABLE ))) {errorfc (fc,"VFS: Mounting from non-initial user namespace is not allowed" );return ERR_PTR (-EPERM ); }
include/linux/fs.h +1 -0
@@ -2273,6 +2273,7 @@ struct file_system_type {#define FS_MGTIME 64/* FS uses multigrain timestamps */ #define FS_LBS 128/* FS supports LBS */ #define FS_POWER_FREEZE 256/* Always freeze on suspend/hibernate */ +#define FS_USERNS_DELEGATABLE 512/* Can be mounted inside userns from outside */ #define FS_RENAME_DOES_D_MOVE 32768/* FS will handle d_move() during rename() internally. */ int (*init_fs_context)(struct fs_context *);const struct fs_parameter_spec *parameters;
---
base-commit: 8dfce8991b95d8625d0a1d2896e42f93b9d7f68d
change-id: 20260129-twmount-114ddfd43420
Best regards,
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 10 lines · Jeff Layton
Commit
e1c5ae59c0f2("fs: don't allow non-inits_user_nsfor filesystems withoutFS_USERNS_MOUNT") prevents the mount of any filesystem inside a container that doesn't haveFS_USERNS_MOUNTset.This broke NFS mounts in our containerized environment. We have a daemon somewhat like systemd-mountfsd running in the
init_ns. A process does afsopen()inside the container and passes it to the daemon via unix socket.[...]
Applied to the vfs-7.0.misc branch of the vfs/vfs.git tree. Patches in the vfs-7.0.misc branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs-7.0.misc
[1/1] vfs: add FS_USERNS_DELEGATABLE flag and set it for NFS
https://git.kernel.org/vfs/vfs/c/269c46e936f3
Quoted 12 lines · Christian Brauner
Quoted 10 lines · Jeff Layton
Commit
e1c5ae59c0f2("fs: don't allow non-inits_user_nsfor filesystems withoutFS_USERNS_MOUNT") prevents the mount of any filesystem inside a container that doesn't haveFS_USERNS_MOUNTset.This broke NFS mounts in our containerized environment. We have a daemon somewhat like systemd-mountfsd running in the
init_ns. A process does afsopen()inside the container and passes it to the daemon via unix socket.[...]
Quoted 8 lines
Applied to the vfs-7.0.misc branch of the vfs/vfs.git tree. Patches in the vfs-7.0.misc branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.
Quoted 9 lines
Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs-7.0.misc[1/1] vfs: add
FS_USERNS_DELEGATABLEflag and set it for NFShttps://git.kernel.org/vfs/vfs/c/269c46e936f3
Jeff Layton
maintainerQuoted 21 lines · Christian Brauner
Quoted 10 lines · Jeff Layton
Commit
e1c5ae59c0f2("fs: don't allow non-inits_user_nsfor filesystems withoutFS_USERNS_MOUNT") prevents the mount of any filesystem inside a container that doesn't haveFS_USERNS_MOUNTset.This broke NFS mounts in our containerized environment. We have a daemon somewhat like systemd-mountfsd running in the
init_ns. A process does afsopen()inside the container and passes it to the daemon via unix socket.[...]
Applied to the vfs-7.0.misc branch of the vfs/vfs.git tree. Patches in the vfs-7.0.misc branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.
Quoted 8 lines
Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs-7.0.misc[1/1] vfs: add
FS_USERNS_DELEGATABLEflag and set it for NFShttps://git.kernel.org/vfs/vfs/c/269c46e936f3
I sent something yesterday, but I'm not sure you saw it.
This patch never made it into v7.0 for some reason. Any chance we could get it in for v7.2?
Thanks,
Signature · 1 line
Jeff Layton <[email protected]>
Am Do., 29. Jan. 2026 um 22:48 Uhr schrieb Jeff Layton <[email protected]>:
Quoted 5 lines
Commit
e1c5ae59c0f2("fs: don't allow non-inits_user_nsfor filesystems withoutFS_USERNS_MOUNT") prevents the mount of any filesystem inside a container that doesn't haveFS_USERNS_MOUNTset.
Hi Jeff,
Quoted 5 lines
This broke NFS mounts in our containerized environment. We have a daemon somewhat like systemd-mountfsd running in the
init_ns. A process does afsopen()inside the container and passes it to the daemon via unix socket.
Quoted 7 lines
The daemon then vets that the request is for an allowed NFS server and performs the mount. This now fails because the
fc->user_nsis set to the value in the container and NFS doesn't setFS_USERNS_MOUNT. We don't want to addFS_USERNS_MOUNTto NFS since that would allow the container to mount any NFS server (even malicious ones).Add a new
FS_USERNS_DELEGATABLEflag, and enable it on NFS.
Great idea, very similar to what we have with BPFFS/BPF Tokens.
Taking into account this patch, shouldn't we drop FS_USERNS_MOUNT and replace it withFS_USERNS_DELEGATABLE for bpffs too?
I mean something like:
======================
$ git diff
kernel/bpf/inode.c +0 -0
@@ -1009,10 +1009,6 @@ static int bpf_fill_super(struct super_block
*sb, struct fs_context *fc)
struct inode *inode;
int ret;- /* Mounting an instance of BPF FS requires privileges */
- if (fc->user_ns != &init_user_ns && !capable(CAP_SYS_ADMIN))
- return -EPERM;
-
ret = simple_fill_super(sb, BPF_FS_MAGIC, bpf_rfiles);
if (ret)
return ret;@@ -1085,7 +1081,7 @@ static struct file_system_type bpf_fs_type = {
.init_fs_context = bpf_init_fs_context,
.parameters = bpf_fs_parameters,
.kill_sb = bpf_kill_super,
- .fs_flags = FS_USERNS_MOUNT, + .fs_flags = FS_USERNS_DELEGATABLE,
};
static int __init bpf_init(void)
======================
Because it feels like we were basically implementing this FS_USERNS_DELEGATABLE flag implicitly for BPFFS before. I can submit a patch for BPFFS later after testing.
Quoted 3 lines
Fixes e1c5ae59c0f2 ("fs: don't allow non-init s_user_ns for filesystems without FS_USERNS_MOUNT")Signed-off-by Jeff Layton <[email protected]>
Kind regards,
Alex
Quoted 76 lines
--- fs/nfs/fs_context.c | 8 ++++++-- fs/super.c | 11 ++++++----- include/linux/fs.h | 1 + 3 files changed, 13 insertions(+), 7 deletions(-)fs/nfs/fs_context.c +6
-2@@ -1768,7 +1768,9 @@ struct file_system_type nfs_fs_type = { .init_fs_context = nfs_init_fs_context, .parameters = nfs_fs_parameters, .kill_sb = nfs_kill_super, - .fs_flags = FS_RENAME_DOES_D_MOVE|FS_BINARY_MOUNTDATA, + .fs_flags =FS_RENAME_DOES_D_MOVE | +FS_BINARY_MOUNTDATA | + FS_USERNS_DELEGATABLE, };MODULE_ALIAS_FS ("nfs" );EXPORT_SYMBOL_GPL (nfs_fs_type);@@ -1780,7 +1782,9 @@ struct file_system_type nfs4_fs_type = { .init_fs_context = nfs_init_fs_context, .parameters = nfs_fs_parameters, .kill_sb = nfs_kill_super, - .fs_flags = FS_RENAME_DOES_D_MOVE|FS_BINARY_MOUNTDATA, + .fs_flags =FS_RENAME_DOES_D_MOVE | +FS_BINARY_MOUNTDATA | + FS_USERNS_DELEGATABLE, };MODULE_ALIAS_FS ("nfs4" );MODULE_ALIAS ("nfs4" );fs/super.c +6
-5@@ -738,12 +738,13 @@ struct super_block *sget_fc(struct fs_context *fc,int err;/* -* Never allow s_user_ns != &init_user_ns when FS_USERNS_MOUNT is -* not set, as the filesystem is likely unprepared to handle it. -* This can happen when fsconfig() is called from init_user_ns with -* an fs_fd opened in another user namespace. +* Never allow s_user_ns != &init_user_ns when FS_USERNS_MOUNT or +* FS_USERNS_DELEGATABLE is not set, as the filesystem is likely +* unprepared to handle it. This can happen when fsconfig() is called +* from init_user_ns with an fs_fd opened in another user namespace. */ -if (user_ns != &init_user_ns && !(fc->fs_type->fs_flags &FS_USERNS_MOUNT )) { +if (user_ns != &init_user_ns && + !(fc->fs_type->fs_flags & (FS_USERNS_MOUNT |FS_USERNS_DELEGATABLE ))) {errorfc (fc,"VFS: Mounting from non-initial user namespace is not allowed" );return ERR_PTR (-EPERM ); }include/linux/fs.h +1
-1@@ -2273,6 +2273,7 @@ struct file_system_type {#define FS_MGTIME 64/* FS uses multigrain timestamps */ #define FS_LBS 128/* FS supports LBS */ #define FS_POWER_FREEZE 256/* Always freeze on suspend/hibernate */ +#define FS_USERNS_DELEGATABLE 512/* Can be mounted inside userns from outside */ #define FS_RENAME_DOES_D_MOVE 32768/* FS will handle d_move() during rename() internally. */ int (*init_fs_context)(struct fs_context *);const struct fs_parameter_spec *parameters; ---base-commit:
8dfce8991b95d8625d0a1d2896e42f93b9d7f68d
change-id: 20260129-twmount-114ddfd43420Best regards,
--
Jeff Layton <[email protected]>
Quoted 59 lines · Alexander Mikhalitsyn
Am Do., 29. Jan. 2026 um 22:48 Uhr schrieb Jeff Layton <[email protected]>:
Quoted 5 lines
Commit
e1c5ae59c0f2("fs: don't allow non-inits_user_nsfor filesystems withoutFS_USERNS_MOUNT") prevents the mount of any filesystem inside a container that doesn't haveFS_USERNS_MOUNTset.Hi Jeff,
Quoted 5 lines
This broke NFS mounts in our containerized environment. We have a daemon somewhat like systemd-mountfsd running in the
init_ns. A process does afsopen()inside the container and passes it to the daemon via unix socket.Quoted 7 lines
The daemon then vets that the request is for an allowed NFS server and performs the mount. This now fails because the
fc->user_nsis set to the value in the container and NFS doesn't setFS_USERNS_MOUNT. We don't want to addFS_USERNS_MOUNTto NFS since that would allow the container to mount any NFS server (even malicious ones).Add a new
FS_USERNS_DELEGATABLEflag, and enable it on NFS.Great idea, very similar to what we have with BPFFS/BPF Tokens.
Taking into account this patch, shouldn't we drop
FS_USERNS_MOUNTand replace it withFS_USERNS_DELEGATABLEfor bpffs too?I mean something like:
======================
$ git diffkernel/bpf/inode.c +0
-4@@ -1009,10 +1009,6 @@ static int bpf_fill_super(struct super_block *sb, struct fs_context *fc)struct inode *inode;int ret; -/* Mounting an instance of BPF FS requires privileges */ -if (fc->user_ns != &init_user_ns && !capable (CAP_SYS_ADMIN )) -return -EPERM ; - ret =simple_fill_super (sb,BPF_FS_MAGIC , bpf_rfiles);if (ret)return ret;kernel/bpf/inode.c +1
-1@@ -1085,7 +1081,7 @@ static struct file_system_type bpf_fs_type = { .init_fs_context = bpf_init_fs_context, .parameters = bpf_fs_parameters, .kill_sb = bpf_kill_super, - .fs_flags = FS_USERNS_MOUNT, + .fs_flags = FS_USERNS_DELEGATABLE, };static int __init bpf_init (void )======================
Quoted 4 lines
Because it feels like we were basically implementing this
FS_USERNS_DELEGATABLEflag implicitly for BPFFS before. I can submit a patch for BPFFS later after testing.
Yeah, looks like a good thing to change, since it should have the same effect. Assuming that works the way it should:
Christian Brauner
maintainerQuoted 57 lines · Jeff Layton
Quoted 56 lines · Alexander Mikhalitsyn
Am Do., 29. Jan. 2026 um 22:48 Uhr schrieb Jeff Layton <[email protected]>:
Quoted 5 lines
Commit
e1c5ae59c0f2("fs: don't allow non-inits_user_nsfor filesystems withoutFS_USERNS_MOUNT") prevents the mount of any filesystem inside a container that doesn't haveFS_USERNS_MOUNTset.Hi Jeff,
Quoted 5 lines
This broke NFS mounts in our containerized environment. We have a daemon somewhat like systemd-mountfsd running in the
init_ns. A process does afsopen()inside the container and passes it to the daemon via unix socket.Quoted 7 lines
The daemon then vets that the request is for an allowed NFS server and performs the mount. This now fails because the
fc->user_nsis set to the value in the container and NFS doesn't setFS_USERNS_MOUNT. We don't want to addFS_USERNS_MOUNTto NFS since that would allow the container to mount any NFS server (even malicious ones).Add a new
FS_USERNS_DELEGATABLEflag, and enable it on NFS.Great idea, very similar to what we have with BPFFS/BPF Tokens.
Taking into account this patch, shouldn't we drop
FS_USERNS_MOUNTand replace it withFS_USERNS_DELEGATABLEfor bpffs too?I mean something like:
======================
$ git diffkernel/bpf/inode.c +0
-4@@ -1009,10 +1009,6 @@ static int bpf_fill_super(struct super_block *sb, struct fs_context *fc)struct inode *inode;int ret; -/* Mounting an instance of BPF FS requires privileges */ -if (fc->user_ns != &init_user_ns && !capable (CAP_SYS_ADMIN )) -return -EPERM ; - ret =simple_fill_super (sb,BPF_FS_MAGIC , bpf_rfiles);if (ret)return ret;kernel/bpf/inode.c +1
-1@@ -1085,7 +1081,7 @@ static struct file_system_type bpf_fs_type = { .init_fs_context = bpf_init_fs_context, .parameters = bpf_fs_parameters, .kill_sb = bpf_kill_super, - .fs_flags = FS_USERNS_MOUNT, + .fs_flags = FS_USERNS_DELEGATABLE, };
Quoted 6 lines
Quoted 6 lines
kernel/bpf/inode.c +0
-0static int __init bpf_init (void )======================
Because it feels like we were basically implementing this
FS_USERNS_DELEGATABLEflag implicitly for BPFFS before. I can submit a patch for BPFFS later after testing.
Can you send that to the list, please?
Thanks!
Am Di., 3. Feb. 2026 um 17:41 Uhr schrieb Christian Brauner <[email protected]>:
Quoted 59 lines · Jeff Layton
Quoted 57 lines · Alexander Mikhalitsyn
Quoted 56 lines
Am Do., 29. Jan. 2026 um 22:48 Uhr schrieb Jeff Layton <[email protected]>:
Quoted 5 lines
Commit
e1c5ae59c0f2("fs: don't allow non-inits_user_nsfor filesystems withoutFS_USERNS_MOUNT") prevents the mount of any filesystem inside a container that doesn't haveFS_USERNS_MOUNTset.Hi Jeff,
Quoted 5 lines
This broke NFS mounts in our containerized environment. We have a daemon somewhat like systemd-mountfsd running in the
init_ns. A process does afsopen()inside the container and passes it to the daemon via unix socket.Quoted 7 lines
The daemon then vets that the request is for an allowed NFS server and performs the mount. This now fails because the
fc->user_nsis set to the value in the container and NFS doesn't setFS_USERNS_MOUNT. We don't want to addFS_USERNS_MOUNTto NFS since that would allow the container to mount any NFS server (even malicious ones).Add a new
FS_USERNS_DELEGATABLEflag, and enable it on NFS.Great idea, very similar to what we have with BPFFS/BPF Tokens.
Taking into account this patch, shouldn't we drop
FS_USERNS_MOUNTand replace it withFS_USERNS_DELEGATABLEfor bpffs too?I mean something like:
======================
$ git diffkernel/bpf/inode.c +0
-4@@ -1009,10 +1009,6 @@ static int bpf_fill_super(struct super_block *sb, struct fs_context *fc)struct inode *inode;int ret; -/* Mounting an instance of BPF FS requires privileges */ -if (fc->user_ns != &init_user_ns && !capable (CAP_SYS_ADMIN )) -return -EPERM ; - ret =simple_fill_super (sb,BPF_FS_MAGIC , bpf_rfiles);if (ret)return ret;kernel/bpf/inode.c +1
-1@@ -1085,7 +1081,7 @@ static struct file_system_type bpf_fs_type = { .init_fs_context = bpf_init_fs_context, .parameters = bpf_fs_parameters, .kill_sb = bpf_kill_super, - .fs_flags = FS_USERNS_MOUNT, + .fs_flags = FS_USERNS_DELEGATABLE, };
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
kernel/bpf/inode.c +0
-0static int __init bpf_init (void )======================
Because it feels like we were basically implementing this
FS_USERNS_DELEGATABLEflag implicitly for BPFFS before. I can submit a patch for BPFFS later after testing.Can you send that to the list, please?
Sure, I'll do that a bit later! I'm still in Brussels ;-)
Quoted 1 line
Thanks!
Jeff Layton
maintainerQuoted 91 lines · Jeff Layton
Commit
e1c5ae59c0f2("fs: don't allow non-inits_user_nsfor filesystems withoutFS_USERNS_MOUNT") prevents the mount of any filesystem inside a container that doesn't haveFS_USERNS_MOUNTset.This broke NFS mounts in our containerized environment. We have a daemon somewhat like systemd-mountfsd running in the
init_ns. A process does afsopen()inside the container and passes it to the daemon via unix socket.The daemon then vets that the request is for an allowed NFS server and performs the mount. This now fails because the
fc->user_nsis set to the value in the container and NFS doesn't setFS_USERNS_MOUNT. We don't want to addFS_USERNS_MOUNTto NFS since that would allow the container to mount any NFS server (even malicious ones).Add a new
FS_USERNS_DELEGATABLEflag, and enable it on NFS.Fixes e1c5ae59c0f2 ("fs: don't allow non-init s_user_ns for filesystems without FS_USERNS_MOUNT")Signed-off-by Jeff Layton <[email protected]>--- fs/nfs/fs_context.c | 8 ++++++-- fs/super.c | 11 ++++++----- include/linux/fs.h | 1 + 3 files changed, 13 insertions(+), 7 deletions(-)fs/nfs/fs_context.c +6
-2@@ -1768,7 +1768,9 @@ struct file_system_type nfs_fs_type = { .init_fs_context = nfs_init_fs_context, .parameters = nfs_fs_parameters, .kill_sb = nfs_kill_super, - .fs_flags = FS_RENAME_DOES_D_MOVE|FS_BINARY_MOUNTDATA, + .fs_flags =FS_RENAME_DOES_D_MOVE | +FS_BINARY_MOUNTDATA | + FS_USERNS_DELEGATABLE, };MODULE_ALIAS_FS ("nfs" );EXPORT_SYMBOL_GPL (nfs_fs_type);@@ -1780,7 +1782,9 @@ struct file_system_type nfs4_fs_type = { .init_fs_context = nfs_init_fs_context, .parameters = nfs_fs_parameters, .kill_sb = nfs_kill_super, - .fs_flags = FS_RENAME_DOES_D_MOVE|FS_BINARY_MOUNTDATA, + .fs_flags =FS_RENAME_DOES_D_MOVE | +FS_BINARY_MOUNTDATA | + FS_USERNS_DELEGATABLE, };MODULE_ALIAS_FS ("nfs4" );MODULE_ALIAS ("nfs4" );fs/super.c +6
-5@@ -738,12 +738,13 @@ struct super_block *sget_fc(struct fs_context *fc,int err;/* -* Never allow s_user_ns != &init_user_ns when FS_USERNS_MOUNT is -* not set, as the filesystem is likely unprepared to handle it. -* This can happen when fsconfig() is called from init_user_ns with -* an fs_fd opened in another user namespace. +* Never allow s_user_ns != &init_user_ns when FS_USERNS_MOUNT or +* FS_USERNS_DELEGATABLE is not set, as the filesystem is likely +* unprepared to handle it. This can happen when fsconfig() is called +* from init_user_ns with an fs_fd opened in another user namespace. */ -if (user_ns != &init_user_ns && !(fc->fs_type->fs_flags &FS_USERNS_MOUNT )) { +if (user_ns != &init_user_ns && + !(fc->fs_type->fs_flags & (FS_USERNS_MOUNT |FS_USERNS_DELEGATABLE ))) {errorfc (fc,"VFS: Mounting from non-initial user namespace is not allowed" );return ERR_PTR (-EPERM ); }include/linux/fs.h +1
-1@@ -2273,6 +2273,7 @@ struct file_system_type {#define FS_MGTIME 64/* FS uses multigrain timestamps */ #define FS_LBS 128/* FS supports LBS */ #define FS_POWER_FREEZE 256/* Always freeze on suspend/hibernate */ +#define FS_USERNS_DELEGATABLE 512/* Can be mounted inside userns from outside */ #define FS_RENAME_DOES_D_MOVE 32768/* FS will handle d_move() during rename() internally. */ int (*init_fs_context)(struct fs_context *);const struct fs_parameter_spec *parameters; ---base-commit:
8dfce8991b95d8625d0a1d2896e42f93b9d7f68d
change-id: 20260129-twmount-114ddfd43420
Quoted 1 line
Best regards,
Ping?
I just realized that this patch never made it into -next or a release. Any chance we can get this into the coming v7.3 merge window? (although it looks like we'll need to renumber the bit since FS_USERNS_MOUNT_RESTRICTED has gone in since then.
Thanks,
Signature · 1 line
Jeff Layton <[email protected]>