mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
sysfs: fix i_mutex locking in sysfs_get_dentry()
lookup_one_len_kern() should be called with the parent's i_mutex locked. Fix it. Spotted by Eric W. Biederman. Signed-off-by: Tejun Heo <[email protected]> Cc: Eric W. Biederman <[email protected]> Cc: Cornelia Huck <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
1359555eb7
commit
253280267a
1 changed files with 2 additions and 0 deletions
|
|
@ -130,8 +130,10 @@ struct dentry *sysfs_get_dentry(struct sysfs_dirent *sd)
|
|||
|
||||
/* look it up */
|
||||
parent_dentry = dentry;
|
||||
mutex_lock(&parent_dentry->d_inode->i_mutex);
|
||||
dentry = lookup_one_len_kern(cur->s_name, parent_dentry,
|
||||
strlen(cur->s_name));
|
||||
mutex_unlock(&parent_dentry->d_inode->i_mutex);
|
||||
dput(parent_dentry);
|
||||
|
||||
if (IS_ERR(dentry)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue