tools/oxenstored: Fix quota calculation for mkdir EEXIST
authorEdwin Török <edvin.torok@citrix.com>
Fri, 15 Jan 2021 19:11:32 +0000 (19:11 +0000)
committerIan Jackson <iwj@xenproject.org>
Fri, 19 Mar 2021 13:43:36 +0000 (13:43 +0000)
commit004be86c81b866365919292f98a5d6effa6f053c
tree6f853dfc39afd6c664030d2d89cb5d061c74ac74
parentbcd9d2ee060121198ca58dbf3c275b3e534e01b1
tools/oxenstored: Fix quota calculation for mkdir EEXIST

We increment the domain's quota on mkdir even when the node already exists.
This results in a quota inconsistency after live update, where reconstructing
the tree from scratch results in a different quota.

Not a security issue because the domain uses up quota faster, so it will only
get a Quota error sooner than it should.

Found by the structured fuzzer.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
(cherry picked from commit c8b96708252a436da44005307f7c195d699bd7c5)
tools/ocaml/xenstored/store.ml