David Ahern
e671f1cc58
vrf: Fix use-after-free in vrf_xmit
[ Upstream commit f7887d40e5 ]
KASAN detected a use-after-free:
[ 269.467067] BUG: KASAN: use-after-free in vrf_xmit+0x7f1/0x827 [vrf] at addr ffff8800350a21c0
[ 269.467067] Read of size 4 by task ssh/1879
[ 269.467067] CPU: 1 PID: 1879 Comm: ssh Not tainted 4.10.0+ #249
[ 269.467067] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
[ 269.467067] Call Trace:
[ 269.467067] dump_stack+0x81/0xb6
[ 269.467067] kasan_object_err+0x21/0x78
[ 269.467067] kasan_report+0x2f7/0x450
[ 269.467067] ? vrf_xmit+0x7f1/0x827 [vrf]
[ 269.467067] ? ip_output+0xa4/0xdb
[ 269.467067] __asan_load4+0x6b/0x6d
[ 269.467067] vrf_xmit+0x7f1/0x827 [vrf]
...
Which corresponds to the skb access after xmit handling. Fix by saving
skb->len and using the saved value to update stats.
Fixes: 193125dbd8 ("net: Introduce VRF device driver")
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-22 12:04:16 +01:00
..
2017-03-18 19:09:58 +08:00
2016-11-10 16:36:33 +01:00
2017-02-09 08:02:45 +01:00
2017-02-09 08:02:47 +01:00
2017-03-12 06:37:30 +01:00
2017-03-12 06:37:27 +01:00
2017-03-15 09:57:11 +08:00
2017-01-19 20:17:22 +01:00
2017-01-06 11:16:16 +01:00
2017-01-12 11:22:49 +01:00
2017-01-26 08:23:48 +01:00
2017-01-19 20:17:22 +01:00
2016-10-16 17:36:15 +02:00
2017-01-06 11:16:12 +01:00
2017-03-12 06:37:30 +01:00
2016-09-07 08:32:41 +02:00
2016-11-10 16:36:35 +01:00
2016-10-28 03:01:25 -04:00
2017-03-15 09:57:15 +08:00
2017-02-09 08:02:46 +01:00
2017-03-15 09:57:15 +08:00
2017-01-12 11:22:48 +01:00
2017-01-19 20:17:20 +01:00
2016-09-15 08:27:46 +02:00
2017-03-12 06:37:28 +01:00
2017-03-15 09:57:13 +08:00
2017-02-23 17:43:09 +01:00
2017-03-12 06:37:25 +01:00
2017-01-12 11:22:49 +01:00
2017-02-01 08:30:52 +01:00
2016-09-24 10:07:35 +02:00
2017-03-18 19:09:58 +08:00
2017-03-12 06:37:24 +01:00
2016-10-28 03:01:35 -04:00
2016-11-26 09:54:53 +01:00
2017-01-12 11:22:47 +01:00
2017-02-23 17:43:10 +01:00
2017-03-18 19:09:56 +08:00
2017-03-22 12:04:16 +01:00
2016-11-18 10:48:36 +01:00
2017-02-23 17:43:10 +01:00
2017-03-18 19:09:58 +08:00
2016-09-15 08:27:51 +02:00
2016-11-15 07:46:39 +01:00
2017-02-09 08:02:44 +01:00
2016-10-07 15:23:41 +02:00
2017-02-01 08:30:54 +01:00
2017-02-26 11:07:51 +01:00
2016-10-31 04:14:00 -06:00
2017-03-15 09:57:14 +08:00
2017-03-12 06:37:25 +01:00
2017-03-12 06:37:30 +01:00
2017-03-15 09:57:12 +08:00
2017-03-18 19:09:58 +08:00
2016-09-24 10:07:42 +02:00
2017-01-15 13:41:36 +01:00
2017-01-09 08:07:42 +01:00
2017-03-12 06:37:25 +01:00
2017-03-15 09:57:14 +08:00
2017-01-09 08:07:44 +01:00
2017-03-18 19:09:58 +08:00
2016-10-31 04:13:59 -06:00
2017-03-18 19:09:58 +08:00
2016-11-26 09:54:53 +01:00
2016-09-07 08:32:37 +02:00
2016-09-15 08:27:53 +02:00
2017-02-01 08:30:52 +01:00
2016-11-10 16:36:34 +01:00
2017-01-19 20:17:21 +01:00
2017-03-12 06:37:29 +01:00
2017-01-06 11:16:17 +01:00