From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>, Julien Grall <julien@xen.org>,
Anthony PERARD <anthony.perard@vates.tech>,
Jason Andryuk <jason.andryuk@amd.com>
Subject: [PATCH v2 3/4] tools/xenstored: allow @releaseDomain watch for all domains
Date: Wed, 29 Apr 2026 14:06:18 +0200 [thread overview]
Message-ID: <20260429120619.1013440-4-jgross@suse.com> (raw)
In-Reply-To: <20260429120619.1013440-1-jgross@suse.com>
Currently the @releaseDomain watch is allowed for dom0 only. This is
problematic for guests which want to give other domains access to
Xenstore entries, as they have no simple way to tell when such a
domain is stopped.
Allow @releaseDomain to be usable by all domains as the default.
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
tools/xenstored/core.c | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index 7dbcd5daad..d6d462b7bc 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -2279,19 +2279,19 @@ struct connection *get_connection_by_id(unsigned int conn_id)
}
/* We create initial nodes manually. */
-static void manual_node(const char *name, const char *child)
+static void manual_node_perms(const char *name, const char *child,
+ struct xs_permissions *perms,
+ unsigned int n_perms)
{
struct node *node;
- struct xs_permissions perms = { .id = priv_domid,
- .perms = XS_PERM_NONE };
node = talloc_zero(NULL, struct node);
if (!node)
barf_perror("Could not allocate initial node %s", name);
node->name = name;
- node->perms = &perms;
- node->hdr.num_perms = 1;
+ node->perms = perms;
+ node->hdr.num_perms = n_perms;
node->children = (char *)child;
if (child)
node->hdr.childlen = strlen(child) + 1;
@@ -2301,6 +2301,14 @@ static void manual_node(const char *name, const char *child)
talloc_free(node);
}
+static void manual_node(const char *name, const char *child)
+{
+ struct xs_permissions perms = { .id = priv_domid,
+ .perms = XS_PERM_NONE };
+
+ manual_node_perms(name, child, &perms, 1);
+}
+
static unsigned int hash_from_key_fn(const void *k)
{
const char *str = k;
@@ -2320,6 +2328,11 @@ static int keys_equal_fn(const void *key1, const void *key2)
void setup_structure(bool live_update)
{
+ struct xs_permissions perms[] = {
+ { .id = priv_domid, .perms = XS_PERM_NONE },
+ { .id = DOMID_ANY, .perms = XS_PERM_READ },
+ };
+
nodes = create_hashtable(NULL, "nodes", hash_from_key_fn, keys_equal_fn,
HASHTABLE_FREE_KEY | HASHTABLE_FREE_VALUE);
if (!nodes)
@@ -2331,7 +2344,8 @@ void setup_structure(bool live_update)
manual_node("/", "tool");
manual_node("/tool", "xenstored");
manual_node("/tool/xenstored", NULL);
- manual_node("@releaseDomain", NULL);
+ manual_node_perms("@releaseDomain", NULL,
+ perms, ARRAY_SIZE(perms));
manual_node("@introduceDomain", NULL);
domain_nbentry_fix(priv_domid, 5);
}
--
2.53.0
next prev parent reply other threads:[~2026-04-29 12:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-29 12:06 [PATCH v2 0/4] tools/xenstore: fix issue related to XSA-417 Juergen Gross
2026-04-29 12:06 ` [PATCH v2 1/4] xen/public: introduce DOMID_ANY Juergen Gross
2026-05-14 1:15 ` Stefano Stabellini
2026-04-29 12:06 ` [PATCH v2 2/4] tools/xenstored: add support for "all domains" node permission Juergen Gross
2026-04-29 12:06 ` Juergen Gross [this message]
2026-04-29 12:06 ` [PATCH v2 4/4] tools/xenstored: remove permissions related to dead domain Juergen Gross
2026-04-29 16:41 ` Jason Andryuk
2026-05-07 7:43 ` Jürgen Groß
2026-05-07 7:53 ` Jan Beulich
2026-05-12 15:48 ` [PATCH v2 0/4] tools/xenstore: fix issue related to XSA-417 Oleksii Kurochko
2026-05-12 15:52 ` Jürgen Groß
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260429120619.1013440-4-jgross@suse.com \
--to=jgross@suse.com \
--cc=anthony.perard@vates.tech \
--cc=jason.andryuk@amd.com \
--cc=julien@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.