On Thu, Nov 20, 2025 at 9:43 AM Dumitru Ceara <[email protected]> wrote:

> From: Ales Musil <[email protected]>
>
> When the SB database is disconnected we cannot commit any of the
> MAC bindings. The 'struct mac_binding' remain in the hash map until
> SB is writable again. All mac_binding structures are leaked when
> controller exists before it manages to write them into SB. The same
> problem applies to map of 'struct fdb'. This doesn't cause any issues
> on its own because the controller is exiting anyway, but it can
> trigger test failure with following leak message:
>
> Direct leak of 144 byte(s) in 2 object(s) allocated from:
>   0x4c8d13 in malloc (controller/ovn-controller+0x4c8d13)
>   0x8a5848 in xmalloc__ ovs/lib/util.c:141:15
>   0x8a5848 in xmalloc ovs/lib/util.c:176:12
>   0x6577d5 in mac_binding_add controller/mac-cache.c:167:14
>   0x5db85b in pinctrl_handle_put_mac_binding controller/pinctrl.c:4720:5
>   0x5a3002 in process_packet_in controller/pinctrl.c
>   0x5a3002 in pinctrl_recv controller/pinctrl.c:3872:9
>   0x5a3002 in pinctrl_handler controller/pinctrl.c:3954:17
>   0x8781ec in ovsthread_wrapper ovs/lib/ovs-thread.c:429:12
>   0x4c4ecc in asan_thread_start(void*) asan_interceptors.cpp.o
>
> Fixes: fb96ae36793a ("controller: Merge the mac-cache and mac-learn.")
> Signed-off-by: Ales Musil <[email protected]>
> Signed-off-by: Dumitru Ceara <[email protected]>
> (cherry picked from commit 65e1ba787e44cf4adc05f2c8ec001fd3a16b9655)
> ---
>  controller/pinctrl.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/controller/pinctrl.c b/controller/pinctrl.c
> index 3774544a84..455bdcaa2a 100644
> --- a/controller/pinctrl.c
> +++ b/controller/pinctrl.c
> @@ -4252,6 +4252,7 @@ init_put_mac_bindings(void)
>  static void
>  destroy_put_mac_bindings(void)
>  {
> +    mac_bindings_clear(&put_mac_bindings);
>      hmap_destroy(&put_mac_bindings);
>  }
>
> @@ -8510,6 +8511,7 @@ init_fdb_entries(void)
>  static void
>  destroy_fdb_entries(void)
>  {
> +    fdbs_clear(&put_fdbs);
>      hmap_destroy(&put_fdbs);
>  }
>
> --
> 2.51.1
>
>
Thank you Dumitru,

I went ahead and merged this into 24.03.

Regards,
Ales
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to