qemu-e2k/contrib/rdmacm-mux
Yuval Shaia ade0075523 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>
2019-03-16 15:45:12 +02:00
..
Makefile.objs contrib/rdmacm-mux: fix clang compilation 2019-01-19 11:01:57 +02:00
main.c contrib/rdmacm-mux: Fix out-of-bounds risk 2019-03-16 15:45:12 +02:00
rdmacm-mux.h contrib/rdmacm-mux: Add implementation of RDMA User MAD multiplexer 2018-12-22 11:09:56 +02:00