]> git.proxmox.com Git - mirror_qemu.git/commit
contrib/rdmacm-mux: Fix out-of-bounds risk
authorYuval Shaia <yuval.shaia@oracle.com>
Tue, 12 Feb 2019 11:23:47 +0000 (13:23 +0200)
committerMarcel Apfelbaum <marcel.apfelbaum@gmail.com>
Sat, 16 Mar 2019 13:45:12 +0000 (15:45 +0200)
commitade0075523478fa015afd5c6f6cc70681687818d
tree3d0a0a2372ac8ec1e2b2810c6934da53f54ad059
parent8b088d3f8ab5642020d28fa0c2a8d938bc5f3592
contrib/rdmacm-mux: Fix out-of-bounds risk

The function get_fd extract context from the received MAD message and
uses it as a key to fetch the destination fd from the mapping table.
A context can be dgid in case of CM request message or comm_id in case
of CM SIDR response message.

When MAD message with a smaller size as expected for the message type
received we are hitting out-of-bounds where we are looking for the
context out of message boundaries.

Fix it by validating the message size.

Reported-by Sam Smith <sam.j.smith@oracle.com>
Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Message-Id: <20190212112347.1605-1-yuval.shaia@oracle.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
contrib/rdmacm-mux/main.c