From: Juergen Gross Date: Thu, 3 Aug 2023 14:33:43 +0000 (+0200) Subject: tools/xenstore: fix XSA-417 patch X-Git-Tag: RELEASE-4.16.5~58 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=dcba0801cb64eceba30d5cbe88facee0c8b3e1d7;p=xen.git tools/xenstore: fix XSA-417 patch The fix for XSA-417 had a bug: domain_alloc_permrefs() will not return a negative value in case of an error, but a plain errno value. Note this is not considered to be a security issue, as the only case where domain_alloc_permrefs() will return an error is a failed memory allocation. As a guest should not be able to drive Xenstore out of memory, this is NOT a problem a guest can trigger at will. Fixes: ab128218225d ("tools/xenstore: fix checking node permissions") Signed-off-by: Juergen Gross Acked-by: Julien Grall master commit: 0c53c638e16278078371ce028c74693841d7738a master date: 2023-07-21 08:32:43 +0200 --- diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c index feb7bbaa52..13d6c0372d 100644 --- a/tools/xenstore/xenstored_core.c +++ b/tools/xenstore/xenstored_core.c @@ -1784,7 +1784,7 @@ static int do_set_perms(const void *ctx, struct connection *conn, if (!xs_strings_to_perms(perms.p, perms.num, permstr)) return errno; - if (domain_alloc_permrefs(&perms) < 0) + if (domain_alloc_permrefs(&perms)) return ENOMEM; if (perms.p[0].perms & XS_PERM_IGNORE) return ENOENT;