Eric Dumazet
10ec9472f0
ipv4: fix buffer overflow in ip_options_compile()
...
There is a benign buffer overflow in ip_options_compile spotted by
AddressSanitizer[1] :
Its benign because we always can access one extra byte in skb->head
(because header is followed by struct skb_shared_info), and in this case
this byte is not even used.
[28504.910798] ==================================================================
[28504.912046] AddressSanitizer: heap-buffer-overflow in ip_options_compile
[28504.913170] Read of size 1 by thread T15843:
[28504.914026] [<ffffffff81802f91>] ip_options_compile+0x121/0x9c0
[28504.915394] [<ffffffff81804a0d>] ip_options_get_from_user+0xad/0x120
[28504.916843] [<ffffffff8180dedf>] do_ip_setsockopt.isra.15+0x8df/0x1630
[28504.918175] [<ffffffff8180ec60>] ip_setsockopt+0x30/0xa0
[28504.919490] [<ffffffff8181e59b>] tcp_setsockopt+0x5b/0x90
[28504.920835] [<ffffffff8177462f>] sock_common_setsockopt+0x5f/0x70
[28504.922208] [<ffffffff817729c2>] SyS_setsockopt+0xa2/0x140
[28504.923459] [<ffffffff818cfb69>] system_call_fastpath+0x16/0x1b
[28504.924722]
[28504.925106] Allocated by thread T15843:
[28504.925815] [<ffffffff81804995>] ip_options_get_from_user+0x35/0x120
[28504.926884] [<ffffffff8180dedf>] do_ip_setsockopt.isra.15+0x8df/0x1630
[28504.927975] [<ffffffff8180ec60>] ip_setsockopt+0x30/0xa0
[28504.929175] [<ffffffff8181e59b>] tcp_setsockopt+0x5b/0x90
[28504.930400] [<ffffffff8177462f>] sock_common_setsockopt+0x5f/0x70
[28504.931677] [<ffffffff817729c2>] SyS_setsockopt+0xa2/0x140
[28504.932851] [<ffffffff818cfb69>] system_call_fastpath+0x16/0x1b
[28504.934018]
[28504.934377] The buggy address ffff880026382828 is located 0 bytes to the right
[28504.934377] of 40-byte region [ffff880026382800, ffff880026382828)
[28504.937144]
[28504.937474] Memory state around the buggy address:
[28504.938430] ffff880026382300: ........ rrrrrrrr rrrrrrrr rrrrrrrr
[28504.939884] ffff880026382400: ffffffff rrrrrrrr rrrrrrrr rrrrrrrr
[28504.941294] ffff880026382500: .....rrr rrrrrrrr rrrrrrrr rrrrrrrr
[28504.942504] ffff880026382600: ffffffff rrrrrrrr rrrrrrrr rrrrrrrr
[28504.943483] ffff880026382700: ffffffff rrrrrrrr rrrrrrrr rrrrrrrr
[28504.944511] >ffff880026382800: .....rrr rrrrrrrr rrrrrrrr rrrrrrrr
[28504.945573] ^
[28504.946277] ffff880026382900: ffffffff rrrrrrrr rrrrrrrr rrrrrrrr
[28505.094949] ffff880026382a00: ffffffff rrrrrrrr rrrrrrrr rrrrrrrr
[28505.096114] ffff880026382b00: ffffffff rrrrrrrr rrrrrrrr rrrrrrrr
[28505.097116] ffff880026382c00: ffffffff rrrrrrrr rrrrrrrr rrrrrrrr
[28505.098472] ffff880026382d00: ffffffff rrrrrrrr rrrrrrrr rrrrrrrr
[28505.099804] Legend:
[28505.100269] f - 8 freed bytes
[28505.100884] r - 8 redzone bytes
[28505.101649] . - 8 allocated bytes
[28505.102406] x=1..7 - x allocated bytes + (8-x) redzone bytes
[28505.103637] ==================================================================
[1] https://code.google.com/p/address-sanitizer/wiki/AddressSanitizerForKernel
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-21 20:16:26 -07:00
..
2014-05-30 17:54:47 -07:00
2014-07-16 14:45:26 -07:00
2014-02-25 07:04:17 +01:00
2014-01-02 00:08:38 -05:00
2013-12-26 13:43:21 -05:00
2014-06-11 15:39:18 -07:00
2014-05-18 21:10:29 -04:00
2014-02-25 07:04:17 +01:00
2014-04-16 15:05:11 -04:00
2013-12-28 17:01:46 -05:00
2013-12-10 17:54:23 -05:00
2014-05-07 17:14:32 -04:00
2014-06-04 15:11:41 -07:00
2014-07-11 13:53:39 -07:00
2014-07-16 14:45:26 -07:00
2014-07-07 17:22:57 -07:00
2014-07-07 21:30:55 -07:00
2014-05-14 15:31:45 -04:00
2014-01-13 22:35:46 -08:00
2014-03-06 15:28:45 -05:00
2014-05-14 16:07:23 -04:00
2013-12-29 16:34:25 -05:00
2013-10-08 23:19:24 -04:00
2014-06-12 14:27:40 -07:00
2014-05-12 14:03:41 -04:00
2014-05-05 16:02:59 +02:00
2014-06-10 22:46:42 -07:00
2014-01-27 16:22:11 -08:00
2014-07-21 20:16:26 -07:00
2014-06-02 11:00:41 -07:00
2014-02-26 15:51:00 -05:00
2014-06-04 22:46:38 -07:00
2014-07-08 19:35:09 -07:00
2014-06-11 00:30:52 -07:00
2014-02-25 07:04:17 +01:00
2014-02-14 00:14:23 -05:00
2014-06-11 16:02:55 -07:00
2014-06-02 11:00:41 -07:00
2013-09-03 21:41:43 -04:00
2014-02-25 07:04:16 +01:00
2014-02-19 11:41:25 +01:00
2014-05-08 22:50:47 -04:00
2014-05-07 16:06:05 -04:00
2013-11-28 18:47:51 -05:00
2014-06-02 11:00:41 -07:00
2014-06-30 23:40:58 -07:00
2014-05-13 18:35:09 -04:00
2014-05-14 15:31:45 -04:00
2014-05-03 19:23:07 -04:00
2014-05-03 19:23:07 -04:00
2014-05-12 13:19:14 -04:00
2014-06-16 21:35:00 -07:00
2014-05-03 19:23:07 -04:00
2014-05-03 19:23:07 -04:00
2014-05-03 19:23:07 -04:00
2014-05-03 19:23:07 -04:00
2014-07-07 21:40:48 -07:00
2014-05-13 18:35:09 -04:00
2014-05-03 19:23:07 -04:00
2014-05-13 12:16:21 -04:00
2014-06-05 00:49:51 -07:00
2014-05-13 17:53:02 -04:00
2014-07-16 14:45:26 -07:00
2014-07-07 21:40:48 -07:00
2014-02-26 17:08:40 -05:00
2014-05-03 19:23:07 -04:00
2014-03-03 15:58:03 -05:00
2014-05-03 19:23:07 -04:00
2013-10-19 19:12:11 -04:00
2014-05-03 19:23:07 -04:00
2014-02-13 18:22:34 -05:00
2014-05-03 19:23:07 -04:00
2014-07-02 18:21:03 -07:00
2012-03-11 23:42:51 -07:00
2013-04-19 14:57:56 -04:00
2013-10-19 19:12:11 -04:00
2014-06-11 15:46:13 -07:00
2014-06-27 00:20:55 -07:00
2014-05-23 16:28:53 -04:00
2014-02-25 07:04:16 +01:00
2013-12-26 13:43:21 -05:00
2014-06-02 11:00:41 -07:00
2014-05-24 00:32:30 -04:00
2014-03-14 07:28:07 +01:00
2014-04-29 08:41:12 +02:00
2013-12-18 16:58:20 -05:00
2013-05-31 17:19:05 -07:00