* [PATCH] KVM: remove printing of vcpu address
@ 2017-10-09 6:31 Tobin C. Harding
2017-10-13 8:16 ` Christoffer Dall
0 siblings, 1 reply; 2+ messages in thread
From: Tobin C. Harding @ 2017-10-09 6:31 UTC (permalink / raw)
To: Christoffer Dall, Marc Zyngier; +Cc: kvmarm, linux-kernel, Tobin C. Harding
Code currently prints the address of the kvm_vcpu structure in an error
message. It is not immediately clear what value this address adds to
the error string, we can use the vcpu ID instead. Printing unnecessary
kernel addresses to dmesg poses a security risk.
Remove the address from error message output, show vcpu ID instead.
Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
virt/kvm/arm/arch_timer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
index 8e89d63005c7..ca6c331cad28 100644
--- a/virt/kvm/arm/arch_timer.c
+++ b/virt/kvm/arm/arch_timer.c
@@ -88,7 +88,7 @@ static irqreturn_t kvm_arch_timer_handler(int irq, void *dev_id)
* interrupt at this point is a sure sign of some major
* breakage.
*/
- pr_warn("Unexpected interrupt %d on vcpu %p\n", irq, vcpu);
+ pr_warn("Unexpected interrupt %d on vcpu ID %d\n", irq, vcpu->vcpu_id);
return IRQ_HANDLED;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] KVM: remove printing of vcpu address
2017-10-09 6:31 [PATCH] KVM: remove printing of vcpu address Tobin C. Harding
@ 2017-10-13 8:16 ` Christoffer Dall
0 siblings, 0 replies; 2+ messages in thread
From: Christoffer Dall @ 2017-10-13 8:16 UTC (permalink / raw)
To: Tobin C. Harding; +Cc: Christoffer Dall, Marc Zyngier, kvmarm, linux-kernel
On Mon, Oct 09, 2017 at 05:31:41PM +1100, Tobin C. Harding wrote:
> Code currently prints the address of the kvm_vcpu structure in an error
> message. It is not immediately clear what value this address adds to
> the error string, we can use the vcpu ID instead.
I would say it's not immediately clear how the vcpu ID is more valuable.
The pointer identifies a unique vcpu across all VMs, vcpu ID does not.
> Printing unnecessary
> kernel addresses to dmesg poses a security risk.
Is this really a concern we have for error messages? I understand you
can get a single pointer revealed if you have broken hardware or if we
have a bug, but I see numerious other examples in the kernel.
If anything, we can remote printing the vcpu pointer entirely.
Thanks,
-Christoffer
>
> Remove the address from error message output, show vcpu ID instead.
>
> Signed-off-by: Tobin C. Harding <me@tobin.cc>
> ---
> virt/kvm/arm/arch_timer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
> index 8e89d63005c7..ca6c331cad28 100644
> --- a/virt/kvm/arm/arch_timer.c
> +++ b/virt/kvm/arm/arch_timer.c
> @@ -88,7 +88,7 @@ static irqreturn_t kvm_arch_timer_handler(int irq, void *dev_id)
> * interrupt at this point is a sure sign of some major
> * breakage.
> */
> - pr_warn("Unexpected interrupt %d on vcpu %p\n", irq, vcpu);
> + pr_warn("Unexpected interrupt %d on vcpu ID %d\n", irq, vcpu->vcpu_id);
> return IRQ_HANDLED;
> }
>
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-13 8:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-09 6:31 [PATCH] KVM: remove printing of vcpu address Tobin C. Harding
2017-10-13 8:16 ` Christoffer Dall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox