tools/oxenstored: Make evaluation order explicit

In Store.path_write(), Path.apply_modify() updates the node_created
reference and both the value of apply_modify() and node_created are
returned by path_write().

At least with OCaml 4.06.1 this leads to the value of node_created being
returned *before* it is updated by apply_modify().  This in turn leads
to the quota for a domain not being updated in Store.write().  Hence, a
guest can create an unlimited number of entries in xenstore.

The fix is to make evaluation order explicit.

This is XSA-272.

Signed-off-by: Christian Lindig <christian.lindig@citrix.com>
Reviewed-by: Rob Hoes <rob.hoes@citrix.com>
(cherry picked from commit 73392c7fd1)
This commit is contained in:
Christian Lindig authored and Andrew Cooper committed 2018-08-14 17:27:26 +01:00
1 parent ed6fcdb902
commit 712082daee
1 file changed
+2 -1
+2 -1
View File
@@ -257,7 +257,8 @@ let path_write store perm path value =
Node.check_perm store.root perm Perms.WRITE;
Node.set_value store.root value, false
) else
Path.apply_modify store.root path do_write, !node_created
let root = Path.apply_modify store.root path do_write in
root, !node_created
let path_rm store perm path =
let do_rm node name =
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.