Skip to contentSkip to conversation

phonet: refcount leak in pep_sock_accep

PATCH In review Aayush Agarwal 2 participants 4 messages Jan 7, 2022 – Jan 9, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phonet: refcount leak in pep_sock_accep

From: Hangyu Hua <[email protected]>

commit bcd0f9335332 ("phonet: refcount leak in pep_sock_accep") upstream.

sock_hold(sk) is invoked in pep_sock_accept(), but __sock_put(sk) is not invoked in subsequent failure branches(pep_accept_conn() != 0).

---
 net/phonet/pep.c | 1 +
 1 file changed, 1 insertion(+)
net/phonet/pep.c +1 -0
index b0d958cd1823..4c4a8a42ee88 100644
@@ -881,6 +881,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;
Signature · 1 line
2.27.0
maintainer
#1 lore raw
Quoted 8 lines · Aayush Agarwal

From: Hangyu Hua <[email protected]>

commit bcd0f9335332 ("phonet: refcount leak in pep_sock_accep") upstream.

sock_hold(sk) is invoked in pep_sock_accept(), but __sock_put(sk) is not invoked in subsequent failure branches(pep_accept_conn() != 0).

Quoted 7 lines
---
 net/phonet/pep.c | 1 +
 1 file changed, 1 insertion(+)

What about releases 5.15.y, 5.10.y, 5.4.y, and 4.19.y? Is this also relevant for those trees?

thanks,

greg k-h

#2 lore raw

Re: [External] : Re: [PATCH 4.14] phonet: refcount leak in pep_sock_accep

Quoted 16 lines · Greg KH
Quoted 8 lines · Aayush Agarwal

From: Hangyu Hua <[email protected]>

commit bcd0f9335332 ("phonet: refcount leak in pep_sock_accep") upstream.

sock_hold(sk) is invoked in pep_sock_accept(), but __sock_put(sk) is not invoked in subsequent failure branches(pep_accept_conn() != 0).

Quoted 7 lines
---
  net/phonet/pep.c | 1 +
  1 file changed, 1 insertion(+)
Quoted 6 lines

What about releases 5.15.y, 5.10.y, 5.4.y, and 4.19.y? Is this also relevant for those trees?

thanks,

greg k-h

It's relevant for all currently supported stable releases: 4.4.y, 4.9.y, 4.14.y, 4.19.y, 5.4.y, 5.10.y, 5.15.y . I missed adding the tag "Cc: [email protected] #4.4+". Should I send the patch again?

maintainer
#3 lore raw

Re: [External] : Re: [PATCH 4.14] phonet: refcount leak in pep_sock_accep

Quoted 21 lines · On Fri, Jan 07, 2022 at 10:24:53PM +0530, [email protected] wrote:
Quoted 19 lines · Greg KH
Quoted 8 lines · Aayush Agarwal

From: Hangyu Hua <[email protected]>

commit bcd0f9335332 ("phonet: refcount leak in pep_sock_accep") upstream.

sock_hold(sk) is invoked in pep_sock_accept(), but __sock_put(sk) is not invoked in subsequent failure branches(pep_accept_conn() != 0).

Quoted 7 lines
---
  net/phonet/pep.c | 1 +
  1 file changed, 1 insertion(+)

What about releases 5.15.y, 5.10.y, 5.4.y, and 4.19.y? Is this also relevant for those trees?

Quoted 7 lines
Quoted 3 lines

thanks,

greg k-h

It's relevant for all currently supported stable releases: 4.4.y, 4.9.y, 4.14.y, 4.19.y, 5.4.y, 5.10.y, 5.15.y . I missed adding the tag "Cc:
[email protected] #4.4+". Should I send the patch again?

No need, I've queued it up everywhere now, thanks!

greg k-h