Skip to content

Commit c6b60a2

Browse files
authored
ksud: Add second_stage init variant (tiann#653)
There are some ROMs based on AOSP that calls on second stage init with argc: 2 but with first_arg: "". This causes KSU to not work properly on those systems. Signed-off-by: Edrick Sinsuan <[email protected]>
1 parent 1baedd8 commit c6b60a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/ksud.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ int ksu_handle_execveat_ksud(int *fd, struct filename **filename_ptr,
201201
first_arg, p, sizeof(first_arg));
202202
pr_info("/system/bin/init first arg: %s\n",
203203
first_arg);
204-
if (!strcmp(first_arg, "second_stage")) {
204+
if (!strcmp(first_arg, "second_stage") ||
205+
(argc == 2 && !strcmp(first_arg, ""))) {
205206
pr_info("/system/bin/init second_stage executed\n");
206207
apply_kernelsu_rules();
207208
init_second_stage_executed = true;

0 commit comments

Comments
 (0)