Skip to content

Commit e181cda

Browse files
committed
KernelSU: throne_tracker: avoid incfs dirs
upstream's way seems to fail around my_actor, once it tries to resolve path to struct via kern_path. no idea what the issue is, but since we can achieve the same goal, ehh, dont bother with it Replaces: `throne_tracker: avoid cross fs access` tiann/KernelSU#2626 Signed-off-by: backslashxx <[email protected]>
1 parent 70379a2 commit e181cda

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

drivers/kernelsu/throne_tracker.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,17 @@ void search_manager(const char *path, int depth, struct list_head *uid_data)
271271
pr_err("Failed to open directory: %s, err: %ld\n", pos->dirpath, PTR_ERR(file));
272272
goto skip_iterate;
273273
}
274-
274+
275+
#define INCFS_MAGIC_NUMBER (unsigned long)(0x5346434e49ul) // incrementalfs.h
276+
if (file->f_inode->i_sb->s_magic && file->f_inode->i_sb->s_magic == INCFS_MAGIC_NUMBER) {
277+
pr_info("%s: skip incfs: %s\n", pos->dirpath);
278+
filp_close(file, NULL);
279+
goto skip_iterate;
280+
}
281+
#ifdef CONFIG_KSU_DEBUG
282+
if (file->f_inode->i_sb->s_magic)
283+
pr_info("%s: magic: %lx current dir: %s\n", __func__, file->f_inode->i_sb->s_magic, pos->dirpath);
284+
#endif
275285
iterate_dir(file, &ctx.ctx);
276286
filp_close(file, NULL);
277287
}

0 commit comments

Comments
 (0)