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:
Juergen Gross authored and Andrew Cooper committed 2022-11-01 15:25:15 +00:00
1 parent 2963ee5d06
commit e84ef3b081
3 files changed
+4 -3

No files matched your search

+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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? */
+2 -1
View File
@@ -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 */
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.