diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-09-11 14:46:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-09-11 14:46:11 -0400 |
commit | 28a0ea77ba50fc8a9684b7af96ece05dfeb6f64b (patch) | |
tree | e524d8dc70d740f120f787f8da96861fafea41ac /drivers/infiniband/core/ucma.c | |
parent | 11da3a7f84f19c26da6f86af878298694ede0804 (diff) | |
parent | 8f28b178f71cc56eccf2a6e2c0ace17c82f900d7 (diff) |
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Pull rdma fixes from Jason Gunthorpe:
"This fixes one major regression with NFS and mlx4 due to the max_sg
rework in this merge window, tidies a few minor error_path
regressions, and various small fixes.
The HFI1 driver is broken this cycle due to a regression caused by a
PCI change, it is looking like Bjorn will merge a fix for this. Also,
the lingering ipoib issue I mentioned earlier still remains unfixed.
Summary:
- Fix possible FD type confusion crash
- Fix a user trigger-able crash in cxgb4
- Fix bad handling of IOMMU resources causing user controlled leaking
in bnxt
- Add missing locking in ipoib to fix a rare 'stuck tx' situation
- Add missing locking in cma
- Add two missing missing uverbs cleanups on failure paths,
regressions from this merge window
- Fix a regression from this merge window that caused RDMA NFS to not
work with the mlx4 driver due to the max_sg changes"
* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
RDMA/mlx4: Ensure that maximal send/receive SGE less than supported by HW
RDMA/cma: Protect cma dev list with lock
RDMA/uverbs: Fix error cleanup path of ib_uverbs_add_one()
bnxt_re: Fix couple of memory leaks that could lead to IOMMU call traces
IB/ipoib: Avoid a race condition between start_xmit and cm_rep_handler
iw_cxgb4: only allow 1 flush on user qps
IB/core: Release object lock if destroy failed
RDMA/ucma: check fd type in ucma_migrate_id()
Diffstat (limited to 'drivers/infiniband/core/ucma.c')
-rw-r--r-- | drivers/infiniband/core/ucma.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index ec8fb289621f..5f437d1570fb 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c | |||
@@ -124,6 +124,8 @@ static DEFINE_MUTEX(mut); | |||
124 | static DEFINE_IDR(ctx_idr); | 124 | static DEFINE_IDR(ctx_idr); |
125 | static DEFINE_IDR(multicast_idr); | 125 | static DEFINE_IDR(multicast_idr); |
126 | 126 | ||
127 | static const struct file_operations ucma_fops; | ||
128 | |||
127 | static inline struct ucma_context *_ucma_find_context(int id, | 129 | static inline struct ucma_context *_ucma_find_context(int id, |
128 | struct ucma_file *file) | 130 | struct ucma_file *file) |
129 | { | 131 | { |
@@ -1581,6 +1583,10 @@ static ssize_t ucma_migrate_id(struct ucma_file *new_file, | |||
1581 | f = fdget(cmd.fd); | 1583 | f = fdget(cmd.fd); |
1582 | if (!f.file) | 1584 | if (!f.file) |
1583 | return -ENOENT; | 1585 | return -ENOENT; |
1586 | if (f.file->f_op != &ucma_fops) { | ||
1587 | ret = -EINVAL; | ||
1588 | goto file_put; | ||
1589 | } | ||
1584 | 1590 | ||
1585 | /* Validate current fd and prevent destruction of id. */ | 1591 | /* Validate current fd and prevent destruction of id. */ |
1586 | ctx = ucma_get_ctx(f.file->private_data, cmd.id); | 1592 | ctx = ucma_get_ctx(f.file->private_data, cmd.id); |