* [PATCH net] Phonet: refcount leak in pep_sock_accep
@ 2021-12-09 8:28 Hangyu Hua
2021-12-11 4:40 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Hangyu Hua @ 2021-12-09 8:28 UTC (permalink / raw)
To: courmisch, davem, kuba; +Cc: netdev, linux-kernel, Hangyu Hua
sock_hold(sk) is invoked in pep_sock_accept(), but __sock_put(sk) is not
invoked in subsequent failure branches(pep_accept_conn() != 0).
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
---
net/phonet/pep.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index a1525916885a..b4f90afb0638 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -868,6 +868,7 @@ static struct sock *pep_sock_accept(struct sock *sk, int flags, int *errp,
err = pep_accept_conn(newsk, skb);
if (err) {
+ __sock_put(sk);
sock_put(newsk);
newsk = NULL;
goto drop;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] Phonet: refcount leak in pep_sock_accep
2021-12-09 8:28 [PATCH net] Phonet: refcount leak in pep_sock_accep Hangyu Hua
@ 2021-12-11 4:40 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-12-11 4:40 UTC (permalink / raw)
To: Hangyu Hua; +Cc: courmisch, davem, kuba, netdev, linux-kernel
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 9 Dec 2021 16:28:39 +0800 you wrote:
> sock_hold(sk) is invoked in pep_sock_accept(), but __sock_put(sk) is not
> invoked in subsequent failure branches(pep_accept_conn() != 0).
>
> Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
> ---
> net/phonet/pep.c | 1 +
> 1 file changed, 1 insertion(+)
Here is the summary with links:
- [net] Phonet: refcount leak in pep_sock_accep
https://git.kernel.org/netdev/net/c/bcd0f9335332
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-11 4:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-09 8:28 [PATCH net] Phonet: refcount leak in pep_sock_accep Hangyu Hua
2021-12-11 4:40 ` patchwork-bot+netdevbpf
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).