diff options
author | Ilya Nelkenbaum <ilyan@mellanox.com> | 2015-02-05 14:53:48 +0300 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-03-24 04:02:46 +0300 |
commit | 6ff59abff69c457b6dc74b134f015d10259b7063 (patch) | |
tree | e45e9b01e0ce50a6828e3ccd54d2cabcaa3bab17 | |
parent | f90ead8d0f136b36a8527b1259e984ac58cfe4da (diff) | |
download | linux-6ff59abff69c457b6dc74b134f015d10259b7063.tar.xz |
IB/core: When marshaling ucma path from user-space, clear unused fields
commit c2be9dc0e0fa59cc43c2c7084fc42b430809a0fe upstream.
When marshaling a user path to the kernel struct ib_sa_path, we need
to zero smac and dmac and set the vlan id to the "no vlan" value.
This is to ensure that Ethernet attributes are not used with
InfiniBand QPs.
Fixes: dd5f03beb4f7 ("IB/core: Ethernet L2 attributes in verbs/cm structures")
Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
-rw-r--r-- | drivers/infiniband/core/ucma.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index 56a4b7ca7ee3..45d67e9228d7 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c @@ -1124,6 +1124,9 @@ static int ucma_set_ib_path(struct ucma_context *ctx, if (!optlen) return -EINVAL; + memset(&sa_path, 0, sizeof(sa_path)); + sa_path.vlan_id = 0xffff; + ib_sa_unpack_path(path_data->path_rec, &sa_path); ret = rdma_set_ib_paths(ctx->cm_id, &sa_path, 1); if (ret) |