@@ -587,9 +587,6 @@ int ksu_handle_setuid(struct cred *new, const struct cred *old)
587
587
try_umount (entry -> umountable , MNT_DETACH );
588
588
}
589
589
590
- // unconditional umount for modules.img
591
- try_umount ("/data/adb/modules" , MNT_DETACH );
592
-
593
590
return 0 ;
594
591
}
595
592
@@ -598,14 +595,15 @@ int ksu_mount_monitor(const char *dev_name, const char *dirname, const char *typ
598
595
599
596
char * device_name_copy = kstrdup (dev_name , GFP_KERNEL );
600
597
char * fstype_copy = kstrdup (type , GFP_KERNEL );
598
+ char * dirname_copy = kstrdup (dirname , GFP_KERNEL );
601
599
struct mount_entry * new_entry ;
602
600
603
- if (!device_name_copy || !fstype_copy ) {
601
+ if (!device_name_copy || !fstype_copy || ! dirname_copy ) {
604
602
goto out ;
605
603
}
606
604
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" ) ) {
609
607
new_entry = kmalloc (sizeof (* new_entry ), GFP_KERNEL );
610
608
if (new_entry ) {
611
609
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
616
614
out :
617
615
kfree (device_name_copy );
618
616
kfree (fstype_copy );
617
+ kfree (dirname_copy );
619
618
return 0 ;
620
619
}
621
620
0 commit comments