Commit 5b888c0b authored by Wang Zhaolong's avatar Wang Zhaolong
Browse files

Revert "smb: client: Fix netns refcount imbalance causing leaks and use-after-free"

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBWJP6


CVE: NA

--------------------------------

This reverts commit 55dff61c.

The patch fails to resolve the network layer counter leakage issue
introduced by its prerequisite patch. This patch and its prerequisite
patch are reverted together.

Fixes: 55dff61c ("smb: client: fix TCP timers deadlock after rmmod")
Signed-off-by: default avatarWang Zhaolong <wangzhaolong1@huawei.com>
parent afadf562
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -429,7 +429,6 @@ cifs_reconnect(struct TCP_Server_Info *server)
			 server->ssocket->state, server->ssocket->flags);
		sock_release(server->ssocket);
		server->ssocket = NULL;
		put_net(cifs_net_ns(server));
	}
	server->sequence_number = 0;
	server->session_estab = false;
@@ -3652,11 +3651,7 @@ generic_ip_connect(struct TCP_Server_Info *server)
		/*
		 * Grab netns reference for the socket.
		 *
		 * This reference will be released in several situations:
		 * - In the failure path before the cifsd is started
		 * - In the all place where server->socket is released, it is
		 *   also set to NULL.
		 * - Ultimately in clean_demultiplex_info(), during the final
		 * It'll be released here, on error, or in clean_demultiplex_info() upon server
		 * teardown.
		 */
		get_net(net);
@@ -3672,8 +3667,10 @@ generic_ip_connect(struct TCP_Server_Info *server)
	}

	rc = bind_socket(server);
	if (rc < 0)
	if (rc < 0) {
		put_net(cifs_net_ns(server));
		return rc;
	}

	/*
	 * Eventually check for other socket options to change from
@@ -3716,6 +3713,9 @@ generic_ip_connect(struct TCP_Server_Info *server)
	if (sport == htons(RFC1001_PORT))
		rc = ip_rfc1001_connect(server);

	if (rc < 0)
		put_net(cifs_net_ns(server));

	return rc;
}