Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Am i affected by Middlebox ?? cpaasch suggested to use Tracebox (but how do i know ?) #83

Closed
AnsEMU opened this issue May 31, 2015 · 9 comments
Labels

Comments

@AnsEMU
Copy link

AnsEMU commented May 31, 2015

I am using eth0 and wlan0
These are my results :
root@ENES:/home/enes/tracebox# tracebox -n -p IP/TCP/MSS/MPCAPABLE/WSCALE bahn.de
tracebox to 81.200.198.6 (bahn.de): 64 hops max
1: 10.10.0.1 [PARTIAL]
2: 193.140.41.10 IP::TTL IP::CheckSum
3: 81.200.198.6 TCP::SrcPort TCP::DstPort TCP::SeqNumber TCP::AckNumber TCP::DataOffset TCP::Flags TCP::CheckSum IP::TotalLength IP::Identification IP::TTL IP::CheckSum IP::SourceIP IP::DestinationIP -TCPOptionMPTCPCapable TCPOptionWindowScale::Shift
Could not store results on server: Timeout was reached
???
-note: this webpage https://amiusingmptcp.com/ tells me NO !!
-i followed every single step here http://multipath-tcp.org/pmwiki.php/Users/AptRepository with the routing stuff.
But can't identify why MPTCP doesn’t work ???
Help please

@obonaventure
Copy link
Contributor

On 31/05/15 23:30, AnsEMU wrote:

I am using eth0 and wlan0

I suggest that you first try on eth0 to do the following :

  • start tcpdump on eth0 (you need a recent version of tcpdump that
    understands MPTCP, wireshark is an alternative)
  • do telnet www.multipath-tcp.org 80
  • verify in the packet capture if the MP_CAPABLE option was
    set in the SYN segment. If yes, it indicates that MPTCP has been
    installed. If not, check your kernel
  • Check in the SYN+ACK segment whether it contains the MP_CAPABLE
    option. If not, then you are behind a proxy or middlebox that blocks MPTCP

If you have issues with tracebox, please post them on
https://github.com/tracebox/tracebox/issues

OB

@AnsEMU
Copy link
Author

AnsEMU commented May 31, 2015

how to do the step after : telnet www.multipath-tcp.org 80 ???

@obonaventure
Copy link
Contributor

On 31/05/15 23:46, AnsEMU wrote:

how to do the step after : telnet www.multipath-tcp.org
http://www.multipath-tcp.org 80 ???

You can type

GET / HTTP/1.0

but only the SYN segments are important and you will see them in the
tcpdump output

OB

@AnsEMU
Copy link
Author

AnsEMU commented May 31, 2015

