tools/xenstore: fix deleting node in transaction

In case a node has been created in a transaction and it is later
deleted in the same transaction, the transaction will be terminated
with an error.

As this error is encountered only when handling the deleted node at
transaction finalization, the transaction will have been performed
partially and without updating the accounting information. This will
enable a malicious guest to create arbitrary number of nodes.

This is part of XSA-421 / CVE-2022-42325.

Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
This commit is contained in:
Juergen Gross authored and Andrew Cooper committed 2022-11-01 13:05:44 +00:00
1 parent ae34df4d82
commit 13ac37f141
1 file changed
+7 -1
+7 -1
View File
@@ -418,7 +418,13 @@ static int finalize_transaction(struct connection *conn,
true);
talloc_free(data.dptr);
} else {
ret = do_tdb_delete(conn, &key, NULL);
/*
* A node having been created and later deleted
* in this transaction will have no generation
* information stored.
*/
ret = (i->generation == NO_GENERATION)
? 0 : do_tdb_delete(conn, &key, NULL);
}
if (ret)
goto err;
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.