WSL2-Linux-Kernel/net/9p
Wang Hai 8782b32ef8 net/9p: Fix a potential socket leak in p9_socket_open
[ Upstream commit dcc14cfd7d ]

Both p9_fd_create_tcp() and p9_fd_create_unix() will call
p9_socket_open(). If the creation of p9_trans_fd fails,
p9_fd_create_tcp() and p9_fd_create_unix() will return an
error directly instead of releasing the cscoket, which will
result in a socket leak.

This patch adds sock_release() to fix the leak issue.

Fixes: 6b18662e23 ("9p connect fixes")
Signed-off-by: Wang Hai <wanghai38@huawei.com>
ACKed-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-08 11:28:41 +01:00
..
Kconfig
Makefile
client.c net/9p: Initialize the iounit field during fid creation 2022-08-17 14:24:23 +02:00
error.c
mod.c
protocol.c
protocol.h
trans_common.c
trans_common.h
trans_fd.c net/9p: Fix a potential socket leak in p9_socket_open 2022-12-08 11:28:41 +01:00
trans_rdma.c 9p: Add client parameter to p9_req_put() 2022-08-17 14:24:07 +02:00
trans_virtio.c 9p: Add client parameter to p9_req_put() 2022-08-17 14:24:07 +02:00
trans_xen.c 9p: Add client parameter to p9_req_put() 2022-08-17 14:24:07 +02:00