here what i did---> in one terminal i wrote : telnet www.multipath-tcp.org 80
in another one : tcpdump -n -i any port 80
so i got :
root@ENES:/home/enes# tcpdump -n -i any port 80
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 65535 bytes
00:49:02.606324 IP 10.10.0.203.56589 > 185.31.17.130.80: Flags [.], ack 4011085763, win 952, options [nop,nop,TS val 145248 ecr 1843566279], length 0
00:49:02.607309 IP 185.31.17.130.80 > 10.10.0.203.56589: Flags [.], ack 1, win 5422, options [nop,nop,TS val 1843567280 ecr 125215], length 0
00:49:02.926328 IP 10.10.0.203.44494 > 216.58.209.10.80: Flags [.], ack 378464243, win 758, options [nop,nop,TS val 145328 ecr 1843566311], length 0
00:49:02.926555 IP 216.58.209.10.80 > 10.10.0.203.44494: Flags [.], ack 1, win 3216, options [nop,nop,TS val 1843567312 ecr 122794], length 0
00:49:03.022325 IP 10.10.0.203.57793 > 173.194.78.95.80: Flags [.], ack 3925979620, win 251, options [nop,nop,TS val 145352 ecr 1843566320], length 0
00:49:03.022335 IP 10.10.0.203.57794 > 173.194.78.95.80: Flags [.], ack 1173108500, win 240, options [nop,nop,TS val 145352 ecr 1843566320], length 0
00:49:03.022556 IP 173.194.78.95.80 > 10.10.0.203.57793: Flags [.], ack 1, win 3216, options [nop,nop,TS val 1843567322 ecr 122817], length 0
00:49:03.022567 IP 173.194.78.95.80 > 10.10.0.203.57794: Flags [.], ack 1, win 3216, options [nop,nop,TS val 1843567322 ecr 122817], length 0
00:49:03.150327 IP 10.10.0.203.56598 > 185.31.17.130.80: Flags [.], ack 2664454212, win 296, options [nop,nop,TS val 145384 ecr 1843566333], length 0
00:49:03.150550 IP 185.31.17.130.80 > 10.10.0.203.56598: Flags [.], ack 1, win 3267, options [nop,nop,TS val 1843567335 ecr 125354], length 0
00:49:03.246325 IP 10.10.0.203.59503 > 216.58.208.110.80: Flags [.], ack 2801110747, win 237, options [nop,nop,TS val 145408 ecr 1843566343], length 0
00:49:03.249803 IP 216.58.208.110.80 > 10.10.0.203.59503: Flags [.], ack 1, win 5792, options [nop,nop,TS val 1843567345 ecr 125379], length 0
00:49:03.550328 IP 10.10.0.203.56590 > 185.31.17.130.80: Flags [.], ack 3918269091, win 1594, options [nop,nop,TS val 145484 ecr 1843566373], length 0
00:49:03.550647 IP 185.31.17.130.80 > 10.10.0.203.56590: Flags [.], ack 1, win 5595, options [nop,nop,TS val 1843567375 ecr 125454], length 0
00:49:03.822327 IP 10.10.0.203.56597 > 185.31.17.130.80: Flags [.], ack 517787162, win 338, options [nop,nop,TS val 145552 ecr 1843566400], length 0
00:49:03.822988 IP 185.31.17.130.80 > 10.10.0.203.56597: Flags [.], ack 1, win 3216, options [nop,nop,TS val 1843567402 ecr 125522], length 0
00:49:05.486333 IP 10.10.0.203.56600 > 185.31.17.130.80: Flags [.], ack 386210979, win 523, options [nop,nop,TS val 145968 ecr 1843566567], length 0
00:49:05.486556 IP 185.31.17.130.80 > 10.10.0.203.56600: Flags [.], ack 1, win 3550, options [nop,nop,TS val 1843567568 ecr 125936], length 0
00:49:05.870330 IP 10.10.0.203.37526 > 23.235.33.134.80: Flags [.], ack 1020797553, win 335, options [nop,nop,TS val 146064 ecr 1843566605], length 0
00:49:05.870554 IP 23.235.33.134.80 > 10.10.0.203.37526: Flags [.], ack 1, win 5332, options [nop,nop,TS val 1843567607 ecr 126029], length 0
00:49:09.350919 IP 10.10.0.203.35710 > 130.104.230.45.80: Flags [S], seq 1493066402, win 29200, options [mss 1460,sackOK,TS val 146934 ecr 0,nop,wscale 7,mptcp capable csum {0x60e5e3b93eecd86e}], length 0
00:49:09.351232 IP 130.104.230.45.80 > 10.10.0.203.35710: Flags [S.], seq 2098932791, ack 1493066403, win 5792, options [mss 1460,sackOK,TS val 1843567955 ecr 146934,nop,wscale 1], length 0
00:49:09.351248 IP 10.10.0.203.35710 > 130.104.230.45.80: Flags [.], ack 1, win 229, options [nop,nop,TS val 146934 ecr 1843567955], length 0
00:49:12.622328 IP 10.10.0.203.56589 > 185.31.17.130.80: Flags [.], ack 1, win 952, options [nop,nop,TS val 147752 ecr 1843567280], length 0
00:49:12.622759 IP 185.31.17.130.80 > 10.10.0.203.56589: Flags [.], ack 1, win 5422, options [nop,nop,TS val 1843568282 ecr 125215], length 0
00:49:12.942328 IP 10.10.0.203.44494 > 216.58.209.10.80: Flags [.], ack 1, win 758, options [nop,nop,TS val 147832 ecr 1843567312], length 0
00:49:12.942555 IP 216.58.209.10.80 > 10.10.0.203.44494: Flags [.], ack 1, win 3216, options [nop,nop,TS val 1843568314 ecr 122794], length 0
00:49:13.038329 IP 10.10.0.203.57793 > 173.194.78.95.80: Flags [.], ack 1, win 251, options [nop,nop,TS val 147856 ecr 1843567322], length 0
00:49:13.038340 IP 10.10.0.203.57794 > 173.194.78.95.80: Flags [.], ack 1, win 240, options [nop,nop,TS val 147856 ecr 1843567322], length 0
00:49:13.038552 IP 173.194.78.95.80 > 10.10.0.203.57793: Flags [.], ack 1, win 3216, options [nop,nop,TS val 1843568324 ecr 122817], length 0
00:49:13.038563 IP 173.194.78.95.80 > 10.10.0.203.57794: Flags [.], ack 1, win 3216, options [nop,nop,TS val 1843568324 ecr 122817], length 0
00:49:13.166327 IP 10.10.0.203.56598 > 185.31.17.130.80: Flags [.], ack 1, win 296, options [nop,nop,TS val 147888 ecr 1843567335], length 0
00:49:13.167049 IP 185.31.17.130.80 > 10.10.0.203.56598: Flags [.], ack 1, win 3267, options [nop,nop,TS val 1843568336 ecr 125354], length 0
00:49:13.262329 IP 10.10.0.203.59503 > 216.58.208.110.80: Flags [.], ack 1, win 237, options [nop,nop,TS val 147912 ecr 1843567345], length 0
00:49:13.262577 IP 216.58.208.110.80 > 10.10.0.203.59503: Flags [.], ack 1, win 5792, options [nop,nop,TS val 1843568346 ecr 125379], length 0
00:49:13.566331 IP 10.10.0.203.56590 > 185.31.17.130.80: Flags [.], ack 1, win 1594, options [nop,nop,TS val 147988 ecr 1843567375], length 0
00:49:13.566548 IP 185.31.17.130.80 > 10.10.0.203.56590: Flags [.], ack 1, win 5595, options [nop,nop,TS val 1843568376 ecr 125454], length 0
00:49:13.838325 IP 10.10.0.203.56597 > 185.31.17.130.80: Flags [.], ack 1, win 338, options [nop,nop,TS val 148056 ecr 1843567402], length 0
00:49:13.838521 IP 185.31.17.130.80 > 10.10.0.203.56597: Flags [.], ack 1, win 3216, options [nop,nop,TS val 1843568404 ecr 125522], length 0
00:49:14.351591 IP 10.10.0.203.35710 > 130.104.230.45.80: Flags [F.], seq 1, ack 1, win 229, options [nop,nop,TS val 148184 ecr 1843567955], length 0
00:49:14.351867 IP 130.104.230.45.80 > 10.10.0.203.35710: Flags [.], ack 2, win 2896, options [nop,nop,TS val 1843568455 ecr 148184], length 0
00:49:14.351885 IP 130.104.230.45.80 > 10.10.0.203.35710: Flags [F.], seq 1, ack 2, win 2896, options [nop,nop,TS val 1843568455 ecr 148184], length 0
00:49:14.351897 IP 10.10.0.203.35710 > 130.104.230.45.80: Flags [.], ack 2, win 229, options [nop,nop,TS val 148184 ecr 1843568455], length 0
00:49:15.502332 IP 10.10.0.203.56600 > 185.31.17.130.80: Flags [.], ack 1, win 523, options [nop,nop,TS val 148472 ecr 1843567568], length 0
00:49:15.502556 IP 185.31.17.130.80 > 10.10.0.203.56600: Flags [.], ack 1, win 3550, options [nop,nop,TS val 1843568570 ecr 125936], length 0
00:49:15.886328 IP 10.10.0.203.37526 > 23.235.33.134.80: Flags [.], ack 1, win 335, options [nop,nop,TS val 148568 ecr 1843567607], length 0
00:49:15.886558 IP 23.235.33.134.80 > 10.10.0.203.37526: Flags [.], ack 1, win 5332, options [nop,nop,TS val 1843568608 ecr 126029], length 0
00:49:18.336211 IP 130.104.230.45.80 > 10.10.0.203.35709: Flags [F.], seq 1120587448, ack 3846713681, win 2896, options [nop,nop,TS val 1843568853 ecr 143892], length 0
00:49:18.336402 IP 10.10.0.203.35709 > 130.104.230.45.80: Flags [F.], seq 1, ack 1, win 229, options [nop,nop,TS val 149180 ecr 1843568853], length 0
00:49:18.336698 IP 130.104.230.45.80 > 10.10.0.203.35709: Flags [.], ack 2, win 2896, options [nop,nop,TS val 1843568853 ecr 149180], length 0
00:49:22.638335 IP 10.10.0.203.56589 > 185.31.17.130.80: Flags [.], ack 1, win 952, options [nop,nop,TS val 150256 ecr 1843568282], length 0
00:49:22.638624 IP 185.31.17.130.80 > 10.10.0.203.56589: Flags [.], ack 1, win 5422, options [nop,nop,TS val 1843569284 ecr 125215], length 0
00:49:22.958327 IP 10.10.0.203.44494 > 216.58.209.10.80: Flags [.], ack 1, win 758, options [nop,nop,TS val 150336 ecr 1843568314], length 0
00:49:22.958535 IP 216.58.209.10.80 > 10.10.0.203.44494: Flags [.], ack 1, win 3216, options [nop,nop,TS val 1843569316 ecr 122794], length 0
00:49:23.054357 IP 10.10.0.203.57793 > 173.194.78.95.80: Flags [.], ack 1, win 251, options [nop,nop,TS val 150360 ecr 1843568324], length 0
00:49:23.054381 IP 10.10.0.203.57794 > 173.194.78.95.80: Flags [.], ack 1, win 240, options [nop,nop,TS val 150360 ecr 1843568324], length 0
00:49:23.055020 IP 173.194.78.95.80 > 10.10.0.203.57794: Flags [.], ack 1, win 3216, options [nop,nop,TS val 1843569325 ecr 122817], length 0
00:49:23.055047 IP 173.194.78.95.80 > 10.10.0.203.57793: Flags [.], ack 1, win 3216, options [nop,nop,TS val 1843569325 ecr 122817], length 0
00:49:23.182421 IP 10.10.0.203.56598 > 185.31.17.130.80: Flags [.], ack 1, win 296, options [nop,nop,TS val 150392 ecr 1843568336], length 0
00:49:23.182640 IP 185.31.17.130.80 > 10.10.0.203.56598: Flags [.], ack 1, win 3267, options [nop,nop,TS val 1843569338 ecr 125354], length 0
00:49:23.278369 IP 10.10.0.203.59503 > 216.58.208.110.80: Flags [.], ack 1, win 237, options [nop,nop,TS val 150416 ecr 1843568346], length 0
00:49:23.278823 IP 216.58.208.110.80 > 10.10.0.203.59503: Flags [.], ack 1, win 5792, options [nop,nop,TS val 1843569348 ecr 125379], length 0
00:49:23.582353 IP 10.10.0.203.56590 > 185.31.17.130.80: Flags [.], ack 1, win 1594, options [nop,nop,TS val 150492 ecr 1843568376], length 0
00:49:23.582578 IP 185.31.17.130.80 > 10.10.0.203.56590: Flags [.], ack 1, win 5595, options [nop,nop,TS val 1843569378 ecr 125454], length 0
00:49:23.854391 IP 10.10.0.203.56597 > 185.31.17.130.80: Flags [.], ack 1, win 338, options [nop,nop,TS val 150560 ecr 1843568404], length 0
00:49:23.854667 IP 185.31.17.130.80 > 10.10.0.203.56597: Flags [.], ack 1, win 3216, options [nop,nop,TS val 1843569405 ecr 125522], length 0
00:49:25.518337 IP 10.10.0.203.56600 > 185.31.17.130.80: Flags [.], ack 1, win 523, options [nop,nop,TS val 150976 ecr 1843568570], length 0
00:49:25.518550 IP 185.31.17.130.80 > 10.10.0.203.56600: Flags [.], ack 1, win 3550, options [nop,nop,TS val 1843569572 ecr 125936], length 0
00:49:25.902357 IP 10.10.0.203.37526 > 23.235.33.134.80: Flags [.], ack 1, win 335, options [nop,nop,TS val 151072 ecr 1843568608], length 0
00:49:25.902607 IP 23.235.33.134.80 > 10.10.0.203.37526: Flags [.], ack 1, win 5332, options [nop,nop,TS val 1843569610 ecr 126029], length 0
00:49:28.352855 IP 10.10.0.203.44494 > 216.58.209.10.80: Flags [F.], seq 1, ack 1, win 758, options [nop,nop,TS val 151684 ecr 1843569316], length 0
00:49:28.352944 IP 10.10.0.203.57793 > 173.194.78.95.80: Flags [F.], seq 1, ack 1, win 251, options [nop,nop,TS val 151684 ecr 1843569325], length 0
00:49:28.352996 IP 10.10.0.203.57794 > 173.194.78.95.80: Flags [F.], seq 1, ack 1, win 240, options [nop,nop,TS val 151684 ecr 1843569325], length 0
00:49:28.353198 IP 216.58.209.10.80 > 10.10.0.203.44494: Flags [.], ack 2, win 3216, options [nop,nop,TS val 1843569855 ecr 151684], length 0
00:49:28.353242 IP 173.194.78.95.80 > 10.10.0.203.57793: Flags [.], ack 2, win 3216, options [nop,nop,TS val 1843569855 ecr 151684], length 0
00:49:28.353251 IP 216.58.209.10.80 > 10.10.0.203.44494: Flags [F.], seq 1, ack 2, win 3216, options [nop,nop,TS val 1843569855 ecr 151684], length 0
00:49:28.353280 IP 10.10.0.203.44494 > 216.58.209.10.80: Flags [.], ack 2, win 758, options [nop,nop,TS val 151684 ecr 1843569855], length 0
00:49:28.353287 IP 173.194.78.95.80 > 10.10.0.203.57793: Flags [F.], seq 1, ack 2, win 3216, options [nop,nop,TS val 1843569855 ecr 151684], length 0
00:49:28.353295 IP 10.10.0.203.57793 > 173.194.78.95.80: Flags [.], ack 2, win 251, options [nop,nop,TS val 151684 ecr 1843569855], length 0
00:49:28.353300 IP 173.194.78.95.80 > 10.10.0.203.57794: Flags [.], ack 2, win 3216, options [nop,nop,TS val 1843569855 ecr 151684], length 0
00:49:28.353308 IP 173.194.78.95.80 > 10.10.0.203.57794: Flags [F.], seq 1, ack 2, win 3216, options [nop,nop,TS val 1843569855 ecr 151684], length 0
00:49:28.353315 IP 10.10.0.203.57794 > 173.194.78.95.80: Flags [.], ack 2, win 240, options [nop,nop,TS val 151684 ecr 1843569855], length 0
00:49:32.654402 IP 10.10.0.203.56589 > 185.31.17.130.80: Flags [.], ack 1, win 952, options [nop,nop,TS val 152760 ecr 1843569284], length 0
00:49:32.654912 IP 185.31.17.130.80 > 10.10.0.203.56589: Flags [.], ack 1, win 5422, options [nop,nop,TS val 1843570285 ecr 125215], length 0
00:49:33.198375 IP 10.10.0.203.56598 > 185.31.17.130.80: Flags [.], ack 1, win 296, options [nop,nop,TS val 152896 ecr 1843569338], length 0
00:49:33.223255 IP 185.31.17.130.80 > 10.10.0.203.56598: Flags [.], ack 1, win 3267, options [nop,nop,TS val 1843570342 ecr 125354], length 0
00:49:33.294391 IP 10.10.0.203.59503 > 216.58.208.110.80: Flags [.], ack 1, win 237, options [nop,nop,TS val 152920 ecr 1843569348], length 0
00:49:33.331923 IP 216.58.208.110.80 > 10.10.0.203.59503: Flags [.], ack 1, win 5792, options [nop,nop,TS val 1843570353 ecr 125379], length 0
00:49:33.598412 IP 10.10.0.203.56590 > 185.31.17.130.80: Flags [.], ack 1, win 1594, options [nop,nop,TS val 152996 ecr 1843569378], length 0
00:49:33.598640 IP 185.31.17.130.80 > 10.10.0.203.56590: Flags [.], ack 1, win 5595, options [nop,nop,TS val 1843570380 ecr 125454], length 0
00:49:33.870420 IP 10.10.0.203.56597 > 185.31.17.130.80: Flags [.], ack 1, win 338, options [nop,nop,TS val 153064 ecr 1843569405], length 0
00:49:33.870658 IP 185.31.17.130.80 > 10.10.0.203.56597: Flags [.], ack 1, win 3216, options [nop,nop,TS val 1843570407 ecr 125522], length 0
00:49:35.534403 IP 10.10.0.203.56600 > 185.31.17.130.80: Flags [.], ack 1, win 523, options [nop,nop,TS val 153480 ecr 1843569572], length 0
00:49:35.534699 IP 185.31.17.130.80 > 10.10.0.203.56600: Flags [.], ack 1, win 3550, options [nop,nop,TS val 1843570573 ecr 125936], length 0
00:49:35.918358 IP 10.10.0.203.37526 > 23.235.33.134.80: Flags [.], ack 1, win 335, options [nop,nop,TS val 153576 ecr 1843569610], length 0
00:49:35.918592 IP 23.235.33.134.80 > 10.10.0.203.37526: Flags [.], ack 1, win 5332, options [nop,nop,TS val 1843570612 ecr 126029], length 0
00:49:38.352748 IP 10.10.0.203.56589 > 185.31.17.130.80: Flags [F.], seq 1, ack 1, win 952, options [nop,nop,TS val 154184 ecr 1843570285], length 0
00:49:38.352779 IP 10.10.0.203.59503 > 216.58.208.110.80: Flags [F.], seq 1, ack 1, win 237, options [nop,nop,TS val 154184 ecr 1843570353], length 0
00:49:38.352792 IP 10.10.0.203.56598 > 185.31.17.130.80: Flags [F.], seq 1, ack 1, win 296, options [nop,nop,TS val 154184 ecr 1843570342], length 0
00:49:38.353029 IP 185.31.17.130.80 > 10.10.0.203.56589: Flags [.], ack 2, win 5422, options [nop,nop,TS val 1843570855 ecr 154184], length 0
00:49:38.353074 IP 185.31.17.130.80 > 10.10.0.203.56598: Flags [.], ack 2, win 3267, options [nop,nop,TS val 1843570855 ecr 154184], length 0
00:49:38.353084 IP 185.31.17.130.80 > 10.10.0.203.56589: Flags [F.], seq 1, ack 2, win 5422, options [nop,nop,TS val 1843570855 ecr 154184], length 0
00:49:38.353113 IP 10.10.0.203.56589 > 185.31.17.130.80: Flags [.], ack 2, win 952, options [nop,nop,TS val 154184 ecr 1843570855], length 0
00:49:38.353121 IP 216.58.208.110.80 > 10.10.0.203.59503: Flags [.], ack 2, win 5792, options [nop,nop,TS val 1843570855 ecr 154184], length 0
00:49:38.353129 IP 185.31.17.130.80 > 10.10.0.203.56598: Flags [F.], seq 1, ack 2, win 3267, options [nop,nop,TS val 1843570855 ecr 154184], length 0
00:49:38.353137 IP 10.10.0.203.56598 > 185.31.17.130.80: Flags [.], ack 2, win 296, options [nop,nop,TS val 154184 ecr 1843570855], length 0
00:49:38.353141 IP 216.58.208.110.80 > 10.10.0.203.59503: Flags [F.], seq 1, ack 2, win 5792, options [nop,nop,TS val 1843570855 ecr 154184], length 0
00:49:38.353148 IP 10.10.0.203.59503 > 216.58.208.110.80: Flags [.], ack 2, win 237, options [nop,nop,TS val 154184 ecr 1843570855], length 0
00:49:39.353080 IP 10.10.0.203.56597 > 185.31.17.130.80: Flags [F.], seq 1, ack 1, win 338, options [nop,nop,TS val 154434 ecr 1843570407], length 0
00:49:39.353156 IP 10.10.0.203.56590 > 185.31.17.130.80: Flags [F.], seq 1, ack 1, win 1594, options [nop,nop,TS val 154434 ecr 1843570380], length 0
00:49:39.353409 IP 185.31.17.130.80 > 10.10.0.203.56597: Flags [.], ack 2, win 3216, options [nop,nop,TS val 1843570955 ecr 154434], length 0
00:49:39.353457 IP 185.31.17.130.80 > 10.10.0.203.56597: Flags [F.], seq 1, ack 2, win 3216, options [nop,nop,TS val 1843570955 ecr 154434], length 0
00:49:39.353488 IP 10.10.0.203.56597 > 185.31.17.130.80: Flags [.], ack 2, win 338, options [nop,nop,TS val 154434 ecr 1843570955], length 0
00:49:39.353497 IP 185.31.17.130.80 > 10.10.0.203.56590: Flags [.], ack 2, win 5595, options [nop,nop,TS val 1843570955 ecr 154434], length 0
00:49:39.353509 IP 185.31.17.130.80 > 10.10.0.203.56590: Flags [F.], seq 1, ack 2, win 5595, options [nop,nop,TS val 1843570955 ecr 154434], length 0
00:49:39.353517 IP 10.10.0.203.56590 > 185.31.17.130.80: Flags [.], ack 2, win 1594, options [nop,nop,TS val 154434 ecr 1843570955], length 0
00:49:41.354090 IP 10.10.0.203.37526 > 23.235.33.134.80: Flags [F.], seq 1, ack 1, win 335, options [nop,nop,TS val 154934 ecr 1843570612], length 0
00:49:41.354180 IP 10.10.0.203.56600 > 185.31.17.130.80: Flags [F.], seq 1, ack 1, win 523, options [nop,nop,TS val 154934 ecr 1843570573], length 0
00:49:41.354373 IP 23.235.33.134.80 > 10.10.0.203.37526: Flags [.], ack 2, win 5332, options [nop,nop,TS val 1843571155 ecr 154934], length 0
00:49:41.354429 IP 23.235.33.134.80 > 10.10.0.203.37526: Flags [F.], seq 1, ack 2, win 5332, options [nop,nop,TS val 1843571155 ecr 154934], length 0
00:49:41.354473 IP 10.10.0.203.37526 > 23.235.33.134.80: Flags [.], ack 2, win 335, options [nop,nop,TS val 154935 ecr 1843571155], length 0
00:49:41.354484 IP 185.31.17.130.80 > 10.10.0.203.56600: Flags [.], ack 2, win 3550, options [nop,nop,TS val 1843571155 ecr 154934], length 0
00:49:41.354498 IP 185.31.17.130.80 > 10.10.0.203.56600: Flags [F.], seq 1, ack 2, win 3550, options [nop,nop,TS val 1843571155 ecr 154934], length 0
00:49:41.354519 IP 10.10.0.203.56600 > 185.31.17.130.80: Flags [.], ack 2, win 523, options [nop,nop,TS val 154935 ecr 1843571155], length 0
^Z
[1]+ Stopped tcpdump -n -i any port 80
root@ENES:/home/enes#

