]> git.baikalelectronics.ru Git - kernel.git/commit
IB/mlx4: Test port number before querying type.
authorTarick Bedeir <tarick@google.com>
Mon, 2 Jul 2018 21:02:34 +0000 (14:02 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 4 Jul 2018 17:48:27 +0000 (11:48 -0600)
commit975b005a20207060c74a4e89bf79b5bfad12b2aa
treecd4554fbbf1d33fa36878c4d7141838b4f6748bc
parent775bc54e4c54cf0edea5029d732e784927fe79c0
IB/mlx4: Test port number before querying type.

rdma_ah_find_type() can reach into ib_device->port_immutable with a
potentially out-of-bounds port number, so check that the port number is
valid first.

Fixes: fdc0d584db03 ("IB/core: Define 'ib' and 'roce' rdma_ah_attr types")
Signed-off-by: Tarick Bedeir <tarick@google.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx4/qp.c