Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2be9dc0 authored by Ilya Nelkenbaum's avatar Ilya Nelkenbaum Committed by Roland Dreier
Browse files

IB/core: When marshaling ucma path from user-space, clear unused fields



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: dd5f03be ("IB/core: Ethernet L2 attributes in verbs/cm structures")
Signed-off-by: default avatarIlya Nelkenbaum <ilyan@mellanox.com>
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent bfa76d49
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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)