]> git.ipfire.org Git - thirdparty/libvirt.git/commit
audit: eliminate potential null pointer deref when auditing macvtap devices
authorLaine Stump <laine@laine.org>
Mon, 14 Mar 2011 15:15:19 +0000 (11:15 -0400)
committerLaine Stump <laine@laine.org>
Mon, 14 Mar 2011 16:45:03 +0000 (12:45 -0400)
commit7cc101ce0e8e1929f6573c3bee3ec2e287304513
tree9d56510ab752778d7779fb2a6051542e1a46b833
parente6a8f9a16ac1eb1d74d33416949171bdf52d034a
audit: eliminate potential null pointer deref when auditing macvtap devices

The newly added call to qemuAuditNetDevice in qemuPhysIfaceConnect was
assuming that res_ifname (the name of the macvtap device) was always
valid, but this isn't the case. If openMacvtapTap fails, it always
returns NULL, which would result in a segv.

Since the audit log only needs a record of devices that are actually
sent to qemu, and a failure to open the macvtap device means that no
device will be sent to qemu, we can solve this problem by only doing
the audit if openMacvtapTap is successful (in which case res_ifname is
guaranteed valid).
src/qemu/qemu_command.c