@@ -1688,9 +1688,6 @@ static struct dentry *__lookup_hash(const struct qstr *name,
16881688 if (susfs_is_base_dentry_android_data_dir (base ) &&
16891689 susfs_is_sus_android_data_d_name_found (name -> name ))
16901690 {
1691- if (flags & (LOOKUP_CREATE | LOOKUP_EXCL )) {
1692- return ERR_PTR (- EACCES );
1693- }
16941691 dentry = lookup_dcache (& susfs_fake_qstr_name , base , flags );
16951692 found_sus_path = true;
16961693 goto retry ;
@@ -1712,6 +1709,7 @@ static struct dentry *__lookup_hash(const struct qstr *name,
17121709#ifdef CONFIG_KSU_SUSFS_SUS_PATH
17131710 {
17141711 if (!found_sus_path && !IS_ERR (dentry ) && dentry -> d_inode && susfs_is_inode_sus_path (dentry -> d_inode )) {
1712+ dput (dentry );
17151713 dentry = lookup_dcache (& susfs_fake_qstr_name , base , flags );
17161714 found_sus_path = true;
17171715 goto retry ;
@@ -1779,6 +1777,7 @@ static int lookup_fast(struct nameidata *nd,
17791777 dentry = __d_lookup_rcu (parent , & nd -> last , & seq );
17801778#ifdef CONFIG_KSU_SUSFS_SUS_PATH
17811779 if (is_nd_state_lookup_last_and_open_last && dentry && !IS_ERR (dentry ) && dentry -> d_inode && parent -> d_inode ) {
1780+ dput (dentry );
17821781 if (susfs_is_inode_sus_path (dentry -> d_inode )) {
17831782 dentry = __d_lookup_rcu (parent , & susfs_fake_qstr_name , & backup_next_seq );
17841783 }
@@ -1848,6 +1847,7 @@ static int lookup_fast(struct nameidata *nd,
18481847 dentry = __d_lookup (parent , & nd -> last );
18491848#ifdef CONFIG_KSU_SUSFS_SUS_PATH
18501849 if (is_nd_state_lookup_last_and_open_last && dentry && !IS_ERR (dentry ) && dentry -> d_inode && parent -> d_inode ) {
1850+ dput (dentry );
18511851 if (susfs_is_inode_sus_path (dentry -> d_inode )) {
18521852 dentry = __d_lookup (parent , & susfs_fake_qstr_name );
18531853 }
@@ -1948,6 +1948,7 @@ static struct dentry *lookup_slow(const struct qstr *name,
19481948 if (is_nd_flags_lookup_last && !found_sus_path ) {
19491949 if (dentry && !IS_ERR (dentry ) && dentry -> d_inode ) {
19501950 if (susfs_is_inode_sus_path (dentry -> d_inode )) {
1951+ dput (dentry );
19511952 dentry = d_alloc_parallel (dir , & susfs_fake_qstr_name , & sus_wq );
19521953 found_sus_path = true;
19531954 goto retry ;
@@ -3496,6 +3497,7 @@ static int lookup_open(struct nameidata *nd, struct path *path,
34963497 dentry = d_lookup (dir , & nd -> last );
34973498#ifdef CONFIG_KSU_SUSFS_SUS_PATH
34983499 if (is_nd_state_open_last && dentry && !IS_ERR (dentry ) && dentry -> d_inode ) {
3500+ dput (dentry );
34993501 if (susfs_is_inode_sus_path (dentry -> d_inode )) {
35003502 dentry = d_lookup (dir , & susfs_fake_qstr_name );
35013503 found_sus_path = true;
@@ -3983,7 +3985,7 @@ struct file *do_filp_open(int dfd, struct filename *pathname,
39833985 if (unlikely (filp == ERR_PTR (- ESTALE )))
39843986 filp = path_openat (& nd , op , flags | LOOKUP_REVAL );
39853987#ifdef CONFIG_KSU_SUSFS_OPEN_REDIRECT
3986- if (!IS_ERR (filp ) && unlikely (filp -> f_inode -> i_state & INODE_STATE_OPEN_REDIRECT ) && current_uid ().val < 11000 ) {
3988+ if (!IS_ERR (filp ) && unlikely (filp -> f_inode -> i_mapping -> flags & BIT_OPEN_REDIRECT ) && current_uid ().val < 11000 ) {
39873989 fake_pathname = susfs_get_redirected_path (filp -> f_inode -> i_ino );
39883990 if (!IS_ERR (fake_pathname )) {
39893991 restore_nameidata ();
0 commit comments