head 1.2; access; symbols pkgsrc-2021Q1:1.1.0.4 pkgsrc-2021Q1-base:1.1 pkgsrc-2020Q4:1.1.0.2 pkgsrc-2020Q4-base:1.1; locks; strict; comment @# @; 1.2 date 2021.03.30.06.59.03; author bouyer; state dead; branches; next 1.1; commitid 0qeTE1RWBrm5HiNC; 1.1 date 2020.12.16.17.17.08; author bouyer; state Exp; branches; next ; commitid Hgq1bR1zGxUEtZzC; desc @@ 1.2 log @Update xentools413 and xentools413 to 4.13.3. Changes since 4.13.2: inlcude security fixes for all XSA known to date (up to XSA-369). Other minor bug fixes. @ text @$NetBSD: patch-XSA352,v 1.1 2020/12/16 17:17:08 bouyer Exp $ From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= Subject: tools/ocaml/xenstored: only Dom0 can change node owner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we can give quota away to another domain, either causing it to run out of quota, or in case of Dom0 use unbounded amounts of memory and bypass the quota system entirely. This was fixed in the C version of xenstored in 2006 (c/s db34d2aaa5f5, predating the XSA process by 5 years). It was also fixed in the mirage version of xenstore in 2012, with a unit test demonstrating the vulnerability: https://github.com/mirage/ocaml-xenstore/commit/6b91f3ac46b885d0530a51d57a9b3a57d64923a7 https://github.com/mirage/ocaml-xenstore/commit/22ee5417c90b8fda905c38de0d534506152eace6 but possibly without realising that the vulnerability still affected the in-tree oxenstored (added c/s f44af660412 in 2010). This is XSA-352. Signed-off-by: Edwin Török Acked-by: Christian Lindig Reviewed-by: Andrew Cooper diff --git a/tools/ocaml/xenstored/store.ml b/tools/ocaml/xenstored/store.ml index 3b05128f1b..5f915f2bbe 100644 --- tools/ocaml/xenstored/store.ml.orig +++ tools/ocaml/xenstored/store.ml @@@@ -407,7 +407,8 @@@@ let setperms store perm path nperms = | Some node -> let old_owner = Node.get_owner node in let new_owner = Perms.Node.get_owner nperms in - if not ((old_owner = new_owner) || (Perms.Connection.is_dom0 perm)) then Quota.check store.quota new_owner 0; + if not ((old_owner = new_owner) || (Perms.Connection.is_dom0 perm)) then + raise Define.Permission_denied; store.root <- path_setperms store perm path nperms; Quota.del_entry store.quota old_owner; Quota.add_entry store.quota new_owner @ 1.1 log @Add upstream patches for a bunch of Xen security avisories, related to xenstore permissions. @ text @d1 1 a1 1 $NetBSD: $ @