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: <001f01d2b3da$97282a40$c5787ec0$@foxmail.com>
Date:   Thu, 13 Apr 2017 06:17:35 +0800
From:   "Gao Feng" <gfree.wind@...mail.com>
To:     "'David Miller'" <davem@...emloft.net>, <gfree.wind@...mail.com>
Cc:     <kuznet@....inr.ac.ru>, <jmorris@...ei.org>, <kaber@...sh.net>,
        <ncardwell@...gle.com>, <netdev@...r.kernel.org>
Subject: RE: [PATCH net 1/1] net: tcp: Increase TCPABORTONLINGER when send RST by linger2 in keepalive timer

Hi David,

> -----Original Message-----
> From: David Miller [mailto:davem@...emloft.net]
> Sent: Thursday, April 13, 2017 1:21 AM
> To: gfree.wind@...mail.com
> Cc: kuznet@....inr.ac.ru; jmorris@...ei.org; kaber@...sh.net;
> ncardwell@...gle.com; netdev@...r.kernel.org; fgao@...ai8.com
> Subject: Re: [PATCH net 1/1] net: tcp: Increase TCPABORTONLINGER when send
> RST by linger2 in keepalive timer
> 
> From: gfree.wind@...mail.com
> Date: Sun,  9 Apr 2017 20:44:41 +0800
> 
> > From: Gao Feng <fgao@...ai8.com>
> >
> > It should increase TCPABORTONLINGER counter when send RST caused by
> > linger2 in keepalive timer.
> >
> > Signed-off-by: Gao Feng <fgao@...ai8.com>
> > ---
> >  net/ipv4/tcp_timer.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index
> > b2ab411..5c01f21 100644
> > --- a/net/ipv4/tcp_timer.c
> > +++ b/net/ipv4/tcp_timer.c
> > @@ -650,6 +650,8 @@ static void tcp_keepalive_timer (unsigned long data)
> >  				tcp_time_wait(sk, TCP_FIN_WAIT2, tmo);
> >  				goto out;
> >  			}
> > +		} else {
> > +			NET_INC_STATS(sock_net(sk),
LINUX_MIB_TCPABORTONLINGER);
> >  		}
> >  		tcp_send_active_reset(sk, GFP_ATOMIC);
> >  		goto death;
> 
> I think this else clause is completely unnecessary.  Just do it right
above the
> tcp_send_active_reset() call and at the same indentation level.
> 
> Alternatively, if you are trying to only bump the counter when tp->linger2
is
> >= 0, then you attached the else clause to the wrong if() test.
> 
> Thank you.

Actually I only want increase the TCPABORTONLINGER when linger2 is negative
which
means the timeout of FIN_WAIT2 is 0. We need to make socket state is closed
and send
one RST to peer.

Because tmo may be zero too, so increase this counter in the else block to
avoid it.

Best Regards
Feng


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