@AnsEMU
Copy link
Author

AnsEMU commented May 31, 2015

what is the command for tcpdump out ???

@AnsEMU
Copy link
Author

AnsEMU commented May 31, 2015

these are the results when i connect to ftp.multipath-tcp.org and download 1GB :
root@ENES:/home/enes# tcpdump -c 50 -i eth0
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
01:18:25.112712 ARP, Request who-has 10.10.0.141 tell 10.10.0.219, length 46
01:18:25.113879 ARP, Request who-has 10.10.1.189 tell 10.10.1.93, length 46
01:18:25.122463 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 4254795775:4254798511, ack 1152864243, win 227, options [nop,nop,TS val 207497627 ecr 585859], length 2736
01:18:25.122548 IP 10.10.0.203.49101 > mptcp.info.ucl.ac.be.49999: Flags [.], ack 2736, win 42698, options [nop,nop,TS val 585877 ecr 207497620], length 0
01:18:25.122645 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 2736:4104, ack 1, win 227, options [nop,nop,TS val 207497627 ecr 585859], length 1368
01:18:25.122763 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 4104:5472, ack 1, win 227, options [nop,nop,TS val 207497627 ecr 585859], length 1368
01:18:25.122791 IP 10.10.0.203.49101 > mptcp.info.ucl.ac.be.49999: Flags [.], ack 5472, win 42966, options [nop,nop,TS val 585877 ecr 207497627], length 0
01:18:25.126051 IP 10.10.1.172.57187 > 255.255.255.255.2008: UDP, length 13
01:18:25.126099 IP 10.10.1.172.57187 > 255.255.255.255.2007: UDP, length 13
01:18:25.132929 ARP, Request who-has 10.10.0.143 tell 10.10.0.219, length 46
01:18:25.134167 ARP, Request who-has 10.10.1.122 tell 10.10.1.63, length 46
01:18:25.137685 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 5472:8208, ack 1, win 227, options [nop,nop,TS val 207497631 ecr 585863], length 2736
01:18:25.137807 IP 10.10.0.203.49101 > mptcp.info.ucl.ac.be.49999: Flags [.], ack 8208, win 42966, options [nop,nop,TS val 585880 ecr 207497631], length 0
01:18:25.139729 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 8208:9576, ack 1, win 227, options [nop,nop,TS val 207497632 ecr 585863], length 1368
01:18:25.139845 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 9576:10944, ack 1, win 227, options [nop,nop,TS val 207497632 ecr 585863], length 1368
01:18:25.139868 IP 10.10.0.203.49101 > mptcp.info.ucl.ac.be.49999: Flags [.], ack 10944, win 42966, options [nop,nop,TS val 585881 ecr 207497632], length 0
01:18:25.139968 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 10944:12312, ack 1, win 227, options [nop,nop,TS val 207497632 ecr 585863], length 1368
01:18:25.140093 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 12312:13680, ack 1, win 227, options [nop,nop,TS val 207497632 ecr 585863], length 1368
01:18:25.140110 IP 10.10.0.203.49101 > mptcp.info.ucl.ac.be.49999: Flags [.], ack 13680, win 42966, options [nop,nop,TS val 585881 ecr 207497632], length 0
01:18:25.140317 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 13680:16416, ack 1, win 227, options [nop,nop,TS val 207497632 ecr 585863], length 2736
01:18:25.140376 IP 10.10.0.203.49101 > mptcp.info.ucl.ac.be.49999: Flags [.], ack 16416, win 42966, options [nop,nop,TS val 585881 ecr 207497632], length 0
01:18:25.140565 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 16416:17784, ack 1, win 227, options [nop,nop,TS val 207497632 ecr 585863], length 1368
01:18:25.140846 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [P.], seq 17784:19152, ack 1, win 227, options [nop,nop,TS val 207497632 ecr 585863], length 1368
01:18:25.140866 IP 10.10.0.203.49101 > mptcp.info.ucl.ac.be.49999: Flags [.], ack 19152, win 42966, options [nop,nop,TS val 585881 ecr 207497632], length 0
01:18:25.141917 ARP, Request who-has 10.10.0.1 tell 10.10.0.249, length 46
01:18:25.142823 ARP, Request who-has 10.10.0.144 tell 10.10.0.219, length 46
01:18:25.161879 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 19152:21888, ack 1, win 227, options [nop,nop,TS val 207497637 ecr 585869], length 2736
01:18:25.161978 IP 10.10.0.203.49101 > mptcp.info.ucl.ac.be.49999: Flags [.], ack 21888, win 42966, options [nop,nop,TS val 585886 ecr 207497637], length 0
01:18:25.162003 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 21888:23256, ack 1, win 227, options [nop,nop,TS val 207497637 ecr 585869], length 1368
01:18:25.162254 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 23256:24624, ack 1, win 227, options [nop,nop,TS val 207497637 ecr 585869], length 1368
01:18:25.162266 IP 10.10.0.203.49101 > mptcp.info.ucl.ac.be.49999: Flags [.], ack 24624, win 42966, options [nop,nop,TS val 585886 ecr 207497637], length 0
01:18:25.162357 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 24624:25992, ack 1, win 227, options [nop,nop,TS val 207497637 ecr 585869], length 1368
01:18:25.162532 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 25992:27360, ack 1, win 227, options [nop,nop,TS val 207497637 ecr 585869], length 1368
01:18:25.162567 IP 10.10.0.203.49101 > mptcp.info.ucl.ac.be.49999: Flags [.], ack 27360, win 42966, options [nop,nop,TS val 585887 ecr 207497637], length 0
01:18:25.176318 ARP, Request who-has 10.10.0.147 tell 10.10.0.219, length 46
01:18:25.178919 ARP, Request who-has 10.10.1.152 tell 10.10.1.138, length 46
01:18:25.179566 ARP, Request who-has 10.10.1.153 tell 10.10.1.138, length 46
01:18:25.186101 ARP, Request who-has 10.10.0.148 tell 10.10.0.219, length 46
01:18:25.190999 IP 10.10.1.142.57952 > 255.255.255.255.2008: UDP, length 30
01:18:25.191044 IP 10.10.1.142.57952 > 255.255.255.255.2007: UDP, length 30
01:18:25.191708 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 27360:28728, ack 1, win 227, options [nop,nop,TS val 207497645 ecr 585877], length 1368
01:18:25.191840 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 28728:30096, ack 1, win 227, options [nop,nop,TS val 207497645 ecr 585877], length 1368
01:18:25.191860 IP 10.10.0.203.49101 > mptcp.info.ucl.ac.be.49999: Flags [.], ack 30096, win 42966, options [nop,nop,TS val 585894 ecr 207497645], length 0
01:18:25.192006 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 30096:31464, ack 1, win 227, options [nop,nop,TS val 207497645 ecr 585877], length 1368
01:18:25.192176 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 31464:32832, ack 1, win 227, options [nop,nop,TS val 207497645 ecr 585877], length 1368
01:18:25.192211 IP 10.10.0.203.49101 > mptcp.info.ucl.ac.be.49999: Flags [.], ack 32832, win 42966, options [nop,nop,TS val 585894 ecr 207497645], length 0
01:18:25.192469 IP6 fe80::2505:58ec:1efa:a81f.dhcpv6-client > ff02::1:2.dhcpv6-server: dhcp6 solicit
01:18:25.195957 ARP, Request who-has 10.10.0.149 tell 10.10.0.219, length 46
01:18:25.205859 ARP, Request who-has 10.10.0.150 tell 10.10.0.219, length 46
01:18:25.206458 IP mptcp.info.ucl.ac.be.49999 > 10.10.0.203.49101: Flags [.], seq 32832:35568, ack 1, win 227, options [nop,nop,TS val 207497648 ecr 585880], length 2736
50 packets captured
1770 packets received by filter
0 packets dropped by kernel
root@ENES:/home/enes#

