Skip to content

Commit 0dfa7fc

Browse files
committed
also umount ksu tmpfs
1 parent 10425d0 commit 0dfa7fc

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

kernel/core_hook.c

+4-6
Original file line numberDiff line numberDiff line change
@@ -587,11 +587,9 @@ 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
590591
try_umount("/data/adb/modules", MNT_DETACH);
591592

592-
// try umount ksu temp path
593-
try_umount("/debug_ramdisk", MNT_DETACH);
594-
595593
return 0;
596594
}
597595

@@ -606,13 +604,13 @@ int ksu_mount_monitor(const char *dev_name, const char *dirname, const char *typ
606604
goto out;
607605
}
608606

609-
// overlay, overlayfs, change pattern later
610-
if ( strstr(fstype_copy, "overlay") && (strncmp(device_name_copy, "KSU", 3) == 0) ) {
607+
// KSU devname, overlay/fs and tmpfs
608+
if ( !strncmp(device_name_copy, "KSU", 3) && ( strstr(fstype_copy, "overlay") || !strncmp(fstype_copy, "tmpfs", 5) ) ) {
611609
new_entry = kmalloc(sizeof(*new_entry), GFP_KERNEL);
612610
if (new_entry) {
613611
new_entry->umountable = kstrdup(dirname, GFP_KERNEL);
614612
list_add(&new_entry->list, &mount_list);
615-
pr_info("security_sb_mount: devicename %s fstype: %s path: %s\n", device_name_copy, fstype_copy, new_entry->umountable);
613+
pr_info("ksu_mount_monitor: devicename %s fstype: %s path: %s\n", device_name_copy, fstype_copy, new_entry->umountable);
616614
}
617615
}
618616
out:

0 commit comments

Comments
 (0)