linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IB/cma: Fix net_dev reference leak with failed requests
@ 2015-08-27 12:55 Haggai Eran
       [not found] ` <1440680115-9164-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Haggai Eran @ 2015-08-27 12:55 UTC (permalink / raw)
  To: Doug Ledford; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Haggai Eran

When no matching listening ID is found for a given request, the net_dev
that was used to find the request isn't released.

Fixes: 20c36836ecad ("IB/cma: Use found net_dev for passive connections")
Signed-off-by: Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/core/cma.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 9b306d7b5c27..b1ab13f3e182 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1302,6 +1302,10 @@ static struct rdma_id_private *cma_id_from_event(struct ib_cm_id *cm_id,
 	bind_list = cma_ps_find(rdma_ps_from_service_id(req.service_id),
 				cma_port_from_service_id(req.service_id));
 	id_priv = cma_find_listener(bind_list, cm_id, ib_event, &req, *net_dev);
+	if (IS_ERR(id_priv)) {
+		dev_put(*net_dev);
+		*net_dev = NULL;
+	}
 
 	return id_priv;
 }
-- 
1.7.11.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] IB/cma: Fix net_dev reference leak with failed requests
       [not found] ` <1440680115-9164-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2015-08-30  6:12   ` Or Gerlitz
       [not found]     ` <CAJ3xEMhtnzHu23wnpsHex5_xt3MV=z3ERoX6T5d=RoTVdOVrpw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2015-09-03 17:56   ` Doug Ledford
  1 sibling, 1 reply; 6+ messages in thread
From: Or Gerlitz @ 2015-08-30  6:12 UTC (permalink / raw)
  To: Haggai Eran, Doug Ledford; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Thu, Aug 27, 2015 at 5:55 AM, Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:
> When no matching listening ID is found for a given request, the net_dev
> that was used to find the request isn't released.
>
> Fixes: 20c36836ecad ("IB/cma: Use found net_dev for passive connections")

same here, Doug, if this ID isn't the one that is actually going to
show off in Linus tree, please either squash this there prior to
getting the bits upstream or hold off till we have  a proper ID

> Signed-off-by: Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/infiniband/core/cma.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
> index 9b306d7b5c27..b1ab13f3e182 100644
> --- a/drivers/infiniband/core/cma.c
> +++ b/drivers/infiniband/core/cma.c
> @@ -1302,6 +1302,10 @@ static struct rdma_id_private *cma_id_from_event(struct ib_cm_id *cm_id,
>         bind_list = cma_ps_find(rdma_ps_from_service_id(req.service_id),
>                                 cma_port_from_service_id(req.service_id));
>         id_priv = cma_find_listener(bind_list, cm_id, ib_event, &req, *net_dev);
> +       if (IS_ERR(id_priv)) {
> +               dev_put(*net_dev);
> +               *net_dev = NULL;
> +       }
>
>         return id_priv;
>  }
> --
> 1.7.11.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] IB/cma: Fix net_dev reference leak with failed requests
       [not found]     ` <CAJ3xEMhtnzHu23wnpsHex5_xt3MV=z3ERoX6T5d=RoTVdOVrpw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-08-30 22:25       ` Doug Ledford
       [not found]         ` <55E382CF.9040506-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Doug Ledford @ 2015-08-30 22:25 UTC (permalink / raw)
  To: Or Gerlitz, Haggai Eran; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 588 bytes --]

On 08/30/2015 02:12 AM, Or Gerlitz wrote:
> On Thu, Aug 27, 2015 at 5:55 AM, Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:
>> When no matching listening ID is found for a given request, the net_dev
>> that was used to find the request isn't released.
>>
>> Fixes: 20c36836ecad ("IB/cma: Use found net_dev for passive connections")
> 
> same here, Doug,

Same as the last email, I have the commit ID now, and I fixed up the
commit message.



-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] IB/cma: Fix net_dev reference leak with failed requests
       [not found]         ` <55E382CF.9040506-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2015-08-31 15:20           ` Weiny, Ira
       [not found]             ` <2807E5FD2F6FDA4886F6618EAC48510E1CB7D78D-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Weiny, Ira @ 2015-08-31 15:20 UTC (permalink / raw)
  To: Doug Ledford; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

> 
> On 08/30/2015 02:12 AM, Or Gerlitz wrote:
> > On Thu, Aug 27, 2015 at 5:55 AM, Haggai Eran <haggaie@mellanox.com>
> wrote:
> >> When no matching listening ID is found for a given request, the
> >> net_dev that was used to find the request isn't released.
> >>
> >> Fixes: 20c36836ecad ("IB/cma: Use found net_dev for passive
> >> connections")
> >
> > same here, Doug,
> 
> Same as the last email, I have the commit ID now, and I fixed up the commit
> message.
> 

Doug I'm working on the clean up Hal suggested to the ib_mad.h file which was updated in your to-be-rebased-4.3 branch via this patch.

Fixes: abde0260e47b ("IB/core: Add header definitions")

It looks like this is the patch destined for 4.3 on this branch k.o/for-4.3?

Fixes: d4ab347005fb ("IB/core: Add core header changes needed for OPA")

I personally did not mind the rebasing except for this issue.

Let me know which branch I should base these changes off of.

Thanks,
Ira


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] IB/cma: Fix net_dev reference leak with failed requests
       [not found]             ` <2807E5FD2F6FDA4886F6618EAC48510E1CB7D78D-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2015-09-01  0:23               ` Doug Ledford
  0 siblings, 0 replies; 6+ messages in thread
From: Doug Ledford @ 2015-09-01  0:23 UTC (permalink / raw)
  To: Weiny, Ira; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1390 bytes --]

On 08/31/2015 11:20 AM, Weiny, Ira wrote:
>>
>> On 08/30/2015 02:12 AM, Or Gerlitz wrote:
>>> On Thu, Aug 27, 2015 at 5:55 AM, Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>> wrote:
>>>> When no matching listening ID is found for a given request, the
>>>> net_dev that was used to find the request isn't released.
>>>>
>>>> Fixes: 20c36836ecad ("IB/cma: Use found net_dev for passive
>>>> connections")
>>>
>>> same here, Doug,
>>
>> Same as the last email, I have the commit ID now, and I fixed up the commit
>> message.
>>
> 
> Doug I'm working on the clean up Hal suggested to the ib_mad.h file which was updated in your to-be-rebased-4.3 branch via this patch.
> 
> Fixes: abde0260e47b ("IB/core: Add header definitions")
> 
> It looks like this is the patch destined for 4.3 on this branch k.o/for-4.3?
> 
> Fixes: d4ab347005fb ("IB/core: Add core header changes needed for OPA")

Correct.  I squashed the first two patches (which both touched core
files) down to just one.

> I personally did not mind the rebasing except for this issue.
> 
> Let me know which branch I should base these changes off of.

Base if off of the k.o/for-4.3.  That's where it will go.  I'll just end
up applying this to the top of the stack.


-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] IB/cma: Fix net_dev reference leak with failed requests
       [not found] ` <1440680115-9164-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  2015-08-30  6:12   ` Or Gerlitz
@ 2015-09-03 17:56   ` Doug Ledford
  1 sibling, 0 replies; 6+ messages in thread
From: Doug Ledford @ 2015-09-03 17:56 UTC (permalink / raw)
  To: Haggai Eran; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1174 bytes --]

On 08/27/2015 08:55 AM, Haggai Eran wrote:
> When no matching listening ID is found for a given request, the net_dev
> that was used to find the request isn't released.
> 
> Fixes: 20c36836ecad ("IB/cma: Use found net_dev for passive connections")
> Signed-off-by: Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Applied, thanks!

> ---
>  drivers/infiniband/core/cma.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
> index 9b306d7b5c27..b1ab13f3e182 100644
> --- a/drivers/infiniband/core/cma.c
> +++ b/drivers/infiniband/core/cma.c
> @@ -1302,6 +1302,10 @@ static struct rdma_id_private *cma_id_from_event(struct ib_cm_id *cm_id,
>  	bind_list = cma_ps_find(rdma_ps_from_service_id(req.service_id),
>  				cma_port_from_service_id(req.service_id));
>  	id_priv = cma_find_listener(bind_list, cm_id, ib_event, &req, *net_dev);
> +	if (IS_ERR(id_priv)) {
> +		dev_put(*net_dev);
> +		*net_dev = NULL;
> +	}
>  
>  	return id_priv;
>  }
> 


-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-09-03 17:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-27 12:55 [PATCH] IB/cma: Fix net_dev reference leak with failed requests Haggai Eran
     [not found] ` <1440680115-9164-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-08-30  6:12   ` Or Gerlitz
     [not found]     ` <CAJ3xEMhtnzHu23wnpsHex5_xt3MV=z3ERoX6T5d=RoTVdOVrpw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-08-30 22:25       ` Doug Ledford
     [not found]         ` <55E382CF.9040506-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-08-31 15:20           ` Weiny, Ira
     [not found]             ` <2807E5FD2F6FDA4886F6618EAC48510E1CB7D78D-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-09-01  0:23               ` Doug Ledford
2015-09-03 17:56   ` Doug Ledford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).