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
| ||
|
Date: Mon, 25 Apr 2011 14:34:21 -0700 From: Andrew Morton <akpm@...ux-foundation.org> To: netdev@...r.kernel.org Cc: bugzilla-daemon@...zilla.kernel.org, bugme-daemon@...zilla.kernel.org, Dmitry.Izbitsky@...etlabs.ru Subject: Re: [Bugme-new] [Bug 33902] New: tcpi_state field in tcp_info structure reports TCP_CLOSE instead of TCP_TIME_WAIT state (switched to email. Please respond via emailed reply-to-all, not via the bugzilla web interface). On Mon, 25 Apr 2011 08:08:36 GMT bugzilla-daemon@...zilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=33902 > > Summary: tcpi_state field in tcp_info structure reports > TCP_CLOSE instead of TCP_TIME_WAIT state > Product: Networking > Version: 2.5 > Kernel Version: 2.6.38 > Platform: All > OS/Version: Linux > Tree: Mainline > Status: NEW > Severity: normal > Priority: P1 > Component: IPV4 > AssignedTo: shemminger@...ux-foundation.org > ReportedBy: Dmitry.Izbitsky@...etlabs.ru > Regression: No > > > Setup - TCP connection in ESTABLISHED state. Local socket calls > shutdown(SHUT_RDWR). After that peer calls shutdown(SHUT_RDWR). > > Local socket should now be in TIME_WAIT state (from specification point > of view). And it's indeed in TIME_WAIT (TCP_TIME_WAIT) state if we look at > /proc/net/tcp (or netstat -t). However, if one tries to get connection state > via tcp_info (getsockopt(TCP_INFO)) the reported state is CLOSED (TCP_CLOSE). > > Looks like the problem is in tcp_time_wait() function > (net/ipv4/tcp_minisocks.c). > It's called with state=TCP_TIME_WAIT, and sets inet_timewaitk_sock > *tw->tw_state field to TCP_TIME_WAIT. That's why the state is reported > correctly when looking into /proc. However, at the end it calls tcp_done(sk), > which itself calls tcp_set_state(TCP_CLOSE), so sk->sk_state is set to > TCP_CLOSE instead of TCP_TIME_WAIT. And it's reported this way via TCP_INFO > socket option. > > Problem is reproduced on 2.6.26, 2.6.38 and is probably observed on earlier > kernels. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists