mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-14 15:54:15 +08:00
Btrfs: add extra sanity checks on the path names in btrfs_mksubvol
Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
a6b0d5c8db
commit
16780cabb8
@ -1333,6 +1333,12 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (name[0] == '.' &&
|
||||
(namelen == 1 || (name[1] == '.' && namelen == 2))) {
|
||||
ret = -EEXIST;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (subvol) {
|
||||
ret = btrfs_mksubvol(&file->f_path, name, namelen,
|
||||
NULL, transid, readonly);
|
||||
|
Loading…
Reference in New Issue
Block a user