Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [PATCH] KVM: x86: Fix null pointer dereference in trace_kvm_inj_exception
@ 2026-07-10 13:40 Daniel Paziyski
  2026-07-10 13:53 ` sashiko-bot
  2026-07-10 18:42 ` Sean Christopherson
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Paziyski @ 2026-07-10 13:40 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, x86
  Cc: Daniel Paziyski, H. Peter Anvin, kvm, linux-kernel

The trace_kvm_inj_exception tracepoint takes as arguments the exception
vector, whether the exception has an error code (and subsequently, the
error code), and whether it is being reinjected. The error code is
formatted to the trace log as a string using __print_symbolic,
which takes an integer value and an array of structs containing a mask
value and a string. An empty struct is being passed, which makes the
kernel derefence a NULL pointer when the error code is 0. Remove this
stray struct in the invocation of __print_symbolic.

Signed-off-by: Daniel Paziyski <danielpaziyski@gmail.com>
---
 arch/x86/kvm/trace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
index 0db25bba1..93de876c3 100644
--- a/arch/x86/kvm/trace.h
+++ b/arch/x86/kvm/trace.h
@@ -490,7 +490,7 @@ TRACE_EVENT(kvm_inj_exception,
 	TP_printk("%s%s%s%s%s",
 		  __print_symbolic(__entry->exception, kvm_trace_sym_exc),
 		  !__entry->has_error ? "" : " (",
-		  !__entry->has_error ? "" : __print_symbolic(__entry->error_code, { }),
+		  !__entry->has_error ? "" : __print_symbolic(__entry->error_code),
 		  !__entry->has_error ? "" : ")",
 		  __entry->reinjected ? " [reinjected]" : "")
 );
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-10 19:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-10 13:40 [PATCH] KVM: x86: Fix null pointer dereference in trace_kvm_inj_exception Daniel Paziyski
2026-07-10 13:53 ` sashiko-bot
2026-07-10 18:35   ` Sean Christopherson
2026-07-10 18:42 ` Sean Christopherson
2026-07-10 19:34   ` Daniel Paziyski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox