diff options
author | Ariel Levkovich <lariel@mellanox.com> | 2018-04-26 15:42:55 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2018-04-27 14:22:24 -0400 |
commit | 54e7e48b13c85d9a730b989fe7dc5250199a4f81 (patch) | |
tree | cd93d7d18b8f87d780b14cd888894e87ac24229c /drivers/infiniband/core/uverbs_cmd.c | |
parent | 5ccbf63f87a39c279729670d2e31166844a335c6 (diff) | |
download | linux-0-day-54e7e48b13c85d9a730b989fe7dc5250199a4f81.tar.gz linux-0-day-54e7e48b13c85d9a730b989fe7dc5250199a4f81.tar.xz |
IB/uverbs: Fix kernel crash during MR deregistration flow
This patch fixes a crash that happens due to access to an
uninitialized DM pointer within the MR object.
The change makes sure the DM pointer in the MR object is set to
NULL during a non-DM MR creation to prevent a false indication
that this MR is related to a DM in the dereg flow.
Fixes: be934cca9e98 ("IB/uverbs: Add device memory registration ioctl support")
Reported-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Ariel Levkovich <lariel@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core/uverbs_cmd.c')
-rw-r--r-- | drivers/infiniband/core/uverbs_cmd.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 1837924415c9e..21a887c9523bc 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -691,6 +691,7 @@ ssize_t ib_uverbs_reg_mr(struct ib_uverbs_file *file, mr->device = pd->device; mr->pd = pd; + mr->dm = NULL; mr->uobject = uobj; atomic_inc(&pd->usecnt); mr->res.type = RDMA_RESTRACK_MR; |