Skip to contentSkip to conversation

tools/xenstore: fix XSA-417 patch

PATCH In review Juergen Gross 3 participants 3 messages Jul 20, 2023 – Jul 21, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 tools/xenstore/xenstored_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/xenstore/xenstored_core.c +1 -1
index 31a862b715..a1d3047e48 100644
@@ -1784,7 +1784,7 @@ static int do_set_perms(const void *ctx, struct connection *conn,
 	if (!xenstore_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;
Signature · 1 line
2.35.3
Acked-by on v1 1/1
#1 lore raw

Hi Juergen,

Quoted 10 lines · Juergen Gross

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")

Cheers,

Signature · 1 line
Julien Grall
#2 lore raw
Quoted 9 lines · Julien Grall
Quoted 8 lines · Juergen Gross

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.

Quoted 4 lines
Quoted 2 lines
Fixes ab128218225d ("tools/xenstore: fix checking node permissions")

In the interest of not missing to add this to my to-be-backported collection, I've included this in what I've committed just now. It correcting an earlier XSA fix, I guess we may want to go as far as backporting this also to the security-only stable trees (i.e. through to 4.14 rather than just back to 4.16)?

As an aside - note that 4.14 is about to close.

Jan