mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:04:51 +01:00
MIPS: Don't use %pK through printk
Restricted pointers ("%pK") are not meant to be used through printk().
It can unintentionally expose security sensitive, raw pointer values.
Use regular pointer formatting instead.
Link: https://lore.kernel.org/lkml/20250113171731-dc10e3c1-da64-4af0-b767-7c7070468023@linutronix.de/
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
This commit is contained in:
parent
748f8b27b0
commit
3ebcbf079c
3 changed files with 7 additions and 7 deletions
|
|
@ -138,7 +138,7 @@ static int __init reloc_handler(u32 type, u32 *loc_orig, u32 *loc_new,
|
|||
apply_r_mips_hi16_rel(loc_orig, loc_new, offset);
|
||||
break;
|
||||
default:
|
||||
pr_err("Unhandled relocation type %d at 0x%pK\n", type,
|
||||
pr_err("Unhandled relocation type %d at 0x%p\n", type,
|
||||
loc_orig);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
|
@ -439,10 +439,10 @@ static void show_kernel_relocation(const char *level)
|
|||
{
|
||||
if (__kaslr_offset > 0) {
|
||||
printk(level);
|
||||
pr_cont("Kernel relocated by 0x%pK\n", (void *)__kaslr_offset);
|
||||
pr_cont(" .text @ 0x%pK\n", _text);
|
||||
pr_cont(" .data @ 0x%pK\n", _sdata);
|
||||
pr_cont(" .bss @ 0x%pK\n", __bss_start);
|
||||
pr_cont("Kernel relocated by 0x%p\n", (void *)__kaslr_offset);
|
||||
pr_cont(" .text @ 0x%p\n", _text);
|
||||
pr_cont(" .data @ 0x%p\n", _sdata);
|
||||
pr_cont(" .bss @ 0x%p\n", __bss_start);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
|
|||
* we allocate is out of range, just give up now.
|
||||
*/
|
||||
if (!cpu_has_ebase_wg && virt_to_phys(gebase) >= 0x20000000) {
|
||||
kvm_err("CP0_EBase.WG required for guest exception base %pK\n",
|
||||
kvm_err("CP0_EBase.WG required for guest exception base %p\n",
|
||||
gebase);
|
||||
err = -ENOMEM;
|
||||
goto out_free_gebase;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ static inline bool __debug_virt_addr_valid(unsigned long x)
|
|||
phys_addr_t __virt_to_phys(volatile const void *x)
|
||||
{
|
||||
WARN(!__debug_virt_addr_valid((unsigned long)x),
|
||||
"virt_to_phys used for non-linear address: %pK (%pS)\n",
|
||||
"virt_to_phys used for non-linear address: %p (%pS)\n",
|
||||
x, x);
|
||||
|
||||
return __virt_to_phys_nodebug(x);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue