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] [day] [month] [year] [list]
Message-ID: <2bdfe259-e182-4846-b501-a33096cc74f1@rbox.co>
Date: Tue, 21 Jan 2025 19:06:31 +0100
From: Michal Luczaj <mhal@...x.co>
To: Luigi Leonardi <leonardi@...hat.com>
Cc: Stefano Garzarella <sgarzare@...hat.com>, netdev@...r.kernel.org,
 Simon Horman <horms@...nel.org>, Stefan Hajnoczi <stefanha@...hat.com>,
 linux-kernel@...r.kernel.org, Eric Dumazet <edumazet@...gle.com>,
 Xuan Zhuo <xuanzhuo@...ux.alibaba.com>, Wongi Lee <qwerty@...ori.io>,
 "David S. Miller" <davem@...emloft.net>, Paolo Abeni <pabeni@...hat.com>,
 Jason Wang <jasowang@...hat.com>,
 Bobby Eshleman <bobby.eshleman@...edance.com>,
 virtualization@...ts.linux.dev, Eugenio PĂ©rez
 <eperezma@...hat.com>, bpf@...r.kernel.org, Jakub Kicinski
 <kuba@...nel.org>, "Michael S. Tsirkin" <mst@...hat.com>,
 Hyunwoo Kim <v4bel@...ori.io>, kvm@...r.kernel.org
Subject: Re: [PATCH net 1/2] vsock/virtio: discard packets if the transport
 changes

On 1/21/25 18:30, Luigi Leonardi wrote:
> On Thu, Jan 09, 2025 at 02:34:28PM +0100, Michal Luczaj wrote:
>> FWIW, I've tried simplifying Hyunwoo's repro to toy with some tests. 
>> Ended
>> up with
>>
>> ```
>>from threading import *
>>from socket import *
>>from signal import *
>>
>> def listener(tid):
>> 	while True:
>> 		s = socket(AF_VSOCK, SOCK_SEQPACKET)
>> 		s.bind((1, 1234))
>> 		s.listen()
>> 		pthread_kill(tid, SIGUSR1)
>>
>> signal(SIGUSR1, lambda *args: None)
>> Thread(target=listener, args=[get_ident()]).start()
>>
>> while True:
>> 	c = socket(AF_VSOCK, SOCK_SEQPACKET)
>> 	c.connect_ex((1, 1234))
>> 	c.connect_ex((42, 1234))
>> ```
>>
>> which gives me splats with or without this patch.
>>
>> That said, when I apply this patch, but drop the `sk->sk_state !=
>> TCP_LISTEN &&`: no more splats.
>>
> Hi Michal,
> 
> I think it would be nice to have this test in the vsock test suite.  
> WDYT? If you don't have any plans to port this to C, I can take care of 
> it :)

Sure, go ahead, but note that this is just a (probably suboptimal) Python
version of Hyunwoo's C repro[1].

[1]: https://lore.kernel.org/netdev/Z2LvdTTQR7dBmPb5@v4bel-B760M-AORUS-ELITE-AX/


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