mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: xiyuyang19@fudan.edu.cn
Cc: jmaloy@redhat.com, ying.xue@windriver.com, kuba@kernel.org,
	netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, yuanxzhang@fudan.edu.cn,
	kjlu@umn.edu, tanxin.ctf@gmail.com
Subject: Re: [PATCH] tipc: Fix potential tipc_node refcnt leak in tipc_rcv
Date: Sat, 18 Apr 2020 13:26:14 -0700 (PDT)	[thread overview]
Message-ID: <20200418.132614.92642620154751485.davem@davemloft.net> (raw)
In-Reply-To: <1586940029-69994-1-git-send-email-xiyuyang19@fudan.edu.cn>

From: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Date: Wed, 15 Apr 2020 16:40:28 +0800

> tipc_rcv() invokes tipc_node_find() twice, which returns a reference of
> the specified tipc_node object to "n" with increased refcnt.
> 
> When tipc_rcv() returns or a new object is assigned to "n", the original
> local reference of "n" becomes invalid, so the refcount should be
> decreased to keep refcount balanced.
> 
> The issue happens in some paths of tipc_rcv(), which forget to decrease
> the refcnt increased by tipc_node_find() and will cause a refcnt leak.
> 
> Fix this issue by calling tipc_node_put() before the original object
> pointed by "n" becomes invalid.
> 
> Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>

Applied and queued up for -stable.

  reply	other threads:[~2020-04-18 20:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15  8:40 Xiyu Yang
2020-04-18 20:26 ` David Miller [this message]
2020-04-15  9:34 Markus Elfring

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=20200418.132614.92642620154751485.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jmaloy@redhat.com \
    --cc=kjlu@umn.edu \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tanxin.ctf@gmail.com \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=xiyuyang19@fudan.edu.cn \
    --cc=ying.xue@windriver.com \
    --cc=yuanxzhang@fudan.edu.cn \
    /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

all inboxes | Powered by JetHome®