@@ -50,6 +50,7 @@ static bool ksu_module_mounted = false;
50
50
extern int handle_sepolicy (unsigned long arg3 , void __user * arg4 );
51
51
52
52
static bool ksu_su_compat_enabled = true;
53
+ static bool ksu_mount_monitor_enabled = true;
53
54
extern void ksu_sucompat_init ();
54
55
extern void ksu_sucompat_exit ();
55
56
@@ -332,6 +333,9 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
332
333
if (!boot_complete_lock ) {
333
334
boot_complete_lock = true;
334
335
pr_info ("boot_complete triggered\n" );
336
+ // turn off mount monitor
337
+ pr_info ("turning off ksu_mount_monitor\n" );
338
+ ksu_mount_monitor_enabled = false;
335
339
}
336
340
break ;
337
341
}
@@ -592,7 +596,10 @@ int ksu_handle_setuid(struct cred *new, const struct cred *old)
592
596
593
597
int ksu_mount_monitor (const char * dev_name , const char * dirname , const char * type )
594
598
{
595
-
599
+ if (!ksu_mount_monitor_enabled ) {
600
+ return 0 ;
601
+ }
602
+
596
603
char * device_name_copy = kstrdup (dev_name , GFP_KERNEL );
597
604
char * fstype_copy = kstrdup (type , GFP_KERNEL );
598
605
char * dirname_copy = kstrdup (dirname , GFP_KERNEL );
@@ -704,6 +711,10 @@ static int ksu_task_fix_setuid(struct cred *new, const struct cred *old,
704
711
static int ksu_sb_mount (const char * dev_name , const struct path * path ,
705
712
const char * type , unsigned long flags , void * data )
706
713
{
714
+ if (!ksu_mount_monitor_enabled ) {
715
+ return 0 ;
716
+ }
717
+
707
718
char buf [256 ];
708
719
char * dir_name = d_path (path , buf , sizeof (buf ));
709
720
0 commit comments