Messages in this thread | | | Date | Thu, 17 Aug 2023 17:13:37 +0200 | From | Florian Westphal <> | Subject | Re: [PATCH net] ipvlan: Fix a reference count leak warning in ipvlan_ns_exit() |
| |
Lu Wei <luwei32@huawei.com> wrote: > There are two network devices(veth1 and veth3) in ns1, and ipvlan1 with > L3S mode and ipvlan2 with L2 mode are created based on them as > figure (1). In this case, ipvlan_register_nf_hook() will be called to > register nf hook which is needed by ipvlans in L3S mode in ns1 and value > of ipvl_nf_hook_refcnt is set to 1.
[..]
> register nf_hook in ns2 and unregister nf_hook in ns1. As a result, > ipvl_nf_hook_refcnt in ns1 is decreased incorrectly and this in ns2 > is increased incorrectly. When the second net namespace is removed, a > reference count leak warning in ipvlan_ns_exit() will be triggered. > > This patch add a check before ipvlan_migrate_l3s_hook() is called.
Reviewed-by: Florian Westphal <fw@strlen.de>
| |