From: Vladimir Sokolovsky Date: Mon, 9 Feb 2015 16:32:03 +0000 (+0200) Subject: Added fix for IB core X-Git-Tag: vofed-3.18~40 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=dfadc99cffc80d221c3941eb67bd7562e8271a0b;p=~emulex%2Ffor-vlad%2Fcompat-rdma.git Added fix for IB core From: Ilya Nelkenbaum Subject: [PATCH] IB/core: When marshaling ucma path from user-space, clear unused fields When marsheling a user path to the kernel struct ib_sa_path, need to zero smac, 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 Signed-off-by: Or Gerlitz Signed-off-by: Vladimir Sokolovsky --- diff --git a/linux-next-pending/0007-IB-core-When-marshaling-ucma-path-from-user-space-cl.patch b/linux-next-pending/0007-IB-core-When-marshaling-ucma-path-from-user-space-cl.patch new file mode 100644 index 0000000..bc83e1c --- /dev/null +++ b/linux-next-pending/0007-IB-core-When-marshaling-ucma-path-from-user-space-cl.patch @@ -0,0 +1,30 @@ +From: Ilya Nelkenbaum +Subject: [PATCH] IB/core: When marshaling ucma path from user-space, clear unused fields + +When marsheling a user path to the kernel struct ib_sa_path, need +to zero smac, 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 +Signed-off-by: Or Gerlitz +--- + 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 xxxxxxx..xxxxxxx xxxxxx +--- 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)