From owner-svn-src-projects@freebsd.org Sat Sep 16 16:31:32 2017 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83829E209BB for ; Sat, 16 Sep 2017 16:31:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 431AA80200; Sat, 16 Sep 2017 16:31:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8GGVVuU049137; Sat, 16 Sep 2017 16:31:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8GGVUbk049132; Sat, 16 Sep 2017 16:31:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201709161631.v8GGVUbk049132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 16 Sep 2017 16:31:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r323651 - projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core X-SVN-Group: projects X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 323651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Sep 2017 16:31:32 -0000 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;