[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200423.154949.459034580485896359.davem@davemloft.net>
Date: Thu, 23 Apr 2020 15:49:49 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: xiyuyang19@...an.edu.cn
Cc: andrew.hendry@...il.com, kuba@...nel.org,
gregkh@...uxfoundation.org, edumazet@...gle.com,
allison@...utok.net, tglx@...utronix.de, linux-x25@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
yuanxzhang@...an.edu.cn, kjlu@....edu, tanxin.ctf@...il.com
Subject: Re: [PATCH] net/x25: Fix x25_neigh refcnt leak when reveiving frame
From: Xiyu Yang <xiyuyang19@...an.edu.cn>
Date: Thu, 23 Apr 2020 13:13:03 +0800
> x25_lapb_receive_frame() invokes x25_get_neigh(), which returns a
> reference of the specified x25_neigh object to "nb" with increased
> refcnt.
>
> When x25_lapb_receive_frame() returns, local variable "nb" becomes
> invalid, so the refcount should be decreased to keep refcount balanced.
>
> The reference counting issue happens in one path of
> x25_lapb_receive_frame(). When pskb_may_pull() returns false, the
> function forgets to decrease the refcnt increased by x25_get_neigh(),
> causing a refcnt leak.
>
> Fix this issue by calling x25_neigh_put() when pskb_may_pull() returns
> false.
>
> Signed-off-by: Xiyu Yang <xiyuyang19@...an.edu.cn>
> Signed-off-by: Xin Tan <tanxin.ctf@...il.com>
Applied and queued up for -stable, thanks.
Powered by blists - more mailing lists