Re: [PATCH 3/9] daemon: Resolve Coverity RESOURCE_LEAK

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/11/2014 06:05 PM, John Ferlan wrote:
> With eblake's help - adjust the checks for stdinfd/stdoutfd to ensure the
> values are within the range we expect; otherwise the dup2()'s and subsequent
> VIR_CLOSE() calls cause Coverity to believe there's a resource leak.
> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  daemon/libvirtd.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

ACK.  This means that if anyone tries to do something crazy like
'libvirtd 0<&-' with stdin closed, and the OS doesn't auto-reopen an fd,
then spawning into a daemon will now fail where it previously worked.
But this is a _good_ thing, as it is much easier to reason about
programs that prohibit being started without something open at all three
standard descriptors, and since POSIX states that it is undefined
behavior if you exec a process without open fds.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]