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]
Date:   Wed, 11 May 2022 21:32:13 +0800
From:   Tony Lu <tonylu@...ux.alibaba.com>
To:     Guangguan Wang <guangguan.wang@...ux.alibaba.com>
Cc:     kgraul@...ux.ibm.com, davem@...emloft.net, kuba@...nel.org,
        linux-s390@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH net 2/2] net/smc: align the connect behaviour with TCP

On Tue, May 10, 2022 at 08:58:38PM +0800, Guangguan Wang wrote:
> 
> 
> On 2022/5/10 17:30, Tony Lu wrote:
> > On Mon, May 09, 2022 at 07:58:37PM +0800, Guangguan Wang wrote:
> >> Connect with O_NONBLOCK will not be completed immediately
> >> and returns -EINPROGRESS. It is possible to use selector/poll
> >> for completion by selecting the socket for writing. After select
> >> indicates writability, a second connect function call will return
> >> 0 to indicate connected successfully as TCP does, but smc returns
> > 
> > If the connection is established successfully, the following up call of
> > connect() returns -EISCONN (SS_CONNECTED), which is expected and SMC
> > does it, same as TCP.
> > 
> > In case of misunderstanding, could you append more detailed information?
> > 
> > Thanks,
> > Tony Lu
> > 
> 
> io_uring uses nonblocking connect as follow steps:
>   1) call connect with nonblocking
>   2) wait for selector/poll to indicate writability
>   3) call connect to confirm connection's state
> 
> In the third step, tcp changes the socket state from SS_CONNECTING to
> SS_CONNECTED and returns 0 if the connection is established successfully,
> but smc returns -EISCONN.

Based on the steps you list, I am wondering if it is finished in the
step #1, the call of connect() in step #3 would return -EISCONN. Should
we check 0 and -EISCONN in  step #3?

To fix this issue, I think we should be careful about adding and
handling sock state, maybe we could push it to net-next and take
advantage of sock state. And I will test this patch later in our test
cases.

Thanks,
Tony Lu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