tools/xenstore: use treewalk for deleting nodes
authorJuergen Gross <jgross@suse.com>
Tue, 13 Sep 2022 05:35:12 +0000 (07:35 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 1 Nov 2022 14:07:24 +0000 (14:07 +0000)
commit1514de3a5f23aef451133367d8dc04a26b88052f
tree83ddcfc066de5c4bcc5f3a0297f2379fa143c6d8
parentf5a4c26b2efc55a5267840fcb31f95c00cc25d10
tools/xenstore: use treewalk for deleting nodes

Instead of doing an open tree walk using call recursion, use
walk_node_tree() when deleting a sub-tree of nodes.

This will reduce code size and avoid many nesting levels of function
calls which could potentially exhaust the stack.

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

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Julien Grall <jgrall@amazon.com>
(cherry picked from commit ea16962053a6849a6e7cada549ba7f8c586d85c6)
tools/xenstore/xenstored_core.c