Eric Dumazet
78c4e3d484
tcp: clear saved_syn in tcp_disconnect()
...
[ Upstream commit 17c3060b17
]
In the (very unlikely) case a passive socket becomes a listener,
we do not want to duplicate its saved SYN headers.
This would lead to double frees, use after free, and please hackers and
various fuzzers
Tested:
0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+0 setsockopt(3, IPPROTO_TCP, TCP_SAVE_SYN, [1], 4) = 0
+0 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
+0 bind(3, ..., ...) = 0
+0 listen(3, 5) = 0
+0 < S 0:0(0) win 32972 <mss 1460,nop,wscale 7>
+0 > S. 0:0(0) ack 1 <...>
+.1 < . 1:1(0) ack 1 win 257
+0 accept(3, ..., ...) = 4
+0 connect(4, AF_UNSPEC, ...) = 0
+0 close(3) = 0
+0 bind(4, ..., ...) = 0
+0 listen(4, 5) = 0
+0 < S 0:0(0) win 32972 <mss 1460,nop,wscale 7>
+0 > S. 0:0(0) ack 1 <...>
+.1 < . 1:1(0) ack 1 win 257
Fixes: cd8ae85299
("tcp: provide SYN headers for passive connections")
Signed-off-by: Eric Dumazet <edumazet@google.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2017-05-02 21:19:53 -07:00
..
2016-06-24 10:18:24 -07:00
2016-11-15 07:46:38 +01:00
2015-08-25 13:38:50 -07:00
2015-10-20 06:08:27 -07:00
2017-02-18 16:39:26 +01:00
2015-07-29 22:44:04 -07:00
2016-04-20 15:42:03 +09:00
2016-12-10 19:07:26 +01:00
2017-03-30 09:35:14 +02:00
2015-07-24 22:46:11 -07:00
2015-09-09 14:19:50 -07:00
2017-02-04 09:45:08 +01:00
2016-11-21 10:06:40 +01:00
2016-11-15 07:46:38 +01:00
2015-08-10 14:03:54 -07:00
2016-11-15 07:46:38 +01:00
2015-10-14 06:01:07 -07:00
2017-01-15 13:41:35 +01:00
2016-03-03 15:07:07 -08:00
2015-10-03 04:32:41 -07:00
2015-11-02 22:47:14 -05:00
2015-10-23 05:42:21 -07:00
2015-09-21 16:32:29 -07:00
2015-08-28 13:32:36 -07:00
2015-10-08 04:26:54 -07:00
2016-03-03 15:07:04 -08:00
2016-06-24 10:18:18 -07:00
2015-10-12 19:44:16 -07:00
2015-04-03 12:11:15 -04:00
2016-12-10 19:07:26 +01:00
2017-02-26 11:07:50 +01:00
2016-10-31 04:13:59 -06:00
2016-06-24 10:18:18 -07:00
2016-09-30 10:18:36 +02:00
2015-04-03 12:11:15 -04:00
2015-10-18 19:23:52 -07:00
2015-12-18 16:07:59 -05:00
2016-11-15 07:46:37 +01:00
2015-08-27 15:42:48 -07:00
2015-10-21 07:00:48 -07:00
2015-09-29 20:21:32 +02:00
2017-04-30 05:49:29 +02:00
2015-07-21 22:36:33 -07:00
2014-09-19 17:15:31 -04:00
2016-03-03 15:07:06 -08:00
2017-05-02 21:19:52 -07:00
2015-10-23 05:42:21 -07:00
2016-11-15 07:46:38 +01:00
2015-07-09 14:22:52 -07:00
2015-07-09 14:22:52 -07:00
2015-09-25 13:00:38 -07:00
2015-09-17 22:35:07 -07:00
2016-11-21 10:06:39 +01:00
2015-11-15 18:36:38 -05:00
2017-02-04 09:45:09 +01:00
2015-07-09 14:22:52 -07:00
2015-07-09 14:22:52 -07:00
2015-07-09 14:22:52 -07:00
2015-07-09 14:22:52 -07:00
2017-03-30 09:35:14 +02:00
2017-03-22 12:04:17 +01:00
2015-02-12 18:54:10 -08:00
2016-04-20 15:41:56 +09:00
2017-03-30 09:35:14 +02:00
2015-06-11 16:33:10 -07:00
2017-02-18 16:39:26 +01:00
2014-09-01 18:12:45 -07:00
2015-10-21 07:00:53 -07:00
2015-07-09 14:22:52 -07:00
2017-03-22 12:04:15 +01:00
2015-07-09 14:22:52 -07:00
2015-04-29 17:10:38 -04:00
2015-07-09 14:22:52 -07:00
2015-05-05 19:50:09 -04:00
2016-09-30 10:18:34 +02:00
2017-05-02 21:19:53 -07:00
2015-06-15 19:49:22 -07:00
2015-03-02 13:06:31 -05:00
2016-11-15 07:46:38 +01:00
2016-04-20 15:41:56 +09:00
2016-11-15 07:46:39 +01:00
2015-09-17 17:18:37 -07:00
2015-03-25 14:07:04 -04:00
2015-10-24 06:54:12 -07:00
2015-12-22 16:26:31 -05:00
2014-06-30 07:49:47 +02:00