xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/hvm_event: fix uninitialized struct field usage introduced by c/s f5365e6
@ 2016-02-18 10:45 Corneliu ZUZU
  2016-02-18 10:47 ` Razvan Cojocaru
  2016-02-18 10:50 ` Andrew Cooper
  0 siblings, 2 replies; 7+ messages in thread
From: Corneliu ZUZU @ 2016-02-18 10:45 UTC (permalink / raw)
  To: xen-devel
  Cc: Andrew Cooper, Tamas K Lengyel, Keir Fraser, Jan Beulich,
	Razvan Cojocaru

c/s f5365e6: "xen/vm-events: Move parts of monitor_domctl code to common-side",
introduced a use without initialization issue.
hvm_event_breakpoint calls hvm_event_traps(&req) and if sync is true that
ors some bits into req->flags which was never initialised.
Reported by Coverity Scan.

Initializes req @ hvm_event_breakpoint entry.

Signed-off-by: Corneliu ZUZU <czuzu@bitdefender.com>
---
 xen/arch/x86/hvm/event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/event.c b/xen/arch/x86/hvm/event.c
index 874a36c..cb9c152 100644
--- a/xen/arch/x86/hvm/event.c
+++ b/xen/arch/x86/hvm/event.c
@@ -173,7 +173,7 @@ int hvm_event_breakpoint(unsigned long rip,
 {
     struct vcpu *curr = current;
     struct arch_domain *ad = &curr->domain->arch;
-    vm_event_request_t req;
+    vm_event_request_t req = {};
 
     switch ( type )
     {
-- 
2.5.0

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

end of thread, other threads:[~2016-02-18 15:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-18 10:45 [PATCH] x86/hvm_event: fix uninitialized struct field usage introduced by c/s f5365e6 Corneliu ZUZU
2016-02-18 10:47 ` Razvan Cojocaru
2016-02-18 14:10   ` Tamas K Lengyel
2016-02-18 14:16     ` Razvan Cojocaru
2016-02-18 14:18       ` Andrew Cooper
2016-02-18 15:37         ` Tamas K Lengyel
2016-02-18 10:50 ` Andrew Cooper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).