Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ovsdb-idl: Fix use of uninitialized datum for graph consistency check.
Columns in 'new_datum' may not be initialized if they were not written, i.e., when the column in not in the 'written' bitmap. In this case the actual content should be read from the 'old_datum' instead. If the old one is also not available, then the default should be used. WARNING: MemorySanitizer: use-of-uninitialized-value 0 0x78d27f in ovsdb_idl_check_consistency lib/ovsdb-idl.c:732:21 1 0x4ee12a in idl_set tests/test-ovsdb.c:2586:9 2 0x4d7c4b in do_idl tests/test-ovsdb.c:2868:18 3 0x6c5704 in ovs_cmdl_run_command__ lib/command-line.c:247:17 4 0x6c4d28 in ovs_cmdl_run_command lib/command-line.c:278:5 5 0x4c39bf in main tests/test-ovsdb.c:80:5 6 0x7f912a02958f in __libc_start_call_main 7 0x7f912a02963f in __libc_start_main@GLIBC_2.2.5 8 0x432b54 in _start (tests/test-ovsdb+0x432b54) Use the ovsdb_idl_read() helper to read the actual correct data during the consistency check. Alternative might be to iterate over the 'written' bitmap and only check those columns, but it seems like that will reduce the intended scope of the check, since 'new_datum' may exist while the 'written' bitmap doesn't, e.g., when 'new_datum == old_datum'. Fixes: 11990a5 ("ovsdb-idl: Check internal graph in OVSDB tests.") Acked-by: Dumitru Ceara <dceara@redhat.com> Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
- Loading branch information