[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] tools/xenstored: Check NULL domain in domain_chk_quota()



commit 1b4e935f4597218d19ea8e8494ba59b8aec170f4
Author:     Jason Andryuk <jason.andryuk@xxxxxxx>
AuthorDate: Fri Aug 15 17:35:52 2025 -0400
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Aug 19 11:03:52 2025 +0200

    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@xxxxxxx>
    Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
---
 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 051e3fd164..c74bafa165 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c
@@ -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;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.