diff options
author | Steve Wise <swise@opengridcomputing.com> | 2018-12-20 14:00:11 -0800 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-12-20 20:45:56 -0700 |
commit | d53ec8af56d5163f8a42e961ece3aeb5c560e79d (patch) | |
tree | 6fe5412feb044dc237dbe720ee7f3fa52a74059a /drivers/infiniband/hw/mlx4 | |
parent | bb7e22a8ab00ff9ba911a45ba8784cef9e6d6f7a (diff) | |
download | linux-d53ec8af56d5163f8a42e961ece3aeb5c560e79d.tar.gz |
RDMA/iwcm: Don't copy past the end of dev_name() string
We now use dev_name(&ib_device->dev) instead of ib_device->name in iwpm
messages. The name field in struct device is a const char *, where as
ib_device->name is a char array of size IB_DEVICE_NAME_MAX, and it is
pre-initialized to zeros.
Since iw_cm_map() was using memcpy() to copy in the device name, and
copying IWPM_DEVNAME_SIZE bytes, it ends up copying past the end of the
source device name string and copying random bytes. This results in iwpmd
failing the REGISTER_PID request from iwcm. Thus port mapping is broken.
Validate the device and if names, and use strncpy() to inialize the entire
message field.
Fixes: 896de0090a85 ("RDMA/core: Use dev_name instead of ibdev->name")
Cc: stable@vger.kernel.org
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4')
0 files changed, 0 insertions, 0 deletions