tools/xenstore: don't let remove_child_entry() call corrupt()
authorJuergen Gross <jgross@suse.com>
Tue, 13 Sep 2022 05:35:11 +0000 (07:35 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 1 Nov 2022 13:05:44 +0000 (13:05 +0000)
commit0c00c51f3bc8206c7f9cf87d014650157bee2bf4
treec913c08cfa5a52c907c160a59724fd746e125745
parentda8ee25d02a5447ba39a9800ee2a710ae1f54222
tools/xenstore: don't let remove_child_entry() call corrupt()

In case of write_node() returning an error, remove_child_entry() will
call corrupt() today. This could result in an endless recursion, as
remove_child_entry() is called by corrupt(), too:

corrupt()
  check_store()
    check_store_()
      remove_child_entry()

Fix that by letting remove_child_entry() return an error instead and
let the caller decide what to do.

This is part of XSA-418 / CVE-2022-42321.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
tools/xenstore/xenstored_core.c