nothing such MP_CAPABLE !! any further help ??

@obonaventure
Copy link
Contributor

On 31/05/15 23:30, AnsEMU wrote:

I am using eth0 and wlan0
These are my results :
root@ENES:/home/enes/tracebox# tracebox -n -p
IP/TCP/MSS/MPCAPABLE/WSCALE bahn.de
tracebox to 81.200.198.6 (bahn.de): 64 hops max
1: 10.10.0.1 [PARTIAL]
2: 193.140.41.10 IP::TTL IP::CheckSum
3: 81.200.198.6 TCP::SrcPort TCP::DstPort TCP::SeqNumber TCP::AckNumber
TCP::DataOffset TCP::Flags TCP::CheckSum IP::TotalLength
IP::Identification IP::TTL IP::CheckSum IP::SourceIP IP::DestinationIP
-TCPOptionMPTCPCapable TCPOptionWindowScale::Shift

You have a proxy on your path because you receive the answer at the
third hop while the destination is farther in the network.

You should try

tracebox -n -p IP/TCP/MSS/MPCAPABLE multipath-tcp.org

Apparently, 193.140.41.10 belongs to a university, you should contact
your network administrator to see the type of firewall that they have
deployed

@obonaventure
Copy link
Contributor

Hello,

here what i did---> in one terminal i wrote : telnet
www.multipath-tcp.org http://www.multipath-tcp.org 80
in another one : tcpdump -n -i any port 80
so i got :
root@ENES:/home/enes# tcpdump -n -i any port 80
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 65535
bytes
00:49:02.606324 IP 10.10.0.203.56589 > 185.31.17.130.80: Flags [.], ack
4011085763, win 952, options [nop,nop,TS val 145248 ecr 1843566279],
length 0

It seems that the kernel that you use is not mptcp capable

OB

@cpaasch
Copy link
Member

cpaasch commented Jun 14, 2015

Closing

@cpaasch cpaasch closed this as completed Jun 14, 2015
dreibh pushed a commit to dreibh/mptcp that referenced this issue Apr 30, 2018
[ Upstream commit 7dd07c1 ]

Since neigh_dump_table() calls nlmsg_parse() without giving policy
constraints, attributes can have arbirary size that we must validate

Reported by syzbot/KMSAN :

BUG: KMSAN: uninit-value in neigh_master_filtered net/core/neighbour.c:2292 [inline]
BUG: KMSAN: uninit-value in neigh_dump_table net/core/neighbour.c:2348 [inline]
BUG: KMSAN: uninit-value in neigh_dump_info+0x1af0/0x2250 net/core/neighbour.c:2438
CPU: 1 PID: 3575 Comm: syzkaller268891 Not tainted 4.16.0+ multipath-tcp#83
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x185/0x1d0 lib/dump_stack.c:53
 kmsan_report+0x142/0x240 mm/kmsan/kmsan.c:1067
 __msan_warning_32+0x6c/0xb0 mm/kmsan/kmsan_instr.c:676
 neigh_master_filtered net/core/neighbour.c:2292 [inline]
 neigh_dump_table net/core/neighbour.c:2348 [inline]
 neigh_dump_info+0x1af0/0x2250 net/core/neighbour.c:2438
 netlink_dump+0x9ad/0x1540 net/netlink/af_netlink.c:2225
 __netlink_dump_start+0x1167/0x12a0 net/netlink/af_netlink.c:2322
 netlink_dump_start include/linux/netlink.h:214 [inline]
 rtnetlink_rcv_msg+0x1435/0x1560 net/core/rtnetlink.c:4598
 netlink_rcv_skb+0x355/0x5f0 net/netlink/af_netlink.c:2447
 rtnetlink_rcv+0x50/0x60 net/core/rtnetlink.c:4653
 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline]
 netlink_unicast+0x1672/0x1750 net/netlink/af_netlink.c:1337
 netlink_sendmsg+0x1048/0x1310 net/netlink/af_netlink.c:1900
 sock_sendmsg_nosec net/socket.c:630 [inline]
 sock_sendmsg net/socket.c:640 [inline]
 ___sys_sendmsg+0xec0/0x1310 net/socket.c:2046
 __sys_sendmsg net/socket.c:2080 [inline]
 SYSC_sendmsg+0x2a3/0x3d0 net/socket.c:2091
 SyS_sendmsg+0x54/0x80 net/socket.c:2087
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2
RIP: 0033:0x43fed9
RSP: 002b:00007ffddbee2798 EFLAGS: 00000213 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 000000000043fed9
RDX: 0000000000000000 RSI: 0000000020005000 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 00000000004002c8 R09: 00000000004002c8
R10: 00000000004002c8 R11: 0000000000000213 R12: 0000000000401800
R13: 0000000000401890 R14: 0000000000000000 R15: 0000000000000000

Uninit was created at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:278 [inline]
 kmsan_internal_poison_shadow+0xb8/0x1b0 mm/kmsan/kmsan.c:188
 kmsan_kmalloc+0x94/0x100 mm/kmsan/kmsan.c:314
 kmsan_slab_alloc+0x11/0x20 mm/kmsan/kmsan.c:321
 slab_post_alloc_hook mm/slab.h:445 [inline]
 slab_alloc_node mm/slub.c:2737 [inline]
 __kmalloc_node_track_caller+0xaed/0x11c0 mm/slub.c:4369
 __kmalloc_reserve net/core/skbuff.c:138 [inline]
 __alloc_skb+0x2cf/0x9f0 net/core/skbuff.c:206
 alloc_skb include/linux/skbuff.h:984 [inline]
 netlink_alloc_large_skb net/netlink/af_netlink.c:1183 [inline]
 netlink_sendmsg+0x9a6/0x1310 net/netlink/af_netlink.c:1875
 sock_sendmsg_nosec net/socket.c:630 [inline]
 sock_sendmsg net/socket.c:640 [inline]
 ___sys_sendmsg+0xec0/0x1310 net/socket.c:2046
 __sys_sendmsg net/socket.c:2080 [inline]
 SYSC_sendmsg+0x2a3/0x3d0 net/socket.c:2091
 SyS_sendmsg+0x54/0x80 net/socket.c:2087
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2

Fixes: 21fdd09 ("net: Add support for filtering neigh dump by master device")
Signed-off-by: Eric Dumazet <[email protected]>
Cc: David Ahern <[email protected]>
Reported-by: syzbot <[email protected]>
Acked-by: David Ahern <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
dreibh pushed a commit to dreibh/mptcp that referenced this issue Apr 30, 2018
[ Upstream commit 7212303 ]

