From cae90a3d77fe7fb06b7ccecfd88e503c423102a7 Mon Sep 17 00:00:00 2001 From: Mike Pattrick Date: Mon, 10 Feb 2025 00:56:20 -0500 Subject: [PATCH] ovsdb-server: Do not use filename after free. Scanhub reported the following splat: 3. ovsdb/ovsdb-server.c:505:5: freed_arg: "shash_replace_nocopy" frees "filename". 6. ovsdb/ovsdb-server.c:507:9: pass_freed_arg: Passing freed pointer "filename" as an argument to "vlog". In all code paths with a duplicate configuration, OVSDB would print a warning log message using a freed pointer. Now, the original option is used. Fixes: e76f8472090e ("ovsdb-server: Database config isolation.") Reported-at: https://issues.redhat.com/browse/FDP-1118 Signed-off-by: Mike Pattrick Signed-off-by: Ilya Maximets --- ovsdb/ovsdb-server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c index fbc7ad5ef..aa2e27d84 100644 --- a/ovsdb/ovsdb-server.c +++ b/ovsdb/ovsdb-server.c @@ -504,7 +504,7 @@ add_database_config(struct shash *db_conf, const char *opt, conf = shash_replace_nocopy(db_conf, filename, conf); if (conf) { - VLOG_WARN("Duplicate database configuration: %s", filename); + VLOG_WARN("Duplicate database configuration: %s", opt); db_config_destroy(conf); } }