On 3 Dec 2025, at 15:45, Ilya Maximets wrote:

> IDL may contain deleted or orphan rows that should never be visible
> to the user.  However, ovsdb_idl_get_row_for_uuid() function simply
> looks up the row by UUID and returns it without checking if the row
> actually exists in the IDL.  This is causing a crash on assertion
> failure in ovn-controller when it looks up and finds port binding
> records that were already deleted:
>
>   5 vlog_abort                        at lib/vlog.c:1325
>   6 ovs_assert_failure                at lib/util.c:90
>   7 ovsdb_idl_txn_write__.constprop.0 at lib/ovsdb-idl.c:3650
>   8 ovsdb_idl_txn_write               at lib/ovsdb-idl.c:3742
>   9 sbrec_port_binding_set_up         at lib/ovn-sb-idl.c:39665
>  10 port_binding_set_down             at controller/binding.c:3700
>  11 if_status_mgr_update              at controller/if-status.c:645
>  12 main                              at controller/ovn-controller.c:7544
>
>   7 ovsdb_idl_txn_write__.constprop.0 at lib/ovsdb-idl.c:3650
>     3650        ovs_assert(row->new_datum != NULL);
>
> Can be easily reproduced with ovs-vsctl:
>
>  $ ovs-vsctl add-br br-int
>  $ ovs-vsctl del-br br-int \
>      -- set bridge $(ovs-vsctl get bridge br-int _uuid) other-config:a=b
>    ovs-vsctl: lib/ovsdb-idl.c:2673:
>      assertion row->new_datum != NULL failed in ovsdb_idl_read()
>    Aborted (core dumped)
>
> Fix that by adding an extra check for row existence like in IDL
> iterators, so deleted or orphan rows can no longer be found.
>
> Fixes: 979821c0a6b0 ("ovsdb-idl: Allow clients to modify records without 
> using structs.")
> Reported-by: Dumitru Ceara <[email protected]>
> Signed-off-by: Ilya Maximets <[email protected]>

Thanks Ilya, the change looks good to me.

Acked-by: Eelco Chaudron <[email protected]>

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

Reply via email to