Skip to contentSkip to conversation

rds: memory leak in __rds_conn_create()

PATCH Applied Hangyu Hua 4 participants 4 messages Dec 14, 2021

Subsystems (4)
lore
Share & tools
lore

Hangyu Hua

author
#0 lore raw

PATCH 1/1 rds: memory leak in __rds_conn_create()

__rds_conn_create() did not release conn->c_path when loop_trans != 0 and trans->t_prefer_loopback != 0 and is_outgoing == 0.

---
 net/rds/connection.c | 1 +
 1 file changed, 1 insertion(+)
net/rds/connection.c +1 -0
index a3bc4b54d491..b4cc699c5fad 100644
@@ -253,6 +253,7 @@ static struct rds_connection *__rds_conn_create(struct net *net,
 				 * should end up here, but if it
 				 * does, reset/destroy the connection.
 				 */
+				kfree(conn->c_path);
 				kmem_cache_free(rds_conn_slab, conn);
 				conn = ERR_PTR(-EOPNOTSUPP);
 				goto out;
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Hangyu Hua

__rds_conn_create() did not release conn->c_path when loop_trans != 0 and trans->t_prefer_loopback != 0 and is_outgoing == 0.

Probably a good idea to include:

Fixes aced3ce57cd3 ("RDS tcp loopback connection can hang")
Quoted 1 line

With that,

Thanks,
Sharath

Quoted 16 lines
---
  net/rds/connection.c | 1 +
  1 file changed, 1 insertion(+)
net/rds/connection.c +1 -0
index a3bc4b54d491..b4cc699c5fad 100644
@@ -253,6 +253,7 @@ static struct rds_connection *__rds_conn_create(struct net *net,
  				 * should end up here, but if it
  				 * does, reset/destroy the connection.
  				 */
+				kfree(conn->c_path);
  				kmem_cache_free(rds_conn_slab, conn);
  				conn = ERR_PTR(-EOPNOTSUPP);
  				goto out;
#2 lore raw
In reply to Hangyu Hua
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:

Quoted 7 lines · On Tue, 14 Dec 2021 18:46:59 +0800 you wrote:

__rds_conn_create() did not release conn->c_path when loop_trans != 0 and trans->t_prefer_loopback != 0 and is_outgoing == 0.

---
 net/rds/connection.c | 1 +
 1 file changed, 1 insertion(+)

Here is the summary with links:
- [net] rds: memory leak in __rds_conn_create()

    https://git.kernel.org/netdev/net/c/5f9562ebe710

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html