Skip to content

Commit f4c4cfd

Browse files
committed
Sync SUSFS deferred work with ReSukiSU
1 parent 7414972 commit f4c4cfd

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

fs/susfs.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
extern bool susfs_is_current_ksu_domain(void);
2828
extern void setup_selinux(const char *domain, struct cred *cred);
29+
extern struct cred *ksu_cred;
2930

3031
#ifdef CONFIG_KSU_SUSFS_ENABLE_LOG
3132
DEFINE_STATIC_KEY_TRUE(susfs_is_log_enabled);
@@ -1446,11 +1447,25 @@ void susfs_start_sdcard_monitor_fn(void) {
14461447
}
14471448
}
14481449

1450+
/* Defer the potentially blocking sus-path loop work from the setuid hook. */
1451+
struct work_struct susfs_extra_works;
1452+
1453+
static void susfs_run_extra_works(struct work_struct *work)
1454+
{
1455+
if (!ksu_cred)
1456+
return;
1457+
1458+
#ifdef CONFIG_KSU_SUSFS_SUS_PATH
1459+
susfs_run_sus_path_loop();
1460+
#endif
1461+
}
1462+
14491463
/* susfs_init */
14501464
void susfs_init(void) {
1465+
SUSFS_LOGI("Initializing susfs_extra_works\n");
1466+
INIT_WORK(&susfs_extra_works, susfs_run_extra_works);
14511467
SUSFS_LOGI("susfs is initialized! version: " SUSFS_VERSION " \n");
14521468
}
14531469

14541470
/* No module exit is needed becuase it should never be a loadable kernel module */
14551471
//void __init susfs_exit(void)
1456-

0 commit comments

Comments
 (0)