syzbot/KMSAN reported an uninit-value in tcp_parse_options() [1]

I believe this was caused by a TCP_MD5SIG being set on live
flow.

This is highly unexpected, since TCP option space is limited.

For instance, presence of TCP MD5 option automatically disables
TCP TimeStamp option at SYN/SYNACK time, which we can not do
once flow has been established.

Really, adding/deleting an MD5 key only makes sense on sockets
in CLOSE or LISTEN state.

[1]
BUG: KMSAN: uninit-value in tcp_parse_options+0xd74/0x1a30 net/ipv4/tcp_input.c:3720
CPU: 1 PID: 6177 Comm: syzkaller192004 Not tainted 4.16.0+ multipath-tcp#83
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x185/0x1d0 lib/dump_stack.c:53
 kmsan_report+0x142/0x240 mm/kmsan/kmsan.c:1067
 __msan_warning_32+0x6c/0xb0 mm/kmsan/kmsan_instr.c:676
 tcp_parse_options+0xd74/0x1a30 net/ipv4/tcp_input.c:3720
 tcp_fast_parse_options net/ipv4/tcp_input.c:3858 [inline]
 tcp_validate_incoming+0x4f1/0x2790 net/ipv4/tcp_input.c:5184
 tcp_rcv_established+0xf60/0x2bb0 net/ipv4/tcp_input.c:5453
 tcp_v4_do_rcv+0x6cd/0xd90 net/ipv4/tcp_ipv4.c:1469
 sk_backlog_rcv include/net/sock.h:908 [inline]
 __release_sock+0x2d6/0x680 net/core/sock.c:2271
 release_sock+0x97/0x2a0 net/core/sock.c:2786
 tcp_sendmsg+0xd6/0x100 net/ipv4/tcp.c:1464
 inet_sendmsg+0x48d/0x740 net/ipv4/af_inet.c:764
 sock_sendmsg_nosec net/socket.c:630 [inline]
 sock_sendmsg net/socket.c:640 [inline]
 SYSC_sendto+0x6c3/0x7e0 net/socket.c:1747
 SyS_sendto+0x8a/0xb0 net/socket.c:1715
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2
RIP: 0033:0x448fe9
RSP: 002b:00007fd472c64d38 EFLAGS: 00000216 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 00000000006e5a30 RCX: 0000000000448fe9
RDX: 000000000000029f RSI: 0000000020a88f88 RDI: 0000000000000004
RBP: 00000000006e5a34 R08: 0000000020e68000 R09: 0000000000000010
R10: 00000000200007fd R11: 0000000000000216 R12: 0000000000000000
R13: 00007fff074899ef R14: 00007fd472c659c0 R15: 0000000000000009

Uninit was created at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:278 [inline]
 kmsan_internal_poison_shadow+0xb8/0x1b0 mm/kmsan/kmsan.c:188
 kmsan_kmalloc+0x94/0x100 mm/kmsan/kmsan.c:314
 kmsan_slab_alloc+0x11/0x20 mm/kmsan/kmsan.c:321
 slab_post_alloc_hook mm/slab.h:445 [inline]
 slab_alloc_node mm/slub.c:2737 [inline]
 __kmalloc_node_track_caller+0xaed/0x11c0 mm/slub.c:4369
 __kmalloc_reserve net/core/skbuff.c:138 [inline]
 __alloc_skb+0x2cf/0x9f0 net/core/skbuff.c:206
 alloc_skb include/linux/skbuff.h:984 [inline]
 tcp_send_ack+0x18c/0x910 net/ipv4/tcp_output.c:3624
 __tcp_ack_snd_check net/ipv4/tcp_input.c:5040 [inline]
 tcp_ack_snd_check net/ipv4/tcp_input.c:5053 [inline]
 tcp_rcv_established+0x2103/0x2bb0 net/ipv4/tcp_input.c:5469
 tcp_v4_do_rcv+0x6cd/0xd90 net/ipv4/tcp_ipv4.c:1469
 sk_backlog_rcv include/net/sock.h:908 [inline]
 __release_sock+0x2d6/0x680 net/core/sock.c:2271
 release_sock+0x97/0x2a0 net/core/sock.c:2786
 tcp_sendmsg+0xd6/0x100 net/ipv4/tcp.c:1464
 inet_sendmsg+0x48d/0x740 net/ipv4/af_inet.c:764
 sock_sendmsg_nosec net/socket.c:630 [inline]
 sock_sendmsg net/socket.c:640 [inline]
 SYSC_sendto+0x6c3/0x7e0 net/socket.c:1747
 SyS_sendto+0x8a/0xb0 net/socket.c:1715
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2

Fixes: cfb6eeb ("[TCP]: MD5 Signature Option (RFC2385) support.")
Signed-off-by: Eric Dumazet <[email protected]>
Reported-by: syzbot <[email protected]>
Acked-by: Yuchung Cheng <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
dreibh pushed a commit to dreibh/mptcp that referenced this issue Apr 30, 2018
[ Upstream commit 5171b37 ]

In order to remove the race caught by syzbot [1], we need
to lock the socket before using po->tp_version as this could
change under us otherwise.

This means lock_sock() and release_sock() must be done by
packet_set_ring() callers.

[1] :
BUG: KMSAN: uninit-value in packet_set_ring+0x1254/0x3870 net/packet/af_packet.c:4249
CPU: 0 PID: 20195 Comm: syzkaller707632 Not tainted 4.16.0+ multipath-tcp#83
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x185/0x1d0 lib/dump_stack.c:53
 kmsan_report+0x142/0x240 mm/kmsan/kmsan.c:1067
 __msan_warning_32+0x6c/0xb0 mm/kmsan/kmsan_instr.c:676
 packet_set_ring+0x1254/0x3870 net/packet/af_packet.c:4249
 packet_setsockopt+0x12c6/0x5a90 net/packet/af_packet.c:3662
 SYSC_setsockopt+0x4b8/0x570 net/socket.c:1849
 SyS_setsockopt+0x76/0xa0 net/socket.c:1828
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2
RIP: 0033:0x449099
RSP: 002b:00007f42b5307ce8 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 000000000070003c RCX: 0000000000449099
RDX: 0000000000000005 RSI: 0000000000000107 RDI: 0000000000000003
RBP: 0000000000700038 R08: 000000000000001c R09: 0000000000000000
R10: 00000000200000c0 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000080eecf R14: 00007f42b53089c0 R15: 0000000000000001

Local variable description: ----req_u@packet_setsockopt
Variable was created at:
 packet_setsockopt+0x13f/0x5a90 net/packet/af_packet.c:3612
 SYSC_setsockopt+0x4b8/0x570 net/socket.c:1849

Fixes: f6fb8f1 ("af-packet: TPACKET_V3 flexible buffer implementation.")
Signed-off-by: Eric Dumazet <[email protected]>
Reported-by: syzbot <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
dreibh pushed a commit to dreibh/mptcp that referenced this issue Apr 30, 2018
[ Upstream commit 5171b37 ]

In order to remove the race caught by syzbot [1], we need
to lock the socket before using po->tp_version as this could
change under us otherwise.

This means lock_sock() and release_sock() must be done by
packet_set_ring() callers.

[1] :
BUG: KMSAN: uninit-value in packet_set_ring+0x1254/0x3870 net/packet/af_packet.c:4249
CPU: 0 PID: 20195 Comm: syzkaller707632 Not tainted 4.16.0+ multipath-tcp#83
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x185/0x1d0 lib/dump_stack.c:53
 kmsan_report+0x142/0x240 mm/kmsan/kmsan.c:1067
 __msan_warning_32+0x6c/0xb0 mm/kmsan/kmsan_instr.c:676
 packet_set_ring+0x1254/0x3870 net/packet/af_packet.c:4249
 packet_setsockopt+0x12c6/0x5a90 net/packet/af_packet.c:3662
 SYSC_setsockopt+0x4b8/0x570 net/socket.c:1849
 SyS_setsockopt+0x76/0xa0 net/socket.c:1828
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2
RIP: 0033:0x449099
RSP: 002b:00007f42b5307ce8 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 000000000070003c RCX: 0000000000449099
RDX: 0000000000000005 RSI: 0000000000000107 RDI: 0000000000000003
RBP: 0000000000700038 R08: 000000000000001c R09: 0000000000000000
R10: 00000000200000c0 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000080eecf R14: 00007f42b53089c0 R15: 0000000000000001

Local variable description: ----req_u@packet_setsockopt
Variable was created at:
 packet_setsockopt+0x13f/0x5a90 net/packet/af_packet.c:3612
 SYSC_setsockopt+0x4b8/0x570 net/socket.c:1849

Fixes: f6fb8f1 ("af-packet: TPACKET_V3 flexible buffer implementation.")
Signed-off-by: Eric Dumazet <[email protected]>
Reported-by: syzbot <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
dreibh pushed a commit to dreibh/mptcp that referenced this issue Apr 30, 2018
[ Upstream commit 7212303 ]

syzbot/KMSAN reported an uninit-value in tcp_parse_options() [1]

I believe this was caused by a TCP_MD5SIG being set on live
flow.

This is highly unexpected, since TCP option space is limited.

For instance, presence of TCP MD5 option automatically disables
TCP TimeStamp option at SYN/SYNACK time, which we can not do
once flow has been established.

Really, adding/deleting an MD5 key only makes sense on sockets
in CLOSE or LISTEN state.

