diff options
-rw-r--r-- | fs/namei.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c index 1898198abc3d..701954d68ac7 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2560,8 +2560,7 @@ int vfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) | |||
2560 | if (error) | 2560 | if (error) |
2561 | return error; | 2561 | return error; |
2562 | 2562 | ||
2563 | if ((S_ISCHR(mode) || S_ISBLK(mode)) && | 2563 | if ((S_ISCHR(mode) || S_ISBLK(mode)) && !capable(CAP_MKNOD)) |
2564 | !ns_capable(inode_userns(dir), CAP_MKNOD)) | ||
2565 | return -EPERM; | 2564 | return -EPERM; |
2566 | 2565 | ||
2567 | if (!dir->i_op->mknod) | 2566 | if (!dir->i_op->mknod) |