Fix use-after-free in xenconsoled.
authorKeir Fraser <keir@xensource.com>
Thu, 1 Nov 2007 16:34:43 +0000 (16:34 +0000)
committerKeir Fraser <keir@xensource.com>
Thu, 1 Nov 2007 16:34:43 +0000 (16:34 +0000)
commited8c66a1f64e03aa0c28a599b785976b8f894ea2
treef13c349927ef5a24894900c6e012a58ca4f38c91
parent50c994308afc37f31974795d1391612904d1282c
Fix use-after-free in xenconsoled.

shutdown_domain() MUST NOT call cleanup_domain(), just flagging them
as dead is enough.  cleanup_domains() for dead domains is called by
the main loop in handle_io() in a safe way already.

shutdown_domain() calling cleanup_domain() too leads struct domain
being accessed after freeing and to a double-free.

Fixed by simply dropping the cleanup_domain() call and by making the
functions called by the main loop in handle_io() ignore dead domains.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
tools/console/daemon/io.c