[1]
BUG: KMSAN: uninit-value in tcp_parse_options+0xd74/0x1a30 net/ipv4/tcp_input.c:3720
CPU: 1 PID: 6177 Comm: syzkaller192004 Not tainted 4.16.0+ multipath-tcp#83
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x185/0x1d0 lib/dump_stack.c:53
 kmsan_report+0x142/0x240 mm/kmsan/kmsan.c:1067
 __msan_warning_32+0x6c/0xb0 mm/kmsan/kmsan_instr.c:676
 tcp_parse_options+0xd74/0x1a30 net/ipv4/tcp_input.c:3720
 tcp_fast_parse_options net/ipv4/tcp_input.c:3858 [inline]
 tcp_validate_incoming+0x4f1/0x2790 net/ipv4/tcp_input.c:5184
 tcp_rcv_established+0xf60/0x2bb0 net/ipv4/tcp_input.c:5453
 tcp_v4_do_rcv+0x6cd/0xd90 net/ipv4/tcp_ipv4.c:1469
 sk_backlog_rcv include/net/sock.h:908 [inline]
 __release_sock+0x2d6/0x680 net/core/sock.c:2271
 release_sock+0x97/0x2a0 net/core/sock.c:2786
 tcp_sendmsg+0xd6/0x100 net/ipv4/tcp.c:1464
 inet_sendmsg+0x48d/0x740 net/ipv4/af_inet.c:764
 sock_sendmsg_nosec net/socket.c:630 [inline]
 sock_sendmsg net/socket.c:640 [inline]
 SYSC_sendto+0x6c3/0x7e0 net/socket.c:1747
 SyS_sendto+0x8a/0xb0 net/socket.c:1715
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2
RIP: 0033:0x448fe9
RSP: 002b:00007fd472c64d38 EFLAGS: 00000216 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 00000000006e5a30 RCX: 0000000000448fe9
RDX: 000000000000029f RSI: 0000000020a88f88 RDI: 0000000000000004
RBP: 00000000006e5a34 R08: 0000000020e68000 R09: 0000000000000010
R10: 00000000200007fd R11: 0000000000000216 R12: 0000000000000000
R13: 00007fff074899ef R14: 00007fd472c659c0 R15: 0000000000000009

Uninit was created at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:278 [inline]
 kmsan_internal_poison_shadow+0xb8/0x1b0 mm/kmsan/kmsan.c:188
 kmsan_kmalloc+0x94/0x100 mm/kmsan/kmsan.c:314
 kmsan_slab_alloc+0x11/0x20 mm/kmsan/kmsan.c:321
 slab_post_alloc_hook mm/slab.h:445 [inline]
 slab_alloc_node mm/slub.c:2737 [inline]
 __kmalloc_node_track_caller+0xaed/0x11c0 mm/slub.c:4369
 __kmalloc_reserve net/core/skbuff.c:138 [inline]
 __alloc_skb+0x2cf/0x9f0 net/core/skbuff.c:206
 alloc_skb include/linux/skbuff.h:984 [inline]
 tcp_send_ack+0x18c/0x910 net/ipv4/tcp_output.c:3624
 __tcp_ack_snd_check net/ipv4/tcp_input.c:5040 [inline]
 tcp_ack_snd_check net/ipv4/tcp_input.c:5053 [inline]
 tcp_rcv_established+0x2103/0x2bb0 net/ipv4/tcp_input.c:5469
 tcp_v4_do_rcv+0x6cd/0xd90 net/ipv4/tcp_ipv4.c:1469
 sk_backlog_rcv include/net/sock.h:908 [inline]
 __release_sock+0x2d6/0x680 net/core/sock.c:2271
 release_sock+0x97/0x2a0 net/core/sock.c:2786
 tcp_sendmsg+0xd6/0x100 net/ipv4/tcp.c:1464
 inet_sendmsg+0x48d/0x740 net/ipv4/af_inet.c:764
 sock_sendmsg_nosec net/socket.c:630 [inline]
 sock_sendmsg net/socket.c:640 [inline]
 SYSC_sendto+0x6c3/0x7e0 net/socket.c:1747
 SyS_sendto+0x8a/0xb0 net/socket.c:1715
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2

Fixes: cfb6eeb ("[TCP]: MD5 Signature Option (RFC2385) support.")
Signed-off-by: Eric Dumazet <[email protected]>
Reported-by: syzbot <[email protected]>
Acked-by: Yuchung Cheng <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
dreibh pushed a commit to dreibh/mptcp that referenced this issue Apr 30, 2018
[ Upstream commit 7dd07c1 ]

Since neigh_dump_table() calls nlmsg_parse() without giving policy
constraints, attributes can have arbirary size that we must validate

Reported by syzbot/KMSAN :

BUG: KMSAN: uninit-value in neigh_master_filtered net/core/neighbour.c:2292 [inline]
BUG: KMSAN: uninit-value in neigh_dump_table net/core/neighbour.c:2348 [inline]
BUG: KMSAN: uninit-value in neigh_dump_info+0x1af0/0x2250 net/core/neighbour.c:2438
CPU: 1 PID: 3575 Comm: syzkaller268891 Not tainted 4.16.0+ multipath-tcp#83
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x185/0x1d0 lib/dump_stack.c:53
 kmsan_report+0x142/0x240 mm/kmsan/kmsan.c:1067
 __msan_warning_32+0x6c/0xb0 mm/kmsan/kmsan_instr.c:676
 neigh_master_filtered net/core/neighbour.c:2292 [inline]
 neigh_dump_table net/core/neighbour.c:2348 [inline]
 neigh_dump_info+0x1af0/0x2250 net/core/neighbour.c:2438
 netlink_dump+0x9ad/0x1540 net/netlink/af_netlink.c:2225
 __netlink_dump_start+0x1167/0x12a0 net/netlink/af_netlink.c:2322
 netlink_dump_start include/linux/netlink.h:214 [inline]
 rtnetlink_rcv_msg+0x1435/0x1560 net/core/rtnetlink.c:4598
 netlink_rcv_skb+0x355/0x5f0 net/netlink/af_netlink.c:2447
 rtnetlink_rcv+0x50/0x60 net/core/rtnetlink.c:4653
 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline]
 netlink_unicast+0x1672/0x1750 net/netlink/af_netlink.c:1337
 netlink_sendmsg+0x1048/0x1310 net/netlink/af_netlink.c:1900
 sock_sendmsg_nosec net/socket.c:630 [inline]
 sock_sendmsg net/socket.c:640 [inline]
 ___sys_sendmsg+0xec0/0x1310 net/socket.c:2046
 __sys_sendmsg net/socket.c:2080 [inline]
 SYSC_sendmsg+0x2a3/0x3d0 net/socket.c:2091
 SyS_sendmsg+0x54/0x80 net/socket.c:2087
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2
RIP: 0033:0x43fed9
RSP: 002b:00007ffddbee2798 EFLAGS: 00000213 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 000000000043fed9
RDX: 0000000000000000 RSI: 0000000020005000 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 00000000004002c8 R09: 00000000004002c8
R10: 00000000004002c8 R11: 0000000000000213 R12: 0000000000401800
R13: 0000000000401890 R14: 0000000000000000 R15: 0000000000000000

Uninit was created at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:278 [inline]
 kmsan_internal_poison_shadow+0xb8/0x1b0 mm/kmsan/kmsan.c:188
 kmsan_kmalloc+0x94/0x100 mm/kmsan/kmsan.c:314
 kmsan_slab_alloc+0x11/0x20 mm/kmsan/kmsan.c:321
 slab_post_alloc_hook mm/slab.h:445 [inline]
 slab_alloc_node mm/slub.c:2737 [inline]
 __kmalloc_node_track_caller+0xaed/0x11c0 mm/slub.c:4369
 __kmalloc_reserve net/core/skbuff.c:138 [inline]
 __alloc_skb+0x2cf/0x9f0 net/core/skbuff.c:206
 alloc_skb include/linux/skbuff.h:984 [inline]
 netlink_alloc_large_skb net/netlink/af_netlink.c:1183 [inline]
 netlink_sendmsg+0x9a6/0x1310 net/netlink/af_netlink.c:1875
 sock_sendmsg_nosec net/socket.c:630 [inline]
 sock_sendmsg net/socket.c:640 [inline]
 ___sys_sendmsg+0xec0/0x1310 net/socket.c:2046
 __sys_sendmsg net/socket.c:2080 [inline]
 SYSC_sendmsg+0x2a3/0x3d0 net/socket.c:2091
 SyS_sendmsg+0x54/0x80 net/socket.c:2087
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2

Fixes: 21fdd09 ("net: Add support for filtering neigh dump by master device")
Signed-off-by: Eric Dumazet <[email protected]>
Cc: David Ahern <[email protected]>
Reported-by: syzbot <[email protected]>
Acked-by: David Ahern <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
cpaasch pushed a commit that referenced this issue May 16, 2018
[ Upstream commit 7dd07c1 ]

Since neigh_dump_table() calls nlmsg_parse() without giving policy
constraints, attributes can have arbirary size that we must validate

Reported by syzbot/KMSAN :

BUG: KMSAN: uninit-value in neigh_master_filtered net/core/neighbour.c:2292 [inline]
BUG: KMSAN: uninit-value in neigh_dump_table net/core/neighbour.c:2348 [inline]
BUG: KMSAN: uninit-value in neigh_dump_info+0x1af0/0x2250 net/core/neighbour.c:2438
CPU: 1 PID: 3575 Comm: syzkaller268891 Not tainted 4.16.0+ #83
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x185/0x1d0 lib/dump_stack.c:53
 kmsan_report+0x142/0x240 mm/kmsan/kmsan.c:1067
 __msan_warning_32+0x6c/0xb0 mm/kmsan/kmsan_instr.c:676
 neigh_master_filtered net/core/neighbour.c:2292 [inline]
 neigh_dump_table net/core/neighbour.c:2348 [inline]
 neigh_dump_info+0x1af0/0x2250 net/core/neighbour.c:2438
 netlink_dump+0x9ad/0x1540 net/netlink/af_netlink.c:2225
 __netlink_dump_start+0x1167/0x12a0 net/netlink/af_netlink.c:2322
 netlink_dump_start include/linux/netlink.h:214 [inline]
 rtnetlink_rcv_msg+0x1435/0x1560 net/core/rtnetlink.c:4598
 netlink_rcv_skb+0x355/0x5f0 net/netlink/af_netlink.c:2447
 rtnetlink_rcv+0x50/0x60 net/core/rtnetlink.c:4653
 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline]
 netlink_unicast+0x1672/0x1750 net/netlink/af_netlink.c:1337
 netlink_sendmsg+0x1048/0x1310 net/netlink/af_netlink.c:1900
 sock_sendmsg_nosec net/socket.c:630 [inline]
 sock_sendmsg net/socket.c:640 [inline]
 ___sys_sendmsg+0xec0/0x1310 net/socket.c:2046
 __sys_sendmsg net/socket.c:2080 [inline]
 SYSC_sendmsg+0x2a3/0x3d0 net/socket.c:2091
 SyS_sendmsg+0x54/0x80 net/socket.c:2087
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2
RIP: 0033:0x43fed9
RSP: 002b:00007ffddbee2798 EFLAGS: 00000213 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 000000000043fed9
RDX: 0000000000000000 RSI: 0000000020005000 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 00000000004002c8 R09: 00000000004002c8
R10: 00000000004002c8 R11: 0000000000000213 R12: 0000000000401800
R13: 0000000000401890 R14: 0000000000000000 R15: 0000000000000000

