Commit d5dfe4f1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull rdma fixes from Jason Gunthorpe:
 "A few minor bug fixes for user visible defects, and one regression:

   - Various bugs from static checkers and syzkaller

   - Add missing error checking in mlx4

   - Prevent RTNL lock recursion in i40iw

   - Fix segfault in cxgb4 in peer abort cases

   - Fix a regression added in 5.7 where the IB_EVENT_DEVICE_FATAL could
     be lost, and wasn't delivered to all the FDs"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
  RDMA/uverbs: Move IB_EVENT_DEVICE_FATAL to destroy_uobj
  RDMA/uverbs: Do not discard the IB_EVENT_DEVICE_FATAL event
  RDMA/iw_cxgb4: Fix incorrect function parameters
  RDMA/core: Fix double put of resource
  IB/core: Fix potential NULL pointer dereference in pkey cache
  IB/hfi1: Fix another case where pq is left on waitlist
  IB/i40iw: Remove bogus call to netdev_master_upper_dev_get()
  IB/mlx4: Test return value of calls to ib_get_cached_pkey
  RDMA/rxe: Always return ERR_PTR from rxe_create_mmap_info()
  i40iw: Fix error handling in i40iw_manage_arp_cache()
parents ce247296 ccfdbaa5
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1553,8 +1553,11 @@ int ib_cache_setup_one(struct ib_device *device)
	if (err)
		return err;

	rdma_for_each_port (device, p)
		ib_cache_update(device, p, true);
	rdma_for_each_port (device, p) {
		err = ib_cache_update(device, p, true);
		if (err)
			return err;
	}

	return 0;
}
+1 −2
Original line number Diff line number Diff line
@@ -1292,11 +1292,10 @@ static int res_get_common_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
	has_cap_net_admin = netlink_capable(skb, CAP_NET_ADMIN);

	ret = fill_func(msg, has_cap_net_admin, res, port);

	rdma_restrack_put(res);
	if (ret)
		goto err_free;

	rdma_restrack_put(res);
	nlmsg_end(msg, nlh);
	ib_device_put(device);
	return rdma_nl_unicast(sock_net(skb->sk), msg, NETLINK_CB(skb).portid);
+2 −1
Original line number Diff line number Diff line
@@ -459,7 +459,8 @@ alloc_begin_fd_uobject(const struct uverbs_api_object *obj,
	struct ib_uobject *uobj;
	struct file *filp;

	if (WARN_ON(fd_type->fops->release != &uverbs_uobject_fd_release))
	if (WARN_ON(fd_type->fops->release != &uverbs_uobject_fd_release &&
		    fd_type->fops->release != &uverbs_async_event_release))
		return ERR_PTR(-EINVAL);

	new_fd = get_unused_fd_flags(O_CLOEXEC);
+4 −0
Original line number Diff line number Diff line
@@ -219,6 +219,7 @@ void ib_uverbs_init_event_queue(struct ib_uverbs_event_queue *ev_queue);
void ib_uverbs_init_async_event_file(struct ib_uverbs_async_event_file *ev_file);
void ib_uverbs_free_event_queue(struct ib_uverbs_event_queue *event_queue);
void ib_uverbs_flow_resources_free(struct ib_uflow_resources *uflow_res);
int uverbs_async_event_release(struct inode *inode, struct file *filp);

int ib_alloc_ucontext(struct uverbs_attr_bundle *attrs);
int ib_init_ucontext(struct uverbs_attr_bundle *attrs);
@@ -227,6 +228,9 @@ void ib_uverbs_release_ucq(struct ib_uverbs_completion_event_file *ev_file,
			   struct ib_ucq_object *uobj);
void ib_uverbs_release_uevent(struct ib_uevent_object *uobj);
void ib_uverbs_release_file(struct kref *ref);
void ib_uverbs_async_handler(struct ib_uverbs_async_event_file *async_file,
			     __u64 element, __u64 event,
			     struct list_head *obj_list, u32 *counter);

void ib_uverbs_comp_handler(struct ib_cq *cq, void *cq_context);
void ib_uverbs_cq_event_handler(struct ib_event *event, void *context_ptr);
+4 −8
Original line number Diff line number Diff line
@@ -346,7 +346,7 @@ const struct file_operations uverbs_async_event_fops = {
	.owner	 = THIS_MODULE,
	.read	 = ib_uverbs_async_event_read,
	.poll    = ib_uverbs_async_event_poll,
	.release = uverbs_uobject_fd_release,
	.release = uverbs_async_event_release,
	.fasync  = ib_uverbs_async_event_fasync,
	.llseek	 = no_llseek,
};
@@ -386,10 +386,9 @@ void ib_uverbs_comp_handler(struct ib_cq *cq, void *cq_context)
	kill_fasync(&ev_queue->async_queue, SIGIO, POLL_IN);
}

static void
ib_uverbs_async_handler(struct ib_uverbs_async_event_file *async_file,
			__u64 element, __u64 event, struct list_head *obj_list,
			u32 *counter)
void ib_uverbs_async_handler(struct ib_uverbs_async_event_file *async_file,
			     __u64 element, __u64 event,
			     struct list_head *obj_list, u32 *counter)
{
	struct ib_uverbs_event *entry;
	unsigned long flags;
@@ -1187,9 +1186,6 @@ static void ib_uverbs_free_hw_resources(struct ib_uverbs_device *uverbs_dev,
		 */
		mutex_unlock(&uverbs_dev->lists_mutex);

		ib_uverbs_async_handler(READ_ONCE(file->async_file), 0,
					IB_EVENT_DEVICE_FATAL, NULL, NULL);

		uverbs_destroy_ufile_hw(file, RDMA_REMOVE_DRIVER_REMOVE);
		kref_put(&file->ref, ib_uverbs_release_file);

Loading