Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:38170 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752431AbbGaBYR (ORCPT ); Thu, 30 Jul 2015 21:24:17 -0400 Subject: Patch "RDMA/ocrdma: fix double free on pd" has been added to the 4.1-stable tree To: colin.king@canonical.com, devesh.sharma@avagotech.com, dledford@redhat.com, gregkh@linuxfoundation.org Cc: , From: Date: Thu, 30 Jul 2015 18:24:15 -0700 Message-ID: <1438305855139111@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled RDMA/ocrdma: fix double free on pd to the 4.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: rdma-ocrdma-fix-double-free-on-pd.patch and it can be found in the queue-4.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From 4dc544427991e3cef38ce3ae124b7e6557063bd3 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Fri, 5 Jun 2015 15:47:27 +0100 Subject: RDMA/ocrdma: fix double free on pd From: Colin Ian King commit 4dc544427991e3cef38ce3ae124b7e6557063bd3 upstream. A reorganisation of the PD allocation and deallocation in commit 9ba1377daa ("RDMA/ocrdma: Move PD resource management to driver.") introduced a double free on pd, as detected by static analysis by smatch: drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:682 ocrdma_alloc_pd() error: double free of 'pd'^ The original call to ocrdma_mbx_dealloc_pd() (which does not kfree pd) was replaced with a call to _ocrdma_dealloc_pd() (which does kfree pd). The kfree following this call causes the double free, so just remove it to fix the problem. Fixes: 9ba1377daa ("RDMA/ocrdma: Move PD resource management to driver.") Signed-off-by: Colin Ian King Acked-By: Devesh Sharma Signed-off-by: Doug Ledford Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -679,7 +679,6 @@ err: ocrdma_release_ucontext_pd(uctx); } else { status = _ocrdma_dealloc_pd(dev, pd); - kfree(pd); } exit: return ERR_PTR(status); Patches currently in stable-queue which might be from colin.king@canonical.com are queue-4.1/rdma-ocrdma-fix-double-free-on-pd.patch queue-4.1/keys-ensure-we-free-the-assoc-array-edit-if-edit-is-valid.patch