Skip to content

Commit 95125c3

Browse files
authored
Relax prctl perm check
1 parent 0b6998b commit 95125c3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

kernel/core_hook.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,6 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
251251
u32 *result = (u32 *)arg5;
252252
u32 reply_ok = KERNEL_SU_OPTION;
253253

254-
if (KERNEL_SU_OPTION != option) {
255-
return 0;
256-
}
257-
258254
// TODO: find it in throne tracker!
259255
uid_t current_uid_val = current_uid().val;
260256
uid_t manager_uid = ksu_get_manager_uid();
@@ -264,13 +260,17 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
264260
}
265261

266262
bool from_root = 0 == current_uid().val;
267-
bool from_manager = is_manager();
263+
bool from_manager = is_allow_su();
268264

269265
if (!from_root && !from_manager) {
270266
// only root or manager can access this interface
271267
return 0;
272268
}
273269

270+
if (KERNEL_SU_OPTION != option) {
271+
return 0;
272+
}
273+
274274
#ifdef CONFIG_KSU_DEBUG
275275
pr_info("option: 0x%x, cmd: %ld\n", option, arg2);
276276
#endif

0 commit comments

Comments
 (0)