From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
"Michael Mueller" <mimu@linux.ibm.com>,
"Janosch Frank" <frankja@linux.ibm.com>,
"Sasha Levin" <sashal@kernel.org>,
borntraeger@linux.ibm.com, imbrenda@linux.ibm.com,
hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com,
kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: [PATCH AUTOSEL 6.12 02/30] KVM: s390: Don't use %pK through debug printing
Date: Mon, 14 Apr 2025 09:28:19 -0400 [thread overview]
Message-ID: <20250414132848.679855-2-sashal@kernel.org> (raw)
In-Reply-To: <20250414132848.679855-1-sashal@kernel.org>
From: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
[ Upstream commit 0c7fbae5bc782429c97d68dc40fb126748d7e352 ]
Restricted pointers ("%pK") are only meant to be used when directly
printing to a file from task context.
Otherwise 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>
Reviewed-by: Michael Mueller <mimu@linux.ibm.com>
Tested-by: Michael Mueller <mimu@linux.ibm.com>
Link: https://lore.kernel.org/r/20250217-restricted-pointers-s390-v1-2-0e4ace75d8aa@linutronix.de
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Message-ID: <20250217-restricted-pointers-s390-v1-2-0e4ace75d8aa@linutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/s390/kvm/intercept.c | 2 +-
arch/s390/kvm/interrupt.c | 8 ++++----
arch/s390/kvm/kvm-s390.c | 10 +++++-----
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c
index b16352083ff98..f0be263b334ce 100644
--- a/arch/s390/kvm/intercept.c
+++ b/arch/s390/kvm/intercept.c
@@ -94,7 +94,7 @@ static int handle_validity(struct kvm_vcpu *vcpu)
vcpu->stat.exit_validity++;
trace_kvm_s390_intercept_validity(vcpu, viwhy);
- KVM_EVENT(3, "validity intercept 0x%x for pid %u (kvm 0x%pK)", viwhy,
+ KVM_EVENT(3, "validity intercept 0x%x for pid %u (kvm 0x%p)", viwhy,
current->pid, vcpu->kvm);
/* do not warn on invalid runtime instrumentation mode */
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 4f0e7f61edf78..bc65fa6dc1555 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -3161,7 +3161,7 @@ void kvm_s390_gisa_clear(struct kvm *kvm)
if (!gi->origin)
return;
gisa_clear_ipm(gi->origin);
- VM_EVENT(kvm, 3, "gisa 0x%pK cleared", gi->origin);
+ VM_EVENT(kvm, 3, "gisa 0x%p cleared", gi->origin);
}
void kvm_s390_gisa_init(struct kvm *kvm)
@@ -3178,7 +3178,7 @@ void kvm_s390_gisa_init(struct kvm *kvm)
gi->timer.function = gisa_vcpu_kicker;
memset(gi->origin, 0, sizeof(struct kvm_s390_gisa));
gi->origin->next_alert = (u32)virt_to_phys(gi->origin);
- VM_EVENT(kvm, 3, "gisa 0x%pK initialized", gi->origin);
+ VM_EVENT(kvm, 3, "gisa 0x%p initialized", gi->origin);
}
void kvm_s390_gisa_enable(struct kvm *kvm)
@@ -3219,7 +3219,7 @@ void kvm_s390_gisa_destroy(struct kvm *kvm)
process_gib_alert_list();
hrtimer_cancel(&gi->timer);
gi->origin = NULL;
- VM_EVENT(kvm, 3, "gisa 0x%pK destroyed", gisa);
+ VM_EVENT(kvm, 3, "gisa 0x%p destroyed", gisa);
}
void kvm_s390_gisa_disable(struct kvm *kvm)
@@ -3468,7 +3468,7 @@ int __init kvm_s390_gib_init(u8 nisc)
}
}
- KVM_EVENT(3, "gib 0x%pK (nisc=%d) initialized", gib, gib->nisc);
+ KVM_EVENT(3, "gib 0x%p (nisc=%d) initialized", gib, gib->nisc);
goto out;
out_unreg_gal:
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index bb7134faaebff..286a224c81ee4 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -998,7 +998,7 @@ static int kvm_s390_set_mem_control(struct kvm *kvm, struct kvm_device_attr *att
}
mutex_unlock(&kvm->lock);
VM_EVENT(kvm, 3, "SET: max guest address: %lu", new_limit);
- VM_EVENT(kvm, 3, "New guest asce: 0x%pK",
+ VM_EVENT(kvm, 3, "New guest asce: 0x%p",
(void *) kvm->arch.gmap->asce);
break;
}
@@ -3421,7 +3421,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
kvm_s390_gisa_init(kvm);
INIT_LIST_HEAD(&kvm->arch.pv.need_cleanup);
kvm->arch.pv.set_aside = NULL;
- KVM_EVENT(3, "vm 0x%pK created by pid %u", kvm, current->pid);
+ KVM_EVENT(3, "vm 0x%p created by pid %u", kvm, current->pid);
return 0;
out_err:
@@ -3484,7 +3484,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm)
kvm_s390_destroy_adapters(kvm);
kvm_s390_clear_float_irqs(kvm);
kvm_s390_vsie_destroy(kvm);
- KVM_EVENT(3, "vm 0x%pK destroyed", kvm);
+ KVM_EVENT(3, "vm 0x%p destroyed", kvm);
}
/* Section: vcpu related */
@@ -3605,7 +3605,7 @@ static int sca_switch_to_extended(struct kvm *kvm)
free_page((unsigned long)old_sca);
- VM_EVENT(kvm, 2, "Switched to ESCA (0x%pK -> 0x%pK)",
+ VM_EVENT(kvm, 2, "Switched to ESCA (0x%p -> 0x%p)",
old_sca, kvm->arch.sca);
return 0;
}
@@ -3978,7 +3978,7 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
goto out_free_sie_block;
}
- VM_EVENT(vcpu->kvm, 3, "create cpu %d at 0x%pK, sie block at 0x%pK",
+ VM_EVENT(vcpu->kvm, 3, "create cpu %d at 0x%p, sie block at 0x%p",
vcpu->vcpu_id, vcpu, vcpu->arch.sie_block);
trace_kvm_s390_create_vcpu(vcpu->vcpu_id, vcpu, vcpu->arch.sie_block);
--
2.39.5
next prev parent reply other threads:[~2025-04-14 13:28 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-14 13:28 [PATCH AUTOSEL 6.12 01/30] KVM: s390: Don't use %pK through tracepoints Sasha Levin
2025-04-14 13:28 ` Sasha Levin [this message]
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 03/30] cgroup/cpuset: Don't allow creation of local partition over a remote one Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 04/30] selftests: ublk: fix test_stripe_04 Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 05/30] perf/core: Fix WARN_ON(!ctx) in __free_event() for partial init Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 06/30] xen: Change xen-acpi-processor dom0 dependency Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 07/30] nvme: requeue namespace scan on missed AENs Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 08/30] ACPI: EC: Set ec_no_wakeup for Lenovo Go S Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 09/30] ACPI PPTT: Fix coding mistakes in a couple of sizeof() calls Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 10/30] drm/amdgpu: Increase KIQ invalidate_tlbs timeout Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 11/30] drm/amdgpu: allow pinning DMA-bufs into VRAM if all importers can do P2P Sasha Levin
2025-04-14 13:31 ` Alex Deucher
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 12/30] drm/xe/xe3lpg: Apply Wa_14022293748, Wa_22019794406 Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 13/30] nvme: re-read ANA log page after ns scan completes Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 14/30] nvme: multipath: fix return value of nvme_available_path Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 15/30] objtool: Stop UNRET validation on UD2 Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 16/30] gpiolib: of: Move Atmel HSMCI quirk up out of the regulator comment Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 17/30] x86/xen: disable CPU idle and frequency drivers for PVH dom0 Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 18/30] selftests/mincore: Allow read-ahead pages to reach the end of the file Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 19/30] x86/bugs: Use SBPB in write_ibpb() if applicable Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 20/30] x86/bugs: Don't fill RSB on VMEXIT with eIBRS+retpoline Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 21/30] x86/bugs: Don't fill RSB on context switch with eIBRS Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 22/30] nvmet-fc: take tgtport reference only once Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 23/30] nvmet-fc: put ref when assoc->del_work is already scheduled Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 24/30] net_sched: sch_sfq: use a temporary work area for validating configuration Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 25/30] cifs: Fix encoding of SMB1 Session Setup Kerberos Request in non-UNICODE mode Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 26/30] timekeeping: Add a lockdep override in tick_freeze() Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 27/30] cifs: Fix querying of WSL CHR and BLK reparse points over SMB1 Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 28/30] net: phy: move phy_link_change() prior to mdio_bus_phy_may_suspend() Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 29/30] iommu: Clear iommu-dma ops on cleanup Sasha Levin
2025-04-14 13:28 ` [PATCH AUTOSEL 6.12 30/30] ext4: make block validity check resistent to sb bh corruption Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250414132848.679855-2-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=frankja@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mimu@linux.ibm.com \
--cc=stable@vger.kernel.org \
--cc=thomas.weissschuh@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox