lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0bf61281-b82c-4699-9209-bf88ea9fdec5@rbox.co>
Date: Fri, 13 Dec 2024 15:27:53 +0100
From: Michal Luczaj <mhal@...x.co>
To: Stefano Garzarella <sgarzare@...hat.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH net-next 2/4] vsock/test: Add test for accept_queue memory
 leak

On 12/13/24 12:55, Stefano Garzarella wrote:
> On Thu, Dec 12, 2024 at 11:12:19PM +0100, Michal Luczaj wrote:
>> On 12/10/24 17:18, Stefano Garzarella wrote:
>>> [...]
>>> 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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