Skip to contentSkip to conversation

x86/viridian: Do not leak page refs and mappings if the host tsc is unstable.

PATCH In review Andrew Cooper 2 participants 2 messages Jan 14, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/viridian: Do not leak page refs and mappings if the host tsc is unstable.

Coverity-ID: 1264360
CC: Keir Fraser <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Paul Durrant <[email protected]>
CC: Xen Coverity Team <[email protected]>

---
 xen/arch/x86/hvm/viridian.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
xen/arch/x86/hvm/viridian.c +2 -1
index cb689f6..1e5a570 100644
@@ -287,7 +287,7 @@ static void update_reference_tsc(struct domain *d, bool_t initialize)
 
         printk(XENLOG_G_INFO "d%d: VIRIDIAN REFERENCE_TSC: invalidated\n",
                d->domain_id);
-        return;
+        goto out;
     }
 
     /*
@@ -306,6 +306,7 @@ static void update_reference_tsc(struct domain *d, bool_t initialize)
          p->TscSequence == 0 ) /* Avoid both 'invalid' values */
         p->TscSequence = 1;
 
+ out:
     unmap_domain_page(p);
 
     put_page_and_type(page);
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines

-----Original Message-----
From: Andrew Cooper [mailto:[email protected]]
Sent: 14 January 2015 14:33
To: Xen-devel
Cc: Andrew Cooper; Keir (Xen.org); Jan Beulich; Paul Durrant; Xen Coverity Team
Subject: [PATCH] x86/viridian: Do not leak page refs and mappings if the host tsc is unstable.

Quoted 5 lines

Coverity-ID: 1264360
CC: Keir Fraser <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Paul Durrant <[email protected]>

Quoted 31 lines
CC Xen Coverity Team <[email protected]>
---
 xen/arch/x86/hvm/viridian.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
xen/arch/x86/hvm/viridian.c +1 -1
index cb689f6..1e5a570 100644
@@ -287,7 +287,7 @@ static void update_reference_tsc(struct domain *d,
 bool_t initialize)
 
         printk(XENLOG_G_INFO "d%d: VIRIDIAN REFERENCE_TSC:
 invalidated\n",
                d->domain_id);
-        return;
+        goto out;
     }
     /*
xen/arch/x86/hvm/viridian.c +1 -0
@@ -306,6 +306,7 @@ static void update_reference_tsc(struct domain *d,
 bool_t initialize)
          p->TscSequence == 0 ) /* Avoid both 'invalid' values */
         p->TscSequence = 1;
 
+ out:
     unmap_domain_page(p);
 
     put_page_and_type(page);

--
1.7.10.4