tools/xenstored: Check NULL domain in domain_chk_quota()

With separate control and xenstore domains, the xenstore domain itself
is no longer privileged.  Local socket connections do not have
conn->domain assigned, but domain_chk_quota() will go ahead and
dereference it.  The !domid_is_unprivileged(conn->id) check usually
means the function would have already returned.

Bail out on !conn->domain to avoid faulting.  This adds a similar check
to that in domain_max_chk()

Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
This commit is contained in:
Jason Andryuk authored and Jan Beulich committed 2025-08-19 11:03:52 +02:00
1 parent e5b0a94055
commit 1b4e935f45
1 file changed
+1 -1
+1 -1
View File
@@ -1762,7 +1762,7 @@ static bool domain_chk_quota(struct connection *conn, unsigned int mem)
time_t now;
struct domain *domain;
if (!conn || !domid_is_unprivileged(conn->id) ||
if (!conn || !conn->domain || !domid_is_unprivileged(conn->id) ||
conn->is_ignored)
return false;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.