[libvirt] [PATCH] nwfilter: Resolve SEGV for NWFilter Snoop processing

Michal Privoznik mprivozn at redhat.com
Thu Jul 26 07:16:50 UTC 2018


On 07/23/2018 05:30 PM, John Ferlan wrote:
> 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 at redhat.com>
> ---
>  src/nwfilter/nwfilter_dhcpsnoop.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

ACK

Michal




More information about the libvir-list mailing list