All of
 help / color / mirror / Atom feed
From: Hangyu Hua <>
	Hangyu Hua <>
Subject: [PATCH net] Phonet: refcount leak in pep_sock_accep
Date: Thu,  9 Dec 2021 16:28:39 +0800	[thread overview]
Message-ID: <> (raw)

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 <>
 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);
 		newsk = NULL;
 		goto drop;

             reply	other threads:[~2021-12-09  8:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09  8:28 Hangyu Hua [this message]
2021-12-11  4:40 ` [PATCH net] Phonet: refcount leak in pep_sock_accep patchwork-bot+netdevbpf

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:

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

  git send-email \ \ \ \ \ \ \ \

* 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.