Skip to contentSkip to conversation

xen: Add missing va_end() in hypercall_create_continuation()

PATCH In review Julien Grall 4 participants 4 messages Nov 20, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: Add missing va_end() in hypercall_create_continuation()

From: Julien Grall <[email protected]>

The documentation requires va_start() to always be matched with a corresponding va_end(). However, this is not the case in the path used for bad format.

This was introduced by XSA-296.

Coverity-ID: 1488727

Fixes 0bf9f8d3e3 ("xen/hypercall: Don't use BUG() for parameter checking in hypercall_create_continuation()")
---
 xen/arch/arm/domain.c    | 1 +
 xen/arch/x86/hypercall.c | 1 +
 2 files changed, 2 insertions(+)
xen/arch/arm/domain.c +1 -0
index 9e8e9d921d..c0a13aa0ab 100644
@@ -467,6 +467,7 @@ unsigned long hypercall_create_continuation(
     return rc;
 
  bad_fmt:
+    va_end(args);
     gprintk(XENLOG_ERR, "Bad hypercall continuation format '%c'\n", *p);
     ASSERT_UNREACHABLE();
     domain_crash(current->domain);
xen/arch/x86/hypercall.c +1 -0
index 4643e5eb43..1d42702c6a 100644
@@ -157,6 +157,7 @@ unsigned long hypercall_create_continuation(
     return op;
 
  bad_fmt:
+    va_end(args);
     gprintk(XENLOG_ERR, "Bad hypercall continuation format '%c'\n", *p);
     ASSERT_UNREACHABLE();
     domain_crash(curr->domain);
Signature · 7 lines
2.24.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Julien Grall

From: Julien Grall <[email protected]>

The documentation requires va_start() to always be matched with a corresponding va_end(). However, this is not the case in the path used for bad format.

This was introduced by XSA-296.

Coverity-ID: 1488727

Fixes 0bf9f8d3e3 ("xen/hypercall: Don't use BUG() for parameter checking in hypercall_create_continuation()")

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by
#2 lore raw
Quoted 7 lines · Jan Beulich
Quoted 6 lines · Julien Grall

From: Julien Grall <[email protected]>

The documentation requires va_start() to always be matched with a corresponding va_end(). However, this is not the case in the path used for bad format.

Quoted 6 lines
Quoted 5 lines

This was introduced by XSA-296.

Coverity-ID: 1488727

Fixes 0bf9f8d3e3 ("xen/hypercall: Don't use BUG() for parameter checking in hypercall_create_continuation()")

+ Juergen.  This is a bugfix to XSA-296 so will end up going out on older branches.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#3 lore raw
Quoted 8 lines · Andrew Cooper
Quoted 7 lines · Jan Beulich
Quoted 6 lines · Julien Grall

From: Julien Grall <[email protected]>

The documentation requires va_start() to always be matched with a corresponding va_end(). However, this is not the case in the path used for bad format.

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines

This was introduced by XSA-296.

Coverity-ID: 1488727

Fixes 0bf9f8d3e3 ("xen/hypercall: Don't use BUG() for parameter checking in hypercall_create_continuation()")

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel