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)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 4 Feb 2021 14:17:44 +0000 (14:17 +0000)
commitc8b96708252a436da44005307f7c195d699bd7c5
tree2fd210a5e6d195271b25945374cefdf8b61a9db3
parent92f5ffa58d188c9f9a9f1bcdccb6d6348d9df612
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>
tools/ocaml/xenstored/store.ml