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]
Date:   Thu, 17 May 2018 08:28:54 -0700
From:   Eric Dumazet <edumazet@...gle.com>
To:     ubraun@...ux.ibm.com
Cc:     David Miller <davem@...emloft.net>,
        netdev <netdev@...r.kernel.org>,
        Eric Dumazet <eric.dumazet@...il.com>,
        linux-s390@...r.kernel.org
Subject: Re: [PATCH net-next] net/smc: init conn.tx_work & conn.send_lock sooner

On Thu, May 17, 2018 at 6:58 AM Ursula Braun <ubraun@...ux.ibm.com> wrote:



> On 05/17/2018 02:20 PM, Eric Dumazet wrote:
> > On Thu, May 17, 2018 at 5:13 AM Ursula Braun <ubraun@...ux.ibm.com>
wrote:
> >
> >> This problem should no longer show up with yesterday's net-next commit
> >> 569bc6436568 ("net/smc: no tx work trigger for fallback sockets").
> >
> > It definitely triggers on latest net-next, which includes 569bc6436568
> >
> > Thanks.
> >

> Sorry, my fault.

> Your proposed patch solves the problem. On the other hand the purpose of
> smc_tx_init() has been to cover tx-related socket initializations needed
for
> connection sockets only. tx_work is something that should be scheduled
only
> for active connection sockets in non-fallback mode.
> Thus I prefer this alternate patch to solve the problem:

> ---
>   net/smc/af_smc.c |    8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)

> --- a/net/smc/af_smc.c
> +++ b/net/smc/af_smc.c
> @@ -1362,14 +1362,18 @@ static int smc_setsockopt(struct socket
>                  }
>                  break;
>          case TCP_NODELAY:
> -               if (sk->sk_state != SMC_INIT && sk->sk_state !=
SMC_LISTEN) {
> +               if (sk->sk_state != SMC_INIT &&
> +                   sk->sk_state != SMC_LISTEN &&
> +                   sk->sk_state != SMC_CLOSED) {
>                          if (val && !smc->use_fallback)
>                                  mod_delayed_work(system_wq,
&smc->conn.tx_work,
>                                                   0);
>                  }
>                  break;
>          case TCP_CORK:
> -               if (sk->sk_state != SMC_INIT && sk->sk_state !=
SMC_LISTEN) {
> +               if (sk->sk_state != SMC_INIT &&
> +                   sk->sk_state != SMC_LISTEN &&
> +                   sk->sk_state != SMC_CLOSED) {
>                          if (!val && !smc->use_fallback)
>                                  mod_delayed_work(system_wq,
&smc->conn.tx_work,
>                                                   0);

> What do you think?

I think my patch is cleaner.

Deferring spinlock and workqueues setup is a recipe for disaster.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