From 42a28f06a75e3df8465bc069e824cab8e8364064 Mon Sep 17 00:00:00 2001 From: bygalacos <57764369+bygalacos@users.noreply.github.com> Date: Sun, 15 Nov 2026 17:57:31 +0000 Subject: [PATCH] compat: standardize log prefixes to KernelSU: : form The Samsung compat layer mixes three log-prefix styles: rkp.c uses "ksu:", kdp.c and defex.c use "KSU:" (which doubles to the redundant "KernelSU: KSU:" after klog.h's pr_fmt), and the detection lines carry no tag at all. The rest of the tree consistently uses a lowercase per-subsystem tag (lsm_hook:, selinux_hide:, sepol:, feature:, preinit:, hook_manager:, ...). Normalize the compat layer to match: rkp.c -> "rkp:", kdp.c -> "kdp:", defex.c -> "defex:". Log strings only; no functional change. --- kernel/compat/defex.c | 4 ++-- kernel/compat/kdp.c | 4 ++-- kernel/compat/rkp.c | 20 ++++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/kernel/compat/defex.c b/kernel/compat/defex.c index 81cb0633aa0b..6df4c2f653f6 100644 --- a/kernel/compat/defex.c +++ b/kernel/compat/defex.c @@ -17,8 +17,8 @@ void defex_jb_init(void) return; if (ksu_rkp_branch_patch(&defex_enforce_fn, &new_fn)) { - pr_warn("KSU: DEFEX patch failed\n"); + pr_warn("defex: patch failed\n"); return; } - pr_info("KSU: Samsung DEFEX detected\n"); + pr_info("defex: Samsung DEFEX detected\n"); } diff --git a/kernel/compat/kdp.c b/kernel/compat/kdp.c index c7c005a8118e..e41fc27f0cb0 100644 --- a/kernel/compat/kdp.c +++ b/kernel/compat/kdp.c @@ -102,7 +102,7 @@ static void __nocfi kdp_commit_worker(struct work_struct *work) ksu_put_cred(old_cred); cw->result = 0; - pr_info("KSU: KDP cred install pid=%d uid=%u euid=%u\n", task_pid_nr(cw->target), __kuid_val(ro_cred->uid), + pr_info("kdp: cred install pid=%d uid=%u euid=%u\n", task_pid_nr(cw->target), __kuid_val(ro_cred->uid), __kuid_val(ro_cred->euid)); out: complete(&cw->completion); @@ -177,7 +177,7 @@ void kdp_jb_init(void) return; #endif static_branch_enable(&ksu_kdp_key); - pr_info("KSU: Samsung KDP detected\n"); + pr_info("kdp: Samsung KDP detected\n"); } void kdp_jb_exit(void) diff --git a/kernel/compat/rkp.c b/kernel/compat/rkp.c index 9a3afa247111..ebf3c59288ab 100644 --- a/kernel/compat/rkp.c +++ b/kernel/compat/rkp.c @@ -12,7 +12,7 @@ void rkp_jb_init(void) { if (find_kernel_symbol_exact("rkp_started")) { static_branch_enable(&ksu_rkp_key); - pr_info("Samsung RKP detected\n"); + pr_info("rkp: Samsung RKP detected\n"); } } @@ -128,7 +128,7 @@ int ksu_rkp_branch_patch(void *dst, void *src) ret = aarch64_insn_patch_text(&restore_addr, &insn_at_patch, 1); if (ret) { mutex_unlock(&ksu_site_lock); - pr_err("ksu: branch site restore failed at %pS: %d\n", current_fn, ret); + pr_err("rkp: branch site restore failed at %pS: %d\n", current_fn, ret); return ret; } if (site->insn_at_fn0) { @@ -136,12 +136,12 @@ int ksu_rkp_branch_patch(void *dst, void *src) ret = aarch64_insn_patch_text(¤t_fn, &insn_fn0, 1); if (ret) { mutex_unlock(&ksu_site_lock); - pr_err("ksu: branch site fn+0 restore failed at %pS: %d\n", current_fn, ret); + pr_err("rkp: branch site fn+0 restore failed at %pS: %d\n", current_fn, ret); return ret; } } *site = ksu_sites[--ksu_site_count]; - pr_info("ksu: branch site removed at %pS\n", current_fn); + pr_info("rkp: branch site removed at %pS\n", current_fn); if (new_fn == current_fn) { mutex_unlock(&ksu_site_lock); return 0; @@ -155,7 +155,7 @@ int ksu_rkp_branch_patch(void *dst, void *src) if (ksu_site_count >= KSU_MAX_BRANCH_SITES) { mutex_unlock(&ksu_site_lock); - pr_err("ksu: branch site table full\n"); + pr_err("rkp: branch site table full\n"); return -ENOMEM; } @@ -175,7 +175,7 @@ int ksu_rkp_branch_patch(void *dst, void *src) if (ksu_stub_next >= (int)(PAGE_SIZE / KSU_STUB_SIZE)) { mutex_unlock(&ksu_site_lock); - pr_err("ksu: stub page full\n"); + pr_err("rkp: stub page full\n"); return -ENOMEM; } @@ -196,7 +196,7 @@ int ksu_rkp_branch_patch(void *dst, void *src) if (ksu_insn_is_pc_relative(insn_at_patch)) { mutex_unlock(&ksu_site_lock); - pr_err("ksu: %pS: insn at +%d is PC-relative, cannot install\n", current_fn, preamble_skip * 4); + pr_err("rkp: %pS: insn at +%d is PC-relative, cannot install\n", current_fn, preamble_skip * 4); return -EINVAL; } @@ -211,7 +211,7 @@ int ksu_rkp_branch_patch(void *dst, void *src) branch_b = ksu_encode_b(patch_addr, new_fn); if (!branch_b) { mutex_unlock(&ksu_site_lock); - pr_err("ksu: %pS: branch to %pS out of ±128MB range\n", patch_addr, new_fn); + pr_err("rkp: %pS: branch to %pS out of ±128MB range\n", patch_addr, new_fn); return -ERANGE; } @@ -223,7 +223,7 @@ int ksu_rkp_branch_patch(void *dst, void *src) if (!b_resume) { ksu_stub_next--; mutex_unlock(&ksu_site_lock); - pr_err("ksu: stub → %pS resume branch out of range\n", current_fn); + pr_err("rkp: stub → %pS resume branch out of range\n", current_fn); return -ERANGE; } @@ -259,7 +259,7 @@ int ksu_rkp_branch_patch(void *dst, void *src) .stub_idx = stub_idx, .preamble_skip = preamble_skip, }; - pr_info("ksu: branch site installed: %pS → %pS (stub[%d])\n", current_fn, new_fn, stub_idx); + pr_info("rkp: branch site installed: %pS → %pS (stub[%d])\n", current_fn, new_fn, stub_idx); mutex_unlock(&ksu_site_lock); return 0;