xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/mem_sharing: fix uninitialized 'preempted' variable
@ 2021-01-18 17:23 Tamas K Lengyel
  2021-01-18 17:25 ` Andrew Cooper
  0 siblings, 1 reply; 2+ messages in thread
From: Tamas K Lengyel @ 2021-01-18 17:23 UTC (permalink / raw)
  To: xen-devel
  Cc: Tamas K Lengyel, Jan Beulich, Andrew Cooper, George Dunlap,
	Roger Pau Monné,
	Wei Liu

UBSAN catches an uninitialized use of the 'preempted' variable in
fork_hap_allocation when there is no preemption.

Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/mm/mem_sharing.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index c8a6d11b90..adaeab4612 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1644,7 +1644,7 @@ static int copy_vcpu_settings(struct domain *cd, const struct domain *d)
 static int fork_hap_allocation(struct domain *cd, struct domain *d)
 {
     int rc;
-    bool preempted;
+    bool preempted = false;
     unsigned long mb = hap_get_allocation(d);
 
     if ( mb == hap_get_allocation(cd) )
-- 
2.25.1



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

* Re: [PATCH] x86/mem_sharing: fix uninitialized 'preempted' variable
  2021-01-18 17:23 [PATCH] x86/mem_sharing: fix uninitialized 'preempted' variable Tamas K Lengyel
@ 2021-01-18 17:25 ` Andrew Cooper
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cooper @ 2021-01-18 17:25 UTC (permalink / raw)
  To: Tamas K Lengyel, xen-devel
  Cc: Jan Beulich, George Dunlap, Roger Pau Monné, Wei Liu

On 18/01/2021 17:23, Tamas K Lengyel wrote:
> UBSAN catches an uninitialized use of the 'preempted' variable in
> fork_hap_allocation when there is no preemption.

Fixes: 41548c5472a ("mem_sharing: VM forking")

> Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


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

end of thread, other threads:[~2021-01-18 17:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 17:23 [PATCH] x86/mem_sharing: fix uninitialized 'preempted' variable Tamas K Lengyel
2021-01-18 17:25 ` 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).