mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
tools/xenstore: fix connection->id usage
Don't use conn->id for privilege checks, but domain_is_unprivileged().
This is part of XSA-326.
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
(cherry picked from commit 3047df38e1)
This commit is contained in:
1 parent
2963ee5d06
commit
e84ef3b081
3 files changed
+4
-3
No files matched your search
@@ -180,7 +180,7 @@ int do_control(struct connection *conn, struct buffered_data *in)
|
||||
int cmd;
|
||||
char **vec;
|
||||
|
||||
if (conn->id != 0)
|
||||
if (domain_is_unprivileged(conn))
|
||||
return EACCES;
|
||||
|
||||
num = xs_count_strings(in->buffer, in->used);
|
||||
|
||||
@@ -93,7 +93,7 @@ struct connection
|
||||
/* The index of pollfd in global pollfd array */
|
||||
int pollfd_idx;
|
||||
|
||||
/* Who am I? 0 for socket connections. */
|
||||
/* Who am I? Domid of connection. */
|
||||
unsigned int id;
|
||||
|
||||
/* Is this a read-only connection? */
|
||||
|
||||
@@ -483,7 +483,8 @@ int do_transaction_start(struct connection *conn, struct buffered_data *in)
|
||||
if (conn->transaction)
|
||||
return EBUSY;
|
||||
|
||||
if (conn->id && conn->transaction_started > quota_max_transaction)
|
||||
if (domain_is_unprivileged(conn) &&
|
||||
conn->transaction_started > quota_max_transaction)
|
||||
return ENOSPC;
|
||||
|
||||
/* Attach transaction to input for autofree until it's complete */
|
||||
|
||||