Uninit was created at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:278 [inline]
 kmsan_internal_poison_shadow+0xb8/0x1b0 mm/kmsan/kmsan.c:188
 kmsan_kmalloc+0x94/0x100 mm/kmsan/kmsan.c:314
 kmsan_slab_alloc+0x11/0x20 mm/kmsan/kmsan.c:321
 slab_post_alloc_hook mm/slab.h:445 [inline]
 slab_alloc_node mm/slub.c:2737 [inline]
 __kmalloc_node_track_caller+0xaed/0x11c0 mm/slub.c:4369
 __kmalloc_reserve net/core/skbuff.c:138 [inline]
 __alloc_skb+0x2cf/0x9f0 net/core/skbuff.c:206
 alloc_skb include/linux/skbuff.h:984 [inline]
 netlink_alloc_large_skb net/netlink/af_netlink.c:1183 [inline]
 netlink_sendmsg+0x9a6/0x1310 net/netlink/af_netlink.c:1875
 sock_sendmsg_nosec net/socket.c:630 [inline]
 sock_sendmsg net/socket.c:640 [inline]
 ___sys_sendmsg+0xec0/0x1310 net/socket.c:2046
 __sys_sendmsg net/socket.c:2080 [inline]
 SYSC_sendmsg+0x2a3/0x3d0 net/socket.c:2091
 SyS_sendmsg+0x54/0x80 net/socket.c:2087
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2

Fixes: 21fdd09 ("net: Add support for filtering neigh dump by master device")
Signed-off-by: Eric Dumazet <[email protected]>
Cc: David Ahern <[email protected]>
Reported-by: syzbot <[email protected]>
Acked-by: David Ahern <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
cpaasch pushed a commit that referenced this issue May 16, 2018
[ Upstream commit 5171b37 ]

In order to remove the race caught by syzbot [1], we need
to lock the socket before using po->tp_version as this could
change under us otherwise.

This means lock_sock() and release_sock() must be done by
packet_set_ring() callers.

[1] :
BUG: KMSAN: uninit-value in packet_set_ring+0x1254/0x3870 net/packet/af_packet.c:4249
CPU: 0 PID: 20195 Comm: syzkaller707632 Not tainted 4.16.0+ #83
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x185/0x1d0 lib/dump_stack.c:53
 kmsan_report+0x142/0x240 mm/kmsan/kmsan.c:1067
 __msan_warning_32+0x6c/0xb0 mm/kmsan/kmsan_instr.c:676
 packet_set_ring+0x1254/0x3870 net/packet/af_packet.c:4249
 packet_setsockopt+0x12c6/0x5a90 net/packet/af_packet.c:3662
 SYSC_setsockopt+0x4b8/0x570 net/socket.c:1849
 SyS_setsockopt+0x76/0xa0 net/socket.c:1828
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2
RIP: 0033:0x449099
RSP: 002b:00007f42b5307ce8 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 000000000070003c RCX: 0000000000449099
RDX: 0000000000000005 RSI: 0000000000000107 RDI: 0000000000000003
RBP: 0000000000700038 R08: 000000000000001c R09: 0000000000000000
R10: 00000000200000c0 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000080eecf R14: 00007f42b53089c0 R15: 0000000000000001

Local variable description: ----req_u@packet_setsockopt
Variable was created at:
 packet_setsockopt+0x13f/0x5a90 net/packet/af_packet.c:3612
 SYSC_setsockopt+0x4b8/0x570 net/socket.c:1849

Fixes: f6fb8f1 ("af-packet: TPACKET_V3 flexible buffer implementation.")
Signed-off-by: Eric Dumazet <[email protected]>
Reported-by: syzbot <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
cpaasch pushed a commit that referenced this issue May 16, 2018
[ Upstream commit 7212303 ]

syzbot/KMSAN reported an uninit-value in tcp_parse_options() [1]

I believe this was caused by a TCP_MD5SIG being set on live
flow.

This is highly unexpected, since TCP option space is limited.

For instance, presence of TCP MD5 option automatically disables
TCP TimeStamp option at SYN/SYNACK time, which we can not do
once flow has been established.

Really, adding/deleting an MD5 key only makes sense on sockets
in CLOSE or LISTEN state.

[1]
BUG: KMSAN: uninit-value in tcp_parse_options+0xd74/0x1a30 net/ipv4/tcp_input.c:3720
CPU: 1 PID: 6177 Comm: syzkaller192004 Not tainted 4.16.0+ #83
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x185/0x1d0 lib/dump_stack.c:53
 kmsan_report+0x142/0x240 mm/kmsan/kmsan.c:1067
 __msan_warning_32+0x6c/0xb0 mm/kmsan/kmsan_instr.c:676
 tcp_parse_options+0xd74/0x1a30 net/ipv4/tcp_input.c:3720
 tcp_fast_parse_options net/ipv4/tcp_input.c:3858 [inline]
 tcp_validate_incoming+0x4f1/0x2790 net/ipv4/tcp_input.c:5184
 tcp_rcv_established+0xf60/0x2bb0 net/ipv4/tcp_input.c:5453
 tcp_v4_do_rcv+0x6cd/0xd90 net/ipv4/tcp_ipv4.c:1469
 sk_backlog_rcv include/net/sock.h:908 [inline]
 __release_sock+0x2d6/0x680 net/core/sock.c:2271
 release_sock+0x97/0x2a0 net/core/sock.c:2786
 tcp_sendmsg+0xd6/0x100 net/ipv4/tcp.c:1464
 inet_sendmsg+0x48d/0x740 net/ipv4/af_inet.c:764
 sock_sendmsg_nosec net/socket.c:630 [inline]
 sock_sendmsg net/socket.c:640 [inline]
 SYSC_sendto+0x6c3/0x7e0 net/socket.c:1747
 SyS_sendto+0x8a/0xb0 net/socket.c:1715
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2
RIP: 0033:0x448fe9
RSP: 002b:00007fd472c64d38 EFLAGS: 00000216 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 00000000006e5a30 RCX: 0000000000448fe9
RDX: 000000000000029f RSI: 0000000020a88f88 RDI: 0000000000000004
RBP: 00000000006e5a34 R08: 0000000020e68000 R09: 0000000000000010
R10: 00000000200007fd R11: 0000000000000216 R12: 0000000000000000
R13: 00007fff074899ef R14: 00007fd472c659c0 R15: 0000000000000009

Uninit was created at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:278 [inline]
 kmsan_internal_poison_shadow+0xb8/0x1b0 mm/kmsan/kmsan.c:188
 kmsan_kmalloc+0x94/0x100 mm/kmsan/kmsan.c:314
 kmsan_slab_alloc+0x11/0x20 mm/kmsan/kmsan.c:321
 slab_post_alloc_hook mm/slab.h:445 [inline]
 slab_alloc_node mm/slub.c:2737 [inline]
 __kmalloc_node_track_caller+0xaed/0x11c0 mm/slub.c:4369
 __kmalloc_reserve net/core/skbuff.c:138 [inline]
 __alloc_skb+0x2cf/0x9f0 net/core/skbuff.c:206
 alloc_skb include/linux/skbuff.h:984 [inline]
 tcp_send_ack+0x18c/0x910 net/ipv4/tcp_output.c:3624
 __tcp_ack_snd_check net/ipv4/tcp_input.c:5040 [inline]
 tcp_ack_snd_check net/ipv4/tcp_input.c:5053 [inline]
 tcp_rcv_established+0x2103/0x2bb0 net/ipv4/tcp_input.c:5469
 tcp_v4_do_rcv+0x6cd/0xd90 net/ipv4/tcp_ipv4.c:1469
 sk_backlog_rcv include/net/sock.h:908 [inline]
 __release_sock+0x2d6/0x680 net/core/sock.c:2271
 release_sock+0x97/0x2a0 net/core/sock.c:2786
 tcp_sendmsg+0xd6/0x100 net/ipv4/tcp.c:1464
 inet_sendmsg+0x48d/0x740 net/ipv4/af_inet.c:764
 sock_sendmsg_nosec net/socket.c:630 [inline]
 sock_sendmsg net/socket.c:640 [inline]
 SYSC_sendto+0x6c3/0x7e0 net/socket.c:1747
 SyS_sendto+0x8a/0xb0 net/socket.c:1715
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2

Fixes: cfb6eeb ("[TCP]: MD5 Signature Option (RFC2385) support.")
Signed-off-by: Eric Dumazet <[email protected]>
Reported-by: syzbot <[email protected]>
Acked-by: Yuchung Cheng <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
cpaasch pushed a commit that referenced this issue Oct 28, 2019
[ Upstream commit 232219b ]

When the kernel is build with lockdep support and the i2c-cht-wc driver is
used, the following warning is shown:

[   66.674334] ======================================================
[   66.674337] WARNING: possible circular locking dependency detected
[   66.674340] 5.3.0-rc4+ #83 Not tainted
[   66.674342] ------------------------------------------------------
[   66.674345] systemd-udevd/1232 is trying to acquire lock:
[   66.674349] 00000000a74dab07 (intel_soc_pmic_chtwc:167:(&cht_wc_regmap_cfg)->lock){+.+.}, at: regmap_write+0x31/0x70
[   66.674360]
               but task is already holding lock:
[   66.674362] 00000000d44a85b7 (i2c_register_adapter){+.+.}, at: i2c_smbus_xfer+0x49/0xf0
[   66.674370]
               which lock already depends on the new lock.

[   66.674371]
               the existing dependency chain (in reverse order) is:
[   66.674374]
               -> #1 (i2c_register_adapter){+.+.}:
