libvirt/src/nwfilter
John Ferlan 5229494b01 nwfilter: Resolve SEGV for NWFilter Snoop processing
https://bugzilla.redhat.com/show_bug.cgi?id=1599973

Commit id fca9afa08 changed the @req->ifname to use
@req->binding->portdevname fillingin the @req->binding
in a similar way that @req->ifname would have been
filled in during virNWFilterDHCPSnoopReq processing.

However, in doing so it did not take into account some
code paths where the @req->binding should be checked
instead of @req->binding->portdevname. These checks
led to SEGVs in some cases during libvirtd reload
processing in virNWFilterSnoopRemAllReqIter (for
stop during nwfilterStateCleanup processing) and
virNWFilterSnoopReqLeaseDel (for start during
nwfilterStateInitialize processing).

In particular, when reading the nwfilter.leases file
a new @req is created, but the @req->binding is not
filled in. That's left to virNWFilterDHCPSnoopReq
processing which checks if the @req already exists
in the @virNWFilterSnoopState.snoopReqs hash table
after adding a virNWFilterSnoopState.ifnameToKey
entry for the @req->binding->portdevname by a
@ref->ikey value.

NB: virNWFilterSnoopIPLeaseInstallRule and
    virNWFilterDHCPSnoopThread do not need the
    req->binding check since they can only be called
    after the filter->binding is created/assigned.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
2018-07-26 09:35:40 -04:00
..
Makefile.inc.am make: split nwfilter driver build rules into nwfilter/Makefile.inc.am 2018-03-05 17:09:08 +00:00
nwfilter_dhcpsnoop.c nwfilter: Resolve SEGV for NWFilter Snoop processing 2018-07-26 09:35:40 -04:00
nwfilter_dhcpsnoop.h nwfilter: convert DHCP address snooping code to virNWFilterBindingDefPtr 2018-06-26 11:22:07 +01:00
nwfilter_driver.c nwfilter: Remove redundant check if object exists 2018-07-04 07:23:08 +02:00
nwfilter_driver.h nwfilter: remove obsolete code related to firewalld 2018-05-03 17:00:57 +01:00
nwfilter_ebiptables_driver.c src: Make virStr*cpy*() functions return an int 2018-07-23 14:27:30 +02:00
nwfilter_ebiptables_driver.h Convert nwfilter ebiptablesApplyNewRules to virFirewall 2014-04-25 15:44:10 +01:00
nwfilter_gentech_driver.c nwfilter: convert virt drivers to use public API for nwfilter bindings 2018-06-26 18:17:23 +01:00
nwfilter_gentech_driver.h nwfilter: convert virt drivers to use public API for nwfilter bindings 2018-06-26 18:17:23 +01:00
nwfilter_learnipaddr.c src: Make virStr*cpy*() functions return an int 2018-07-23 14:27:30 +02:00
nwfilter_learnipaddr.h nwfilter: convert IP address learning code to virNWFilterBindingDefPtr 2018-06-26 11:22:07 +01:00
nwfilter_tech_driver.h nwfilter: remove virNWFilterHashTable typedefs entirely 2018-05-03 17:00:57 +01:00