Young Xiao
9609dad263
ipv4: tcp_input: fix stack out of bounds when parsing TCP options.
...
The TCP option parsing routines in tcp_parse_options function could
read one byte out of the buffer of the TCP options.
1 while (length > 0) {
2 int opcode = *ptr++;
3 int opsize;
4
5 switch (opcode) {
6 case TCPOPT_EOL:
7 return;
8 case TCPOPT_NOP: /* Ref: RFC 793 section 3.1 */
9 length--;
10 continue;
11 default:
12 opsize = *ptr++; //out of bound access
If length = 1, then there is an access in line2.
And another access is occurred in line 12.
This would lead to out-of-bound access.
Therefore, in the patch we check that the available data length is
larger enough to pase both TCP option code and size.
Signed-off-by: Young Xiao <92siuyang@gmail.com >
Signed-off-by: Eric Dumazet <edumazet@google.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2019-05-30 12:32:47 -07:00
..
2019-05-21 12:33:38 -07:00
2019-05-23 14:45:36 -07:00
2019-04-19 14:07:40 -07:00
2019-05-21 10:50:45 +02:00
2018-10-12 09:47:39 -07:00
2019-05-21 11:28:45 +02:00
2018-10-02 22:28:17 -07:00
2019-04-27 17:07:21 -04:00
2019-05-02 22:14:21 -04:00
2019-05-21 10:50:45 +02:00
2019-04-27 17:07:21 -04:00
2019-04-03 21:50:20 -07:00
2018-12-30 12:57:04 -08:00
2019-05-05 00:47:16 -07:00
2019-04-03 21:50:20 -07:00
2019-05-21 10:50:45 +02:00
2019-01-22 11:52:17 -08:00
2018-07-03 10:29:26 +09:00
2019-03-02 12:54:35 -08:00
2019-05-22 22:08:06 -07:00
2019-04-08 15:22:40 -07:00
2019-02-12 13:35:57 -05:00
2019-02-26 08:27:05 -08:00
2018-12-24 15:27:56 -08:00
2019-05-21 10:50:45 +02:00
2019-02-08 21:50:15 -08:00
2019-04-08 15:22:40 -07:00
2019-02-26 08:27:05 -08:00
2019-04-08 16:16:47 -07:00
2019-05-05 10:38:04 -07:00
2019-04-01 10:44:58 -07:00
2019-05-21 10:50:45 +02:00
2019-05-25 11:00:50 -07:00
2019-04-27 17:07:21 -04:00
2019-03-06 10:43:06 -08:00
2019-05-02 22:14:21 -04:00
2018-09-26 20:30:55 -07:00
2019-02-01 15:24:13 -08:00
2019-01-26 09:43:03 -08:00
2019-05-07 17:22:09 -07:00
2019-04-27 17:07:21 -04:00
2019-05-21 10:50:46 +02:00
2019-04-08 09:15:17 +02:00
2019-05-21 10:50:45 +02:00
2019-01-28 11:32:58 +01:00
2019-05-21 10:50:45 +02:00
2019-05-19 10:31:10 -07:00
2018-11-30 13:26:54 -08:00
2018-11-08 17:13:08 -08:00
2019-05-21 10:50:45 +02:00
2019-05-19 10:31:10 -07:00
2019-05-05 00:47:16 -07:00
2019-03-19 14:13:01 -07:00
2019-04-25 23:52:29 -04:00
2019-01-24 22:27:27 -08:00
2019-05-21 10:50:45 +02:00
2019-05-16 01:36:13 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-04-11 21:31:03 -07:00
2018-10-10 22:26:00 -07:00
2017-12-20 14:00:25 -05:00
2017-12-13 15:51:12 -05:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-30 12:32:47 -07:00
2019-05-02 22:14:21 -04:00
2019-05-21 10:50:45 +02:00
2019-05-01 11:47:54 -04:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2018-12-15 13:23:02 -08:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2018-09-21 19:37:59 -07:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-15 09:22:41 -07:00
2019-05-21 10:50:45 +02:00
2018-10-28 19:27:21 -07:00
2019-01-17 15:01:08 -08:00
2019-05-01 22:29:56 -04:00
2019-05-21 10:50:45 +02:00
2019-05-19 10:31:10 -07:00
2019-01-17 15:01:08 -08:00
2018-09-04 10:26:30 +02:00
2019-04-08 09:15:28 +02:00
2019-04-30 09:26:13 -04:00
2019-04-23 07:42:20 +02:00
2019-05-21 10:50:45 +02:00