Bug 1935492
| Summary: | 'tcpstates' delta calculation is wrong when socket address is reused | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | suresh kumar <surkumar> | ||||
| Component: | bcc | Assignee: | Jerome Marchand <jmarchan> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Zhiqian Guan <zhguan> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 8.4 | CC: | jmarchan, jolsa, rdossant, skozina, zhguan | ||||
| Target Milestone: | rc | Keywords: | Triaged | ||||
| Target Release: | --- | Flags: | pm-rhel:
mirror+
|
||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | bcc-0.19.0-2.el8 | Doc Type: | If docs needed, set a value | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2021-11-09 18:13:24 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
suresh kumar
2021-03-05 01:46:03 UTC
Created attachment 1760955 [details]
Possible fix
Looks like we should forget the socket when the connection is closed. Can you try the attached tcpstates script? (In reply to Jerome Marchand from comment #2) > Looks like we should forget the socket when the connection is closed. Can > you try the attached tcpstates script? it works perfectly now: 1 warning generated. SKADDR C-PID C-COMM LADDR LPORT RADDR RPORT OLDSTATE -> NEWSTATE MS ffff94e8dcafc440 0 swapper/0 0.0.0.0 22 0.0.0.0 0 LISTEN -> SYN_RECV 0.000 ffff94e8dcafc440 0 swapper/0 192.168.122.205 22 192.168.122.1 36600 SYN_RECV -> ESTABLISHED 0.007 ffff94e8dcafc440 0 swapper/0 192.168.122.205 22 192.168.122.1 36600 ESTABLISHED -> CLOSE_WAIT 1699.773 ffff94e8dcafc440 6148 sshd 192.168.122.205 22 192.168.122.1 36600 CLOSE_WAIT -> LAST_ACK 1.724 ffff94e8dcafc440 1 systemd 192.168.122.205 22 192.168.122.1 36600 LAST_ACK -> CLOSE 0.116 ffff94e8dcafc440 0 swapper/0 0.0.0.0 22 0.0.0.0 0 LISTEN -> SYN_RECV 0.000 <<<< ffff94e8dcafc440 0 swapper/0 192.168.122.205 22 192.168.122.1 36606 SYN_RECV -> ESTABLISHED 0.007 ffff94e8dcafc440 0 swapper/0 192.168.122.205 22 192.168.122.1 36606 ESTABLISHED -> CLOSE_WAIT 1495.353 ffff94e8dcafc440 6150 sshd 192.168.122.205 22 192.168.122.1 36606 CLOSE_WAIT -> LAST_ACK 1.723 ffff94e8dcafc440 6138 python3 192.168.122.205 22 192.168.122.1 36606 LAST_ACK -> CLOSE 0.109 Pre-verify by using ncat to build connection multiple times, the result looks good [root@netqe3 tools]# uname -r 4.18.0-305.1.el8.x86_64 [root@netqe3 tools]# rpm -q bcc bcc-0.19.0-2.el8.x86_64 [root@netqe3 tools]# [root@netqe3 tools]# ./tcpstates SKADDR C-PID C-COMM LADDR LPORT RADDR RPORT OLDSTATE -> NEWSTATE MS [Other connection output...] ffff8f95050f1380 39262 ncat 192.168.1.2 12530 192.168.1.1 43596 CLOSE_WAIT -> LAST_ACK 0.074 ffff8f95050f1380 0 swapper/46 192.168.1.2 12530 192.168.1.1 43596 LAST_ACK -> CLOSE 0.143 ffff8f9573f26b40 0 swapper/16 0.0.0.0 12530 0.0.0.0 0 LISTEN -> SYN_RECV 0.000 ffff8f9573f26b40 0 swapper/16 192.168.1.2 12530 192.168.1.1 43598 SYN_RECV -> ESTABLISHED 0.004 ffff8f9573f26b40 0 swapper/16 192.168.1.2 12530 192.168.1.1 43598 ESTABLISHED -> CLOSE_WAIT 301.268 ffff8f9573f26b40 39262 ncat 192.168.1.2 12530 192.168.1.1 43598 CLOSE_WAIT -> LAST_ACK 0.075 ffff8f9573f26b40 0 swapper/10 192.168.1.2 12530 192.168.1.1 43598 LAST_ACK -> CLOSE 0.091 ffff8f9574bf3a80 0 swapper/14 0.0.0.0 12530 0.0.0.0 0 LISTEN -> SYN_RECV 0.000 <<<<<<<<<<<<<< MS is from 0 ffff8f9574bf3a80 0 swapper/14 192.168.1.2 12530 192.168.1.1 43600 SYN_RECV -> ESTABLISHED 0.009 ffff8f9574bf3a80 0 swapper/14 192.168.1.2 12530 192.168.1.1 43600 ESTABLISHED -> CLOSE_WAIT 277.749 ffff8f9574bf3a80 0 swapper/14 192.168.1.2 12530 192.168.1.1 43600 LAST_ACK -> CLOSE 0.095 ffff8f9574bf3a80 39262 ncat 192.168.1.2 12530 192.168.1.1 43600 CLOSE_WAIT -> LAST_ACK 0.075 ffff8f9574b94440 0 swapper/6 0.0.0.0 12530 0.0.0.0 0 LISTEN -> SYN_RECV 0.000 ffff8f9574b94440 0 swapper/6 192.168.1.2 12530 192.168.1.1 43602 SYN_RECV -> ESTABLISHED 0.010 ffff8f9574b94440 0 swapper/6 192.168.1.2 12530 192.168.1.1 43602 ESTABLISHED -> CLOSE_WAIT 289.831 ffff8f9574b94440 0 swapper/30 192.168.1.2 12530 192.168.1.1 43602 LAST_ACK -> CLOSE 0.046 [Other connection output...] ffff8f95050f57c0 0 swapper/28 192.168.1.2 12530 192.168.1.1 43618 ESTABLISHED -> CLOSE_WAIT 272.541 ffff8f95050f57c0 39262 ncat 192.168.1.2 12530 192.168.1.1 43618 CLOSE_WAIT -> LAST_ACK 0.074 ffff8f95050f57c0 0 swapper/44 192.168.1.2 12530 192.168.1.1 43618 LAST_ACK -> CLOSE 0.143 ffff8f9574bf3a80 0 swapper/14 0.0.0.0 12530 0.0.0.0 0 LISTEN -> SYN_RECV 0.000 <<<<<<<<<<<<<< Reuse SKADDR ffff8f9574bf3a80, MS still count from 0 ffff8f9574bf3a80 0 swapper/14 192.168.1.2 12530 192.168.1.1 43620 SYN_RECV -> ESTABLISHED 0.009 ffff8f9574bf3a80 0 swapper/14 192.168.1.2 12530 192.168.1.1 43620 ESTABLISHED -> CLOSE_WAIT 287.069 ffff8f9574bf3a80 0 swapper/14 192.168.1.2 12530 192.168.1.1 43620 LAST_ACK -> CLOSE 0.036 ffff8f9574bf3a80 39262 ncat 192.168.1.2 12530 192.168.1.1 43620 CLOSE_WAIT -> LAST_ACK 0.076 ffff8f9574bf1380 0 swapper/14 0.0.0.0 12530 0.0.0.0 0 LISTEN -> SYN_RECV 0.000 ffff8f9574bf1380 0 swapper/14 192.168.1.2 12530 192.168.1.1 43622 SYN_RECV -> ESTABLISHED 0.009 ffff8f9574bf1380 0 swapper/14 192.168.1.2 12530 192.168.1.1 43622 ESTABLISHED -> CLOSE_WAIT 260.303 [...] [root@netqe3 tools]# ./tcpstates SKADDR C-PID C-COMM LADDR LPORT RADDR RPORT OLDSTATE -> NEWSTATE MS ffff8c6797977500 0 swapper/8 0.0.0.0 9904 0.0.0.0 0 LISTEN -> SYN_RECV 0.000 ffff8c6797977500 0 swapper/8 192.168.1.2 9904 192.168.1.1 43296 SYN_RECV -> ESTABLISHED 0.010 ffff8c6797977500 0 swapper/8 192.168.1.2 9904 192.168.1.1 43296 ESTABLISHED -> CLOSE_WAIT 0.031 ffff8c6797977500 0 swapper/40 192.168.1.2 9904 192.168.1.1 43296 LAST_ACK -> CLOSE 0.049 ffff8c6797977500 44175 ncat 192.168.1.2 9904 192.168.1.1 43296 CLOSE_WAIT -> LAST_ACK 0.082 ffff8c67b58c4e00 44175 ncat 192.168.1.2 9904 192.168.1.1 43298 ESTABLISHED -> CLOSE_WAIT 0.040 ffff8c67b58c4e00 44175 ncat 192.168.1.2 9904 192.168.1.1 43298 CLOSE_WAIT -> LAST_ACK 0.015 ffff8c67b58c4e00 0 swapper/46 0.0.0.0 9904 0.0.0.0 0 LISTEN -> SYN_RECV 0.000 <<<<<<< MS from 0 ffff8c67b58c4e00 0 swapper/46 192.168.1.2 9904 192.168.1.1 43298 SYN_RECV -> ESTABLISHED 0.011 ffff8c67b58c4e00 0 swapper/42 192.168.1.2 9904 192.168.1.1 43298 LAST_ACK -> CLOSE 0.032 [other connection...] ffff8c6797b5b0c0 0 swapper/28 0.0.0.0 9904 0.0.0.0 0 LISTEN -> SYN_RECV 0.000 ffff8c6797b5b0c0 0 swapper/28 192.168.1.2 9904 192.168.1.1 43338 SYN_RECV -> ESTABLISHED 0.011 ffff8c6797b5b0c0 0 swapper/28 192.168.1.2 9904 192.168.1.1 43338 ESTABLISHED -> CLOSE_WAIT 0.031 ffff8c6797b5b0c0 0 swapper/22 192.168.1.2 9904 192.168.1.1 43338 LAST_ACK -> CLOSE 0.032 ffff8c6797b5b0c0 44175 ncat 192.168.1.2 9904 192.168.1.1 43338 CLOSE_WAIT -> LAST_ACK 0.019 ffff8c67b58c4e00 0 swapper/46 0.0.0.0 9904 0.0.0.0 0 LISTEN -> SYN_RECV 0.000 <<<<<< MS still from 0 for the same SKADDR ffff8c67b58c4e00 0 swapper/46 192.168.1.2 9904 192.168.1.1 43340 SYN_RECV -> ESTABLISHED 0.011 ffff8c67b58c4e00 0 swapper/46 192.168.1.2 9904 192.168.1.1 43340 ESTABLISHED -> CLOSE_WAIT 0.039 ffff8c67b58c4e00 44175 ncat 192.168.1.2 9904 192.168.1.1 43340 CLOSE_WAIT -> LAST_ACK 0.013 ffff8c67b58c4e00 0 swapper/42 192.168.1.2 9904 192.168.1.1 43340 LAST_ACK -> CLOSE 0.036 ^C[root@netqe3 tools]# uname -r 4.18.0-305.6.el8.x86_64 [root@netqe3 tools]# rpm -q bcc bcc-0.19.0-2.el8.x86_64 [root@netqe3 tools]# Base on comment11, set this to VERIFIED Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (bcc bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:4205 |