Revert "vfs: Allow userns root to call mknod on owned filesystems."
This causes issues for unprivileged containers. This should be
re-applied once the container daemon has been updated to be compatible.
This reverts commit 55956b59df336f6738da916dbb520b6e37df9fbd.
Change-Id: Ib89b0748257ecc0305034425514abd9d83b27933
diff --git a/fs/namei.c b/fs/namei.c
index 734cef5..389e48e 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3711,8 +3711,7 @@
if (error)
return error;
- if ((S_ISCHR(mode) || S_ISBLK(mode)) &&
- !ns_capable(dentry->d_sb->s_user_ns, CAP_MKNOD))
+ if ((S_ISCHR(mode) || S_ISBLK(mode)) && !capable(CAP_MKNOD))
return -EPERM;
if (!dir->i_op->mknod)