diff --git a/kernel/core_hook.c b/kernel/core_hook.c index 1678db5f..82b2dfc0 100644 --- a/kernel/core_hook.c +++ b/kernel/core_hook.c @@ -289,7 +289,7 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3, if (arg2 == CMD_GRANT_ROOT) { if (is_allow_su()) { - pr_info("allow root for: %d\n", current_uid()); + pr_info("allow root for: %d\n", current_uid().val); escape_to_root(); if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) { pr_err("grant_root: prctl reply error\n"); @@ -303,7 +303,7 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3, if (is_manager() || 0 == current_uid().val) { u32 version = KERNEL_SU_VERSION; if (copy_to_user(arg3, &version, sizeof(version))) { - pr_err("prctl reply error, cmd: %d\n", arg2); + pr_err("prctl reply error, cmd: %lu\n", arg2); } } return 0; @@ -377,7 +377,7 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3, sizeof(u32) * array_length)) { if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) { - pr_err("prctl reply error, cmd: %d\n", + pr_err("prctl reply error, cmd: %lu\n", arg2); } } else { @@ -397,16 +397,16 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3, } else if (arg2 == CMD_UID_SHOULD_UMOUNT) { allow = ksu_uid_should_umount(target_uid); } else { - pr_err("unknown cmd: %d\n", arg2); + pr_err("unknown cmd: %lu\n", arg2); } if (!copy_to_user(arg4, &allow, sizeof(allow))) { if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) { - pr_err("prctl reply error, cmd: %d\n", + pr_err("prctl reply error, cmd: %lu\n", arg2); } } else { - pr_err("prctl copy err, cmd: %d\n", arg2); + pr_err("prctl copy err, cmd: %lu\n", arg2); } } return 0; @@ -433,7 +433,7 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3, return 0; } if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) { - pr_err("prctl reply error, cmd: %d\n", arg2); + pr_err("prctl reply error, cmd: %lu\n", arg2); } } return 0; @@ -449,7 +449,7 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3, // todo: validate the params if (ksu_set_app_profile(&profile, true)) { if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) { - pr_err("prctl reply error, cmd: %d\n", arg2); + pr_err("prctl reply error, cmd: %lu\n", arg2); } } return 0; diff --git a/kernel/ksud.c b/kernel/ksud.c index db50eee4..0be30ef9 100644 --- a/kernel/ksud.c +++ b/kernel/ksud.c @@ -340,17 +340,17 @@ int ksu_handle_vfs_read(struct file **file_ptr, char __user **buf_ptr, size_t rc_count = strlen(KERNEL_SU_RC); - pr_info("vfs_read: %s, comm: %s, count: %d, rc_count: %d\n", dpath, + pr_info("vfs_read: %s, comm: %s, count: %zu, rc_count: %zu\n", dpath, current->comm, count, rc_count); if (count < rc_count) { - pr_err("count: %d < rc_count: %d\n", count, rc_count); + pr_err("count: %zu < rc_count: %zu\n", count, rc_count); return 0; } size_t ret = copy_to_user(buf, KERNEL_SU_RC, rc_count); if (ret) { - pr_err("copy ksud.rc failed: %d\n", ret); + pr_err("copy ksud.rc failed: %zu\n", ret); return 0; } diff --git a/kernel/uid_observer.c b/kernel/uid_observer.c index 09b0d71f..808f61cb 100644 --- a/kernel/uid_observer.c +++ b/kernel/uid_observer.c @@ -45,7 +45,7 @@ static void do_update_uid(struct work_struct *work) ksu_filp_open_compat(SYSTEM_PACKAGES_LIST_PATH, O_RDONLY, 0); if (IS_ERR(fp)) { pr_err("do_update_uid, open " SYSTEM_PACKAGES_LIST_PATH - " failed: %d\n", + " failed: %ld\n", PTR_ERR(fp)); return; }