]> git.ipfire.org Git - thirdparty/libvirt.git/commit
lxc: avoid use-after-free
authorEric Blake <eblake@redhat.com>
Thu, 3 Nov 2011 23:24:32 +0000 (17:24 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 4 Nov 2011 14:08:42 +0000 (08:08 -0600)
commit04d2a7f2533b4d87c1435b5ea589dc1ab10efd36
treef891cff7f96087a519ec9948645abe2641eec7af
parent26ff8996b1b75785cb4adfb3924163516d74aacc
lxc: avoid use-after-free

I got this weird failure:

error: Failed to start domain simple
error: internal error cannot mix caller fds with blocking execution

and tracked it down to a use-after-free - virCommandSetOutputFD
was storing the address of a stack-local variable, which then
went out of scope before the virCommandRun that dereferenced it.

Bug introduced in commit 451cfd05 (0.9.2).

* src/lxc/lxc_driver.c (lxcBuildControllerCmd): Move log fd
registration...
(lxcVmStart): ...to caller.
src/lxc/lxc_driver.c