diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-10-24 12:24:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-10-24 12:24:04 -0400 |
commit | 6b609e3b0068d29c676e8f1c6d2c0d503d18fea1 (patch) | |
tree | fe70a94fd74617d68d10c5f3a467106346ce1398 | |
parent | deba28b12bcb5e11c6f6689f4edd96eea4929162 (diff) | |
parent | 3df629d873f8683af6f0d34dfc743f637966d483 (diff) |
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs fixes from Al Viro.
* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
gfs2_meta: ->mount() can get NULL dev_name
ecryptfs_rename(): verify that lower dentries are still OK after lock_rename()
cachefiles: fix the race between cachefiles_bury_object() and rmdir(2)
-rw-r--r-- | fs/ecryptfs/inode.c | 11 | ||||
-rw-r--r-- | fs/gfs2/ops_fstype.c | 3 |
2 files changed, 11 insertions, 3 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 49121e5a8de2..5c36ceecb5c1 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
@@ -593,11 +593,16 @@ ecryptfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
593 | lower_new_dir_dentry = dget_parent(lower_new_dentry); | 593 | lower_new_dir_dentry = dget_parent(lower_new_dentry); |
594 | target_inode = d_inode(new_dentry); | 594 | target_inode = d_inode(new_dentry); |
595 | trap = lock_rename(lower_old_dir_dentry, lower_new_dir_dentry); | 595 | trap = lock_rename(lower_old_dir_dentry, lower_new_dir_dentry); |
596 | rc = -EINVAL; | ||
597 | if (lower_old_dentry->d_parent != lower_old_dir_dentry) | ||
598 | goto out_lock; | ||
599 | if (lower_new_dentry->d_parent != lower_new_dir_dentry) | ||
600 | goto out_lock; | ||
601 | if (d_unhashed(lower_old_dentry) || d_unhashed(lower_new_dentry)) | ||
602 | goto out_lock; | ||
596 | /* source should not be ancestor of target */ | 603 | /* source should not be ancestor of target */ |
597 | if (trap == lower_old_dentry) { | 604 | if (trap == lower_old_dentry) |
598 | rc = -EINVAL; | ||
599 | goto out_lock; | 605 | goto out_lock; |
600 | } | ||
601 | /* target should not be ancestor of source */ | 606 | /* target should not be ancestor of source */ |
602 | if (trap == lower_new_dentry) { | 607 | if (trap == lower_new_dentry) { |
603 | rc = -ENOTEMPTY; | 608 | rc = -ENOTEMPTY; |
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index c2469833b4fb..6b84ef6ccff3 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c | |||
@@ -1333,6 +1333,9 @@ static struct dentry *gfs2_mount_meta(struct file_system_type *fs_type, | |||
1333 | struct path path; | 1333 | struct path path; |
1334 | int error; | 1334 | int error; |
1335 | 1335 | ||
1336 | if (!dev_name || !*dev_name) | ||
1337 | return ERR_PTR(-EINVAL); | ||
1338 | |||
1336 | error = kern_path(dev_name, LOOKUP_FOLLOW, &path); | 1339 | error = kern_path(dev_name, LOOKUP_FOLLOW, &path); |
1337 | if (error) { | 1340 | if (error) { |
1338 | pr_warn("path_lookup on %s returned error %d\n", | 1341 | pr_warn("path_lookup on %s returned error %d\n", |