mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
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:
1 parent
e5b0a94055
commit
1b4e935f45
1 file changed
+1
-1
@@ -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;
|
||||
|
||||
|
||||