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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YnnaskOKyCqN4o6i@TonyMac-Alibaba>
Date:   Tue, 10 May 2022 11:23:30 +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 1/2] net/smc: non blocking recvmsg() return -EAGAIN
 when no data and signal_pending

On Mon, May 09, 2022 at 07:58:36PM +0800, Guangguan Wang wrote:
> Non blocking sendmsg will return -EAGAIN when any signal pending
> and no send space left, while non blocking recvmsg return -EINTR
> when signal pending and no data received. This may makes confused.
> As TCP returns -EAGAIN in the conditions descriped above. Align the

A little typo descriped -> described.

> behavior of smc with TCP.

I also agree with the behavior of aligning TCP.
 
Fixes tag is preferred:

Fixes: 846e344eb722 ("net/smc: add receive timeout check")

> Signed-off-by: Guangguan Wang <guangguan.wang@...ux.alibaba.com>

Reviewed-by: Tony Lu <tonylu@...ux.alibaba.com>

Thanks,
Tony Lu

> ---
>  net/smc/smc_rx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/smc/smc_rx.c b/net/smc/smc_rx.c
> index 51e8eb2933ff..338b9ef806e8 100644
> --- a/net/smc/smc_rx.c
> +++ b/net/smc/smc_rx.c
> @@ -355,12 +355,12 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg,
>  				}
>  				break;
>  			}
> +			if (!timeo)
> +				return -EAGAIN;
>  			if (signal_pending(current)) {
>  				read_done = sock_intr_errno(timeo);
>  				break;
>  			}
> -			if (!timeo)
> -				return -EAGAIN;
>  		}
>  
>  		if (!smc_rx_data_available(conn)) {
> -- 
> 2.24.3 (Apple Git-128)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