linux-brain/drivers/infiniband/hw/mlx4
Leon Romanovsky fb426a4888 IB/mlx4: Fix mlx4_ib_alloc_mr error flow
[ Upstream commit 5a371cf87e ]

ibmr.device is being set only after ib_alloc_mr() is successfully complete.
Therefore, in case imlx4_mr_enable() returns with error, the error flow
unwinder calls to mlx4_free_priv_pages(), which uses ibmr.device.

Such usage causes to NULL dereference oops and to fix it, the IB device
should be set in the mr struct earlier stage (e.g. prior to calling
mlx4_free_priv_pages()).

Fixes: 1b2cd0fc67 ("IB/mlx4: Support the new memory registration API")
Signed-off-by: Nitzan Carmi <nitzanc@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-03 10:23:25 +01:00
..
Kconfig net: mellanox: add DEVLINK dependencies 2016-03-03 17:08:59 -05:00
Makefile IB/mlx4: Add iov directory in sysfs under the ib device 2012-09-30 20:33:39 -07:00
ah.c IB/mlx4: Set traffic class in AH 2017-01-26 08:24:35 +01:00
alias_GUID.c IB/mlx4/alias_GUID: Remove deprecated create_singlethread_workqueue 2016-10-07 16:54:33 -04:00
cm.c IB/mlx4: In mlx4_ib_demux_cm, print out GUID in host-endian order 2015-02-17 22:11:40 -08:00
cq.c IB/mlx4: Fix create CQ error flow 2016-11-16 20:03:44 -05:00
doorbell.c IB: Refactor umem to use linear SG table 2014-03-04 10:34:28 -08:00
mad.c IB/mlx4: Handle well-known-gid in mad_demux processing 2017-01-26 08:24:35 +01:00
main.c IB/mlx4: Fix incorrectly releasing steerable UD QPs when have only ETH ports 2018-02-22 15:43:51 +01:00
mcg.c IB/mlx4: Reduce SRIOV multicast cleanup warning message to debug level 2017-05-20 14:28:38 +02:00
mlx4_ib.h Merge of primary rdma-core code for 4.9 2016-10-09 17:04:33 -07:00
mr.c IB/mlx4: Fix mlx4_ib_alloc_mr error flow 2018-03-03 10:23:25 +01:00
qp.c IB/mlx4: Increase maximal message size under UD QP 2017-12-14 09:28:24 +01:00
srq.c IB/mlx4: Move user vendor structures 2016-10-07 16:54:36 -04:00
sysfs.c IB/mlx4: Forbid using sysfs to change RoCE pkeys 2015-08-30 18:12:22 -04:00