[PATCH] tools/xenstored: fix possible NULL deref

Juergen Gross posted 1 patch 2 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20250820104617.5268-1-jgross@suse.com
tools/xenstored/domain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] tools/xenstored: fix possible NULL deref
Posted by Juergen Gross 2 months, 1 week ago
Avoid dereferencing NULL in introduce_domain() when called during
live update.

Coverity ID: 1665111
Fixes: f78895ad78c9 ("tools/xenstored: Read event channel from xenstored page")

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/xenstored/domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
index 694d68670a..5ce539d640 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c
@@ -1032,7 +1032,7 @@ static struct domain *introduce_domain(const void *ctx,
 		if (!interface && !restore)
 			return NULL;
 
-		if (interface->evtchn_port)
+		if (!restore && interface->evtchn_port)
 			port = interface->evtchn_port;
 
 		if (new_domain(domain, port, restore)) {
-- 
2.43.0
Re: [PATCH] tools/xenstored: fix possible NULL deref
Posted by Jason Andryuk 2 months, 1 week ago
On 2025-08-20 06:46, Juergen Gross wrote:
> Avoid dereferencing NULL in introduce_domain() when called during
> live update.
> 
> Coverity ID: 1665111
> Fixes: f78895ad78c9 ("tools/xenstored: Read event channel from xenstored page")
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>

Thanks,
Jason