[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xen-cvs
Subject:    [xen staging] tools/xenstore: fix event sending in introduce_domain()
From:       patchbot () xen ! org
Date:       2022-05-25 11:11:04
Message-ID: E1ntouu-0007Za-5Z () xenbits ! xenproject ! org
[Download RAW message or body]

commit 49dd52fb1311dadab29f6634d0bc1f4c022c357a
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed May 25 12:55:49 2022 +0200
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed May 25 12:10:03 2022 +0100

    tools/xenstore: fix event sending in introduce_domain()
    
    Commit fc2b57c9af46 ("xenstored: send an evtchn notification on
    introduce_domain") introduced a potential NULL dereference in case of
    Xenstore live update.
    
    Fix that by adding an appropriate check.
    
    Coverity-Id: 1504572
    Fixes: fc2b57c9af46 ("xenstored: send an evtchn notification on introduce_domain")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/xenstore/xenstored_domain.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index de88bf2a68..ead4c237d2 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -493,9 +493,11 @@ static struct domain *introduce_domain(const void *ctx,
 		/* Now domain belongs to its connection. */
 		talloc_steal(domain->conn, domain);
 
-		/* Notify the domain that xenstore is available */
-		interface->connection = XENSTORE_CONNECTED;
-		xenevtchn_notify(xce_handle, domain->port);
+		if (!restore) {
+			/* Notify the domain that xenstore is available */
+			interface->connection = XENSTORE_CONNECTED;
+			xenevtchn_notify(xce_handle, domain->port);
+		}
 
 		if (!is_master_domain && !restore)
 			fire_watches(NULL, ctx, "@introduceDomain", NULL,
--
generated by git-patchbot for /home/xen/git/xen.git#staging

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic