public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: "Steve Wise" <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
To: 'Leon Romanovsky' <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	markb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
Subject: RE: [PATCH rdma-next 1/4] IB/iwpm: Fix a potential skb leak
Date: Wed, 4 May 2016 10:36:27 -0500	[thread overview]
Message-ID: <019801d1a61a$b8ec7600$2ac56200$@opengridcomputing.com> (raw)
In-Reply-To: <1462340165-16067-2-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>



> -----Original Message-----
> From: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [mailto:linux-rdma-
> owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Leon Romanovsky
> Sent: Wednesday, May 04, 2016 12:36 AM
> To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
> Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; markb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org; majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org;
> matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org; Leon Romanovsky
> Subject: [PATCH rdma-next 1/4] IB/iwpm: Fix a potential skb leak
> 
> From: Mark Bloch <markb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> 
> In case ibnl_put_msg fails in send_nlmsg_done,
> the function returns with -ENOMEM without freeing.
> 
> This patch fixes this behavior.
> 
> Fixes: 30dc5e63d6a5 ("RDMA/core: Add support for iWARP Port Mapper user space
> service")
> Signed-off-by: Mark Bloch <markb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---
>  drivers/infiniband/core/iwpm_util.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/infiniband/core/iwpm_util.c
> b/drivers/infiniband/core/iwpm_util.c
> index 9b2bf2f..b65e06c 100644
> --- a/drivers/infiniband/core/iwpm_util.c
> +++ b/drivers/infiniband/core/iwpm_util.c
> @@ -634,6 +634,7 @@ static int send_nlmsg_done(struct sk_buff *skb, u8
> nl_client, int iwpm_pid)
>  	if (!(ibnl_put_msg(skb, &nlh, 0, 0, nl_client,
>  			   RDMA_NL_IWPM_MAPINFO, NLM_F_MULTI))) {
>  		pr_warn("%s Unable to put NLMSG_DONE\n", __func__);
> +		dev_kfree_skb(skb);
>  		return -ENOMEM;
>  	}
>  	nlh->nlmsg_type = NLMSG_DONE;
> --
> 2.1.4

Looks good.

Reviewed-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>


--
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

  parent reply	other threads:[~2016-05-04 15:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-04  5:36 [PATCH rdma-next 0/4] Trivial fixes Leon Romanovsky
     [not found] ` <1462340165-16067-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-05-04  5:36   ` [PATCH rdma-next 1/4] IB/iwpm: Fix a potential skb leak Leon Romanovsky
     [not found]     ` <1462340165-16067-2-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-05-04 15:36       ` Steve Wise [this message]
2016-05-04  5:36   ` [PATCH rdma-next 2/4] IB/core: Remove unnecessary check in ibnl_rcv_msg Leon Romanovsky
     [not found]     ` <1462340165-16067-3-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-05-04 15:37       ` Steve Wise
2016-05-04 21:35         ` Ira Weiny
2016-05-04  5:36   ` [PATCH rdma-next 3/4] IB/core: Fix a potential array overrun in CMA and SA agent Leon Romanovsky
     [not found]     ` <1462340165-16067-4-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-05-04 15:39       ` Steve Wise
2016-05-04 18:19       ` Jason Gunthorpe
     [not found]         ` <20160504181922.GA20554-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-05-04 21:37           ` Ira Weiny
2016-05-04  5:36   ` [PATCH rdma-next 4/4] IB/sa: Use nlmsg_free instead of kfree_skb Leon Romanovsky
     [not found]     ` <1462340165-16067-5-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-05-04 15:42       ` Steve Wise
2016-05-04 21:38       ` Ira Weiny
2016-05-05  6:43   ` [PATCH rdma-next 0/4] Trivial fixes Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='019801d1a61a$b8ec7600$2ac56200$@opengridcomputing.com' \
    --to=swise-7bpotxp6k4+p2yhjcf5u+vpxobypeauw@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=markb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox