projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6b0d5c
)
Btrfs: add extra sanity checks on the path names in btrfs_mksubvol
author
Chris Mason
<chris.mason@oracle.com>
Tue, 21 Feb 2012 03:14:55 +0000
(22:14 -0500)
committer
Chris Mason
<chris.mason@oracle.com>
Thu, 23 Feb 2012 15:43:45 +0000
(10:43 -0500)
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ioctl.c
patch
|
blob
|
history
diff --git
a/fs/btrfs/ioctl.c
b/fs/btrfs/ioctl.c
index e9bdb8b783e568263ef140dc75fe92693213972b..05446f77f99ba8218bd0a5ea2bf03fcdb3f73908 100644
(file)
--- a/
fs/btrfs/ioctl.c
+++ b/
fs/btrfs/ioctl.c
@@
-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);