java-topology/defects/qemu/patch/qemu-CLEAN-net-assign-name.md

790 B
Raw Blame History

UNDF: UNDF-2026-000000516

QEMU net/net.c assign_name — NOT CWE-407 (CLEAN)

Target: net/net.cassign_name()

assign_name() scans net_clients with strcmp to count existing clients of the same model and generate a unique name. This is O(N) per call.

However, assign_name is only invoked when name == NULL — the legacy -net option path. MAX_NICS is 8 and typical use is 14 clients. N is bounded by a small constant at QEMU startup. No significant O(N²) risk.

Target: net/net.cqemu_find_netdev()

Linear scan of net_clients by name. Called only during device setup/teardown (not in packet hot paths). N ≤ MAX_NICS × MAX_QUEUE_NUM but lookups are rare setup-time operations. Not a hot-path CWE-407.

Status: CLEAN for net/net.c