Thread (22 messages) 22 messages, 3 authors, 2024-12-16

Re: [PATCH net-next 2/4] vsock/test: Add test for accept_queue memory leak

From: Michal Luczaj <hidden>
Date: 2024-12-13 14:28:00

On 12/13/24 12:55, Stefano Garzarella wrote:
On Thu, Dec 12, 2024 at 11:12:19PM +0100, Michal Luczaj wrote:
quoted
On 12/10/24 17:18, Stefano Garzarella wrote:
quoted
[...]
What about using `vsock_stream_connect` so you can remove a lot of
code from this function (e.g. sockaddr_vm, socket(), etc.)

We only need to add `control_expectln("LISTENING")` in the server which
should also fix my previous comment.
Sure, I followed your suggestion with

	tout = current_nsec() + ACCEPTQ_LEAK_RACE_TIMEOUT * NSEC_PER_SEC;
	do {
		control_writeulong(RACE_CONTINUE);
		fd = vsock_stream_connect(opts->peer_cid, opts->peer_port);
		if (fd >= 0)
			close(fd);
I'd do
		if (fd < 0) {
			perror("connect");
			exit(EXIT_FAILURE);
		}
		close(fd);
I think that won't fly. We're racing here with close(listener), so a
failing connect() is expected.

Michal
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help