Skip to content

Commit

Permalink
kernel: fix sometimes sucompat can not toggle by manager (#2484)
Browse files Browse the repository at this point in the history
When the manager is already running, if other programs / kernel toggle
the sucompat enable status,
The manager "Disable SU Compat" toggle button can not work, kmesg print
"cmd enable su but no need to change."

I think we should still return reply_ok when the syscall value is
consistent with the kernel, which would fix the issue.
  • Loading branch information
AlexLiuDev233 authored Mar 1, 2025
1 parent fcfe038 commit 931abab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/core_hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,9 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
bool enabled = (arg3 != 0);
if (enabled == ksu_su_compat_enabled) {
pr_info("cmd enable su but no need to change.\n");
if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) {// return the reply_ok directly
pr_err("prctl reply error, cmd: %lu\n", arg2);
}
return 0;
}

Expand Down

0 comments on commit 931abab

Please sign in to comment.