Skip to content

Commit e880882

Browse files
hmtheboy154backslashxx
authored andcommitted
kernel: Relax dentry_path_raw compare in core_hook (tiann#2041)
On Android-x86 (or BlissOS) it initialize Android by using switch_root or chroot, when checking a path with dentry_path_raw() it will show the whole real path instead of the path that we want. Relax the checking requirement by using strstr to look for "/system/packages.list" in the string instead of requiring the path to be "/system/packages.list" This fixes tiann#1783 Signed-off-by: hmtheboy154 <buingoc67@gmail.com>
1 parent 5a8a7b4 commit e880882

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/core_hook.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/sched.h>
1616
#include <linux/security.h>
1717
#include <linux/stddef.h>
18+
#include <linux/string.h>
1819
#include <linux/types.h>
1920
#include <linux/uaccess.h>
2021
#include <linux/uidgid.h>
@@ -197,7 +198,7 @@ int ksu_handle_rename(struct dentry *old_dentry, struct dentry *new_dentry)
197198
return 0;
198199
}
199200

200-
if (strcmp(buf, "/system/packages.list")) {
201+
if (!strstr(buf, "/system/packages.list")) {
201202
return 0;
202203
}
203204
pr_info("renameat: %s -> %s, new path: %s\n", old_dentry->d_iname,

0 commit comments

Comments
 (0)