Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Sep 2017 16:31:30 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r323651 - projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core
Message-ID:  <201709161631.v8GGVUbk049132@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Sat Sep 16 16:31:30 2017
New Revision: 323651
URL: https://svnweb.freebsd.org/changeset/base/323651

Log:
  Remove no longer needed linux_poll_wakeup() calls. This is now handled by
  "wake_up()" in the LinuxKPI. Accessing the file pointer directly might cause
  use after free issues.
  
  Sponsored by:	Mellanox Technologies

Modified:
  projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_ucm.c
  projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_ucma.c
  projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_user_mad.c
  projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c
  projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/uverbs.h

Modified: projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_ucm.c
==============================================================================
--- projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_ucm.c	Sat Sep 16 16:28:48 2017	(r323650)
+++ projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_ucm.c	Sat Sep 16 16:31:30 2017	(r323651)
@@ -370,7 +370,6 @@ static int ib_ucm_event_handler(struct ib_cm_id *cm_id
 	list_add_tail(&uevent->file_list, &ctx->file->events);
 	list_add_tail(&uevent->ctx_list, &ctx->events);
 	wake_up_interruptible(&ctx->file->poll_wait);
-	linux_poll_wakeup(ctx->file->filp);
 	mutex_unlock(&ctx->file->file_mutex);
 	return 0;
 

Modified: projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_ucma.c
==============================================================================
--- projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_ucma.c	Sat Sep 16 16:28:48 2017	(r323650)
+++ projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_ucma.c	Sat Sep 16 16:31:30 2017	(r323651)
@@ -353,7 +353,6 @@ static int ucma_event_handler(struct rdma_cm_id *cm_id
 
 	list_add_tail(&uevent->list, &ctx->file->event_list);
 	wake_up_interruptible(&ctx->file->poll_wait);
-	linux_poll_wakeup(ctx->file->filp);
 	if (event->event == RDMA_CM_EVENT_DEVICE_REMOVAL)
 		ucma_removal_event_handler(cm_id);
 out:

Modified: projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_user_mad.c
==============================================================================
--- projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_user_mad.c	Sat Sep 16 16:28:48 2017	(r323650)
+++ projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_user_mad.c	Sat Sep 16 16:31:30 2017	(r323651)
@@ -105,7 +105,6 @@ struct ib_umad_device {
 struct ib_umad_file {
 	struct mutex		mutex;
 	struct ib_umad_port    *port;
-	struct file	       *filp;
 	struct list_head	recv_list;
 	struct list_head	send_list;
 	struct list_head	port_list;
@@ -173,7 +172,6 @@ static int queue_packet(struct ib_umad_file *file,
 		if (agent == __get_agent(file, packet->mad.hdr.id)) {
 			list_add_tail(&packet->list, &file->recv_list);
 			wake_up_interruptible(&file->recv_wait);
-			linux_poll_wakeup(file->filp);
 			ret = 0;
 			break;
 		}
@@ -952,7 +950,6 @@ static int ib_umad_open(struct inode *inode, struct fi
 	init_waitqueue_head(&file->recv_wait);
 
 	file->port = port;
-	file->filp = filp;
 	filp->private_data = file;
 
 	list_add_tail(&file->port_list, &port->file_list);

Modified: projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c
==============================================================================
--- projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c	Sat Sep 16 16:28:48 2017	(r323650)
+++ projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c	Sat Sep 16 16:31:30 2017	(r323651)
@@ -529,7 +529,6 @@ void ib_uverbs_comp_handler(struct ib_cq *cq, void *cq
 	spin_unlock_irqrestore(&file->lock, flags);
 
 	wake_up_interruptible(&file->poll_wait);
-	linux_poll_wakeup(file->filp);
 	kill_fasync(&file->async_queue, SIGIO, POLL_IN);
 }
 
@@ -564,7 +563,6 @@ static void ib_uverbs_async_handler(struct ib_uverbs_f
 	spin_unlock_irqrestore(&file->async_file->lock, flags);
 
 	wake_up_interruptible(&file->async_file->poll_wait);
-	linux_poll_wakeup(file->async_file->filp);
 	kill_fasync(&file->async_file->async_queue, SIGIO, POLL_IN);
 }
 
@@ -662,7 +660,6 @@ struct file *ib_uverbs_alloc_event_file(struct ib_uver
 	if (IS_ERR(filp))
 		goto err_put_refs;
 	filp->private_data = ev_file;
-	ev_file->filp = filp;
 
 	mutex_lock(&uverbs_file->device->lists_mutex);
 	list_add_tail(&ev_file->list,
@@ -1315,7 +1312,6 @@ static void ib_uverbs_free_hw_resources(struct ib_uver
 		}
 
 		wake_up_interruptible(&event_file->poll_wait);
-		linux_poll_wakeup(event_file->filp);
 		kill_fasync(&event_file->async_queue, SIGIO, POLL_IN);
 	}
 	mutex_unlock(&uverbs_dev->lists_mutex);

Modified: projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/uverbs.h
==============================================================================
--- projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/uverbs.h	Sat Sep 16 16:28:48 2017	(r323650)
+++ projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/uverbs.h	Sat Sep 16 16:31:30 2017	(r323651)
@@ -106,7 +106,6 @@ struct ib_uverbs_device {
 
 struct ib_uverbs_event_file {
 	struct kref				ref;
-	struct file			       *filp;
 	int					is_async;
 	struct ib_uverbs_file		       *uverbs_file;
 	spinlock_t				lock;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709161631.v8GGVUbk049132>