Skip to content

Commit 3e93ba0

Browse files
committed
also umount modules, modules_update?
automate this if #2510 ever happens check dirname
1 parent 0dfa7fc commit 3e93ba0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

kernel/core_hook.c

+5-6
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,6 @@ int ksu_handle_setuid(struct cred *new, const struct cred *old)
587587
try_umount(entry->umountable, MNT_DETACH);
588588
}
589589

590-
// unconditional umount for modules.img
591-
try_umount("/data/adb/modules", MNT_DETACH);
592-
593590
return 0;
594591
}
595592

@@ -598,14 +595,15 @@ int ksu_mount_monitor(const char *dev_name, const char *dirname, const char *typ
598595

599596
char *device_name_copy = kstrdup(dev_name, GFP_KERNEL);
600597
char *fstype_copy = kstrdup(type, GFP_KERNEL);
598+
char *dirname_copy = kstrdup(dirname, GFP_KERNEL);
601599
struct mount_entry *new_entry;
602600

603-
if (!device_name_copy || !fstype_copy ) {
601+
if (!device_name_copy || !fstype_copy || !dirname_copy) {
604602
goto out;
605603
}
606604

607-
// KSU devname, overlay/fs and tmpfs
608-
if ( !strncmp(device_name_copy, "KSU", 3) && ( strstr(fstype_copy, "overlay") || !strncmp(fstype_copy, "tmpfs", 5) ) ) {
605+
// KSU devname, overlay/fs or tmpfs || /data/adb/modules, modules_update
606+
if ( ( !strncmp(device_name_copy, "KSU", 3) && ( strstr(fstype_copy, "overlay") || !strncmp(fstype_copy, "tmpfs", 5) ) ) || strstr(dirname_copy, "/data/adb/modules") ) {
609607
new_entry = kmalloc(sizeof(*new_entry), GFP_KERNEL);
610608
if (new_entry) {
611609
new_entry->umountable = kstrdup(dirname, GFP_KERNEL);
@@ -616,6 +614,7 @@ int ksu_mount_monitor(const char *dev_name, const char *dirname, const char *typ
616614
out:
617615
kfree(device_name_copy);
618616
kfree(fstype_copy);
617+
kfree(dirname_copy);
619618
return 0;
620619
}
621620

0 commit comments

Comments
 (0)