migration/rdma: Drop fragile wr_id formatting
commitb5631d5bda04b8653c9232682bebad9584c9857c
authorMarkus Armbruster <armbru@redhat.com>
Thu, 28 Sep 2023 13:19:30 +0000 (28 15:19 +0200)
committerJuan Quintela <quintela@redhat.com>
Wed, 11 Oct 2023 09:17:03 +0000 (11 11:17 +0200)
tree90fcf3ed284d74a1df125c1feaee83e26e16ac1c
parent1720a2a8758431810a1d7bdb51780d87bb55b4b4
migration/rdma: Drop fragile wr_id formatting

wrid_desc[] uses 4001 pointers to map four integer values to strings.

print_wrid() accesses wrid_desc[] out of bounds when passed a negative
argument.  It returns null for values 2..1999 and 2001..3999.

qemu_rdma_poll() and qemu_rdma_block_for_wrid() print wrid_desc[wr_id]
and passes print_wrid(wr_id) to tracepoints.  Could conceivably crash
trying to format a null string.  I believe access out of bounds is not
possible.

Not worth cleaning up.  Dumb down to show just numeric wr_id.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20230928132019.2544702-5-armbru@redhat.com>
migration/rdma.c
migration/trace-events