From fb932291cb3f9864c8ecfb33e21e243b0277edf7 Mon Sep 17 00:00:00 2001 From: hselasky Date: Tue, 17 Jul 2018 09:18:16 +0000 Subject: [PATCH] Fix kernel panic while using XRC_TGT QP type in ibcore. Attempt to modify XRC_TGT QP type from the user space (ibv_xsrq_pingpong invocation) will trigger the following kernel panic. It is caused by the fact that such QPs missed uobject initialization. Linux commit: f45765872e7aae7b81feb3044aaf9886b21885ef MFC after: 1 week Sponsored by: Mellanox Technologies --- sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c b/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c index 6b281b62b8e1..6616bc40342c 100644 --- a/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c +++ b/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c @@ -1943,6 +1943,9 @@ static int create_qp(struct ib_uverbs_file *file, atomic_inc(&attr.srq->usecnt); if (ind_tbl) atomic_inc(&ind_tbl->usecnt); + } else { + /* It is done in _ib_create_qp for other QP types */ + qp->uobject = &obj->uevent.uobject; } qp->uobject = &obj->uevent.uobject;