[   66.674381]        rt_mutex_lock_nested+0x46/0x60
[   66.674384]        i2c_smbus_xfer+0x49/0xf0
[   66.674387]        i2c_smbus_read_byte_data+0x45/0x70
[   66.674391]        cht_wc_byte_reg_read+0x35/0x50
[   66.674394]        _regmap_read+0x63/0x1a0
[   66.674396]        _regmap_update_bits+0xa8/0xe0
[   66.674399]        regmap_update_bits_base+0x63/0xa0
[   66.674403]        regmap_irq_update_bits.isra.0+0x3b/0x50
[   66.674406]        regmap_add_irq_chip+0x592/0x7a0
[   66.674409]        devm_regmap_add_irq_chip+0x89/0xed
[   66.674412]        cht_wc_probe+0x102/0x158
[   66.674415]        i2c_device_probe+0x95/0x250
[   66.674419]        really_probe+0xf3/0x380
[   66.674422]        driver_probe_device+0x59/0xd0
[   66.674425]        device_driver_attach+0x53/0x60
[   66.674428]        __driver_attach+0x92/0x150
[   66.674431]        bus_for_each_dev+0x7d/0xc0
[   66.674434]        bus_add_driver+0x14d/0x1f0
[   66.674437]        driver_register+0x6d/0xb0
[   66.674440]        i2c_register_driver+0x45/0x80
[   66.674445]        do_one_initcall+0x60/0x2f4
[   66.674450]        kernel_init_freeable+0x20d/0x2b4
[   66.674453]        kernel_init+0xa/0x10c
[   66.674457]        ret_from_fork+0x3a/0x50
[   66.674459]
               -> #0 (intel_soc_pmic_chtwc:167:(&cht_wc_regmap_cfg)->lock){+.+.}:
[   66.674465]        __lock_acquire+0xe07/0x1930
[   66.674468]        lock_acquire+0x9d/0x1a0
[   66.674472]        __mutex_lock+0xa8/0x9a0
[   66.674474]        regmap_write+0x31/0x70
[   66.674480]        cht_wc_i2c_adap_smbus_xfer+0x72/0x240 [i2c_cht_wc]
[   66.674483]        __i2c_smbus_xfer+0x1a3/0x640
[   66.674486]        i2c_smbus_xfer+0x67/0xf0
[   66.674489]        i2c_smbus_read_byte_data+0x45/0x70
[   66.674494]        bq24190_probe+0x26b/0x410 [bq24190_charger]
[   66.674497]        i2c_device_probe+0x189/0x250
[   66.674500]        really_probe+0xf3/0x380
[   66.674503]        driver_probe_device+0x59/0xd0
[   66.674506]        device_driver_attach+0x53/0x60
[   66.674509]        __driver_attach+0x92/0x150
[   66.674512]        bus_for_each_dev+0x7d/0xc0
[   66.674515]        bus_add_driver+0x14d/0x1f0
[   66.674518]        driver_register+0x6d/0xb0
[   66.674521]        i2c_register_driver+0x45/0x80
[   66.674524]        do_one_initcall+0x60/0x2f4
[   66.674528]        do_init_module+0x5c/0x230
[   66.674531]        load_module+0x2707/0x2a20
[   66.674534]        __do_sys_init_module+0x188/0x1b0
[   66.674537]        do_syscall_64+0x5c/0xb0
[   66.674541]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
[   66.674543]
               other info that might help us debug this:

[   66.674545]  Possible unsafe locking scenario:

[   66.674547]        CPU0                    CPU1
[   66.674548]        ----                    ----
[   66.674550]   lock(i2c_register_adapter);
[   66.674553]                                lock(intel_soc_pmic_chtwc:167:(&cht_wc_regmap_cfg)->lock);
[   66.674556]                                lock(i2c_register_adapter);
[   66.674559]   lock(intel_soc_pmic_chtwc:167:(&cht_wc_regmap_cfg)->lock);
[   66.674561]
                *** DEADLOCK ***

The problem is that the CHT Whiskey Cove PMIC's builtin i2c-adapter is
itself a part of an i2c-client (the PMIC). This means that transfers done
through it take adapter->bus_lock twice, once for the parent i2c-adapter
and once for its own bus_lock. Lockdep does not like this nested locking.

To make lockdep happy in the case of busses with muxes, the i2c-core's
i2c_adapter_lock_bus function calls:

 rt_mutex_lock_nested(&adapter->bus_lock, i2c_adapter_depth(adapter));

But i2c_adapter_depth only works when the direct parent of the adapter is
another adapter, as it is only meant for muxes. In this case there is an
i2c-client and MFD instantiated platform_device in the parent->child chain
between the 2 devices.

This commit overrides the default i2c_lock_operations, passing a hardcoded
depth of 1 to rt_mutex_lock_nested, making lockdep happy.

Note that if there were to be a mux attached to the i2c-wc-cht adapter,
this would break things again since the i2c-mux code expects the
root-adapter to have a locking depth of 0. But the i2c-wc-cht adapter
always has only 1 client directly attached in the form of the charger IC
paired with the CHT Whiskey Cove PMIC.

Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
cpaasch pushed a commit that referenced this issue Oct 28, 2019
[ Upstream commit 232219b ]

When the kernel is build with lockdep support and the i2c-cht-wc driver is
used, the following warning is shown:

[   66.674334] ======================================================
[   66.674337] WARNING: possible circular locking dependency detected
[   66.674340] 5.3.0-rc4+ #83 Not tainted
[   66.674342] ------------------------------------------------------
[   66.674345] systemd-udevd/1232 is trying to acquire lock:
[   66.674349] 00000000a74dab07 (intel_soc_pmic_chtwc:167:(&cht_wc_regmap_cfg)->lock){+.+.}, at: regmap_write+0x31/0x70
[   66.674360]
               but task is already holding lock:
[   66.674362] 00000000d44a85b7 (i2c_register_adapter){+.+.}, at: i2c_smbus_xfer+0x49/0xf0
[   66.674370]
               which lock already depends on the new lock.

[   66.674371]
               the existing dependency chain (in reverse order) is:
[   66.674374]
               -> #1 (i2c_register_adapter){+.+.}:
[   66.674381]        rt_mutex_lock_nested+0x46/0x60
[   66.674384]        i2c_smbus_xfer+0x49/0xf0
[   66.674387]        i2c_smbus_read_byte_data+0x45/0x70
[   66.674391]        cht_wc_byte_reg_read+0x35/0x50
[   66.674394]        _regmap_read+0x63/0x1a0
[   66.674396]        _regmap_update_bits+0xa8/0xe0
[   66.674399]        regmap_update_bits_base+0x63/0xa0
[   66.674403]        regmap_irq_update_bits.isra.0+0x3b/0x50
[   66.674406]        regmap_add_irq_chip+0x592/0x7a0
[   66.674409]        devm_regmap_add_irq_chip+0x89/0xed
[   66.674412]        cht_wc_probe+0x102/0x158
[   66.674415]        i2c_device_probe+0x95/0x250
[   66.674419]        really_probe+0xf3/0x380
[   66.674422]        driver_probe_device+0x59/0xd0
[   66.674425]        device_driver_attach+0x53/0x60
[   66.674428]        __driver_attach+0x92/0x150
[   66.674431]        bus_for_each_dev+0x7d/0xc0
[   66.674434]        bus_add_driver+0x14d/0x1f0
[   66.674437]        driver_register+0x6d/0xb0
[   66.674440]        i2c_register_driver+0x45/0x80
[   66.674445]        do_one_initcall+0x60/0x2f4
[   66.674450]        kernel_init_freeable+0x20d/0x2b4
[   66.674453]        kernel_init+0xa/0x10c
[   66.674457]        ret_from_fork+0x3a/0x50
[   66.674459]
               -> #0 (intel_soc_pmic_chtwc:167:(&cht_wc_regmap_cfg)->lock){+.+.}:
[   66.674465]        __lock_acquire+0xe07/0x1930
[   66.674468]        lock_acquire+0x9d/0x1a0
[   66.674472]        __mutex_lock+0xa8/0x9a0
[   66.674474]        regmap_write+0x31/0x70
[   66.674480]        cht_wc_i2c_adap_smbus_xfer+0x72/0x240 [i2c_cht_wc]
[   66.674483]        __i2c_smbus_xfer+0x1a3/0x640
[   66.674486]        i2c_smbus_xfer+0x67/0xf0
[   66.674489]        i2c_smbus_read_byte_data+0x45/0x70
[   66.674494]        bq24190_probe+0x26b/0x410 [bq24190_charger]
[   66.674497]        i2c_device_probe+0x189/0x250
[   66.674500]        really_probe+0xf3/0x380
[   66.674503]        driver_probe_device+0x59/0xd0
[   66.674506]        device_driver_attach+0x53/0x60
[   66.674509]        __driver_attach+0x92/0x150
[   66.674512]        bus_for_each_dev+0x7d/0xc0
[   66.674515]        bus_add_driver+0x14d/0x1f0
[   66.674518]        driver_register+0x6d/0xb0
[   66.674521]        i2c_register_driver+0x45/0x80
[   66.674524]        do_one_initcall+0x60/0x2f4
[   66.674528]        do_init_module+0x5c/0x230
[   66.674531]        load_module+0x2707/0x2a20
[   66.674534]        __do_sys_init_module+0x188/0x1b0
[   66.674537]        do_syscall_64+0x5c/0xb0
[   66.674541]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
[   66.674543]
               other info that might help us debug this:

[   66.674545]  Possible unsafe locking scenario:

[   66.674547]        CPU0                    CPU1
[   66.674548]        ----                    ----
[   66.674550]   lock(i2c_register_adapter);
[   66.674553]                                lock(intel_soc_pmic_chtwc:167:(&cht_wc_regmap_cfg)->lock);
[   66.674556]                                lock(i2c_register_adapter);
[   66.674559]   lock(intel_soc_pmic_chtwc:167:(&cht_wc_regmap_cfg)->lock);
[   66.674561]
                *** DEADLOCK ***

The problem is that the CHT Whiskey Cove PMIC's builtin i2c-adapter is
itself a part of an i2c-client (the PMIC). This means that transfers done
through it take adapter->bus_lock twice, once for the parent i2c-adapter
and once for its own bus_lock. Lockdep does not like this nested locking.

To make lockdep happy in the case of busses with muxes, the i2c-core's
i2c_adapter_lock_bus function calls:

 rt_mutex_lock_nested(&adapter->bus_lock, i2c_adapter_depth(adapter));

But i2c_adapter_depth only works when the direct parent of the adapter is
another adapter, as it is only meant for muxes. In this case there is an
i2c-client and MFD instantiated platform_device in the parent->child chain
between the 2 devices.

This commit overrides the default i2c_lock_operations, passing a hardcoded
depth of 1 to rt_mutex_lock_nested, making lockdep happy.

Note that if there were to be a mux attached to the i2c-wc-cht adapter,
this would break things again since the i2c-mux code expects the
root-adapter to have a locking depth of 0. But the i2c-wc-cht adapter
always has only 1 client directly attached in the form of the charger IC
paired with the CHT Whiskey Cove PMIC.

Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants