WANG Cong
82486aa6f1
ipv4: restore rt->fi for reference counting
...
IPv4 dst could use fi->fib_metrics to store metrics but fib_info
itself is refcnt'ed, so without taking a refcnt fi and
fi->fib_metrics could be freed while dst metrics still points to
it. This triggers use-after-free as reported by Andrey twice.
This patch reverts commit 2860583fe8 ("ipv4: Kill rt->fi") to
restore this reference counting. It is a quick fix for -net and
-stable, for -net-next, as Eric suggested, we can consider doing
reference counting for metrics itself instead of relying on fib_info.
IPv6 is very different, it copies or steals the metrics from mx6_config
in fib6_commit_metrics() so probably doesn't need a refcnt.
Decnet has already done the refcnt'ing, see dn_fib_semantic_match().
Fixes: 2860583fe8 ("ipv4: Kill rt->fi")
Reported-by: Andrey Konovalov <andreyknvl@google.com >
Tested-by: Andrey Konovalov <andreyknvl@google.com >
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com >
Acked-by: Eric Dumazet <edumazet@google.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2017-05-08 14:35:03 -04:00
..
2017-01-12 04:01:17 -05:00
2017-04-12 22:02:37 +02:00
2017-03-09 17:01:09 -08:00
2017-05-01 11:48:49 +02:00
2017-04-25 09:04:30 +02:00
2017-04-05 10:15:20 +02:00
2016-02-11 03:54:14 -05:00
2017-04-18 13:39:50 -04:00
2017-04-06 13:28:35 -07:00
2017-04-12 22:02:36 +02:00
2017-01-25 12:37:04 -05:00
2017-04-25 14:21:34 -04:00
2017-04-06 10:11:59 +01:00
2016-09-04 13:29:29 -07:00
2017-04-24 12:35:56 -04:00
2017-02-07 13:07:46 -05:00
2016-02-09 04:45:49 -05:00
2017-04-21 15:28:37 -04:00
2017-03-24 20:49:31 -07:00
2016-06-27 15:06:17 -04:00
2017-05-04 13:15:28 -04:00
2016-07-08 12:20:57 +02:00
2017-01-20 12:12:13 -05:00
2017-02-04 19:44:22 -05:00
2016-04-19 20:09:25 -04:00
2016-04-25 16:44:27 -04:00
2016-06-25 12:19:35 -04:00
2016-04-25 16:44:27 -04:00
2016-06-09 23:41:03 -07:00
2017-04-22 20:26:37 +03:00
2017-04-20 13:48:54 -04:00
2016-02-16 20:21:48 -05:00
2016-11-09 13:41:54 -05:00
2017-02-07 13:07:46 -05:00
2017-02-11 21:25:18 -05:00
2017-04-14 10:06:42 +02:00
2017-04-17 15:35:38 -04:00
2017-04-24 14:30:46 -04:00
2017-04-03 19:04:48 -07:00
2017-04-03 19:04:48 -07:00
2016-05-20 18:03:16 -04:00
2016-09-30 13:29:21 +02:00
2016-09-30 13:29:21 +02:00
2016-12-05 15:21:59 -05:00
2017-04-13 13:58:22 -04:00
2016-06-17 20:23:32 -07:00
2016-08-18 01:17:32 -04:00
2017-02-08 14:38:18 -05:00
2016-07-25 17:55:43 -07:00
2016-03-14 12:19:46 -04:00
2016-04-27 22:48:25 -04:00
2017-01-25 16:00:33 +01:00
2016-01-04 20:40:41 +01:00
2017-01-27 10:25:34 -05:00
2017-02-03 15:16:45 -05:00
2015-12-15 23:25:20 -05:00
2017-01-18 13:04:28 -05:00
2016-04-04 22:11:20 -04:00
2017-03-09 18:23:27 -08:00
2017-03-09 18:23:27 -08:00
2016-08-13 15:08:00 -07:00
2017-01-20 11:27:22 -05:00
2017-01-18 13:04:29 -05:00
2017-01-25 14:04:38 -05:00
2016-12-29 11:38:31 -05:00
2015-12-16 00:14:12 -05:00
2016-03-13 23:55:13 -04:00
2017-02-04 19:58:14 -05:00
2017-05-04 12:51:24 -04:00
2017-04-21 13:21:30 -04:00
2017-03-21 15:27:19 -07:00
2017-04-21 13:21:31 -04:00
2017-04-28 12:00:10 +02:00
2017-04-13 13:19:48 -04:00
2017-01-31 13:16:59 -05:00
2017-01-13 09:38:42 +01:00
2016-08-17 19:36:23 -04:00
2016-10-13 12:05:26 -04:00
2017-02-11 02:31:11 -05:00
2017-04-28 12:28:45 +02:00
2016-07-08 13:23:12 +02:00
2017-04-01 20:21:44 -07:00
2016-10-03 02:00:22 -04:00
2016-10-04 02:11:51 -04:00
2017-03-28 22:02:21 -07:00
2017-04-12 13:59:21 -04:00
2017-04-04 17:35:58 +02:00
2016-07-05 09:06:29 -07:00
2016-06-27 15:06:18 -04:00
2017-04-13 13:58:22 -04:00
2015-12-08 22:02:33 -05:00
2016-07-08 12:20:57 +02:00
2016-03-23 22:09:58 -04:00
2017-02-17 12:08:05 -05:00
2017-03-12 22:53:02 -07:00
2016-08-15 10:55:53 -07:00
2017-03-24 13:17:07 -07:00
2017-01-24 13:44:28 -05:00
2016-10-23 19:35:24 -04:00
2016-10-23 19:35:24 -04:00
2016-12-25 17:21:22 +01:00
2016-12-29 11:38:31 -05:00
2017-05-08 14:35:03 -04:00
2017-04-17 15:35:38 -04:00
2017-04-21 13:58:15 -04:00
2017-03-02 08:42:31 +01:00
2017-05-05 12:00:11 -04:00
2016-11-09 20:40:06 -05:00
2016-11-09 20:40:06 -05:00
2017-01-09 16:07:41 -05:00
2016-04-28 11:49:45 -04:00
2016-01-19 14:44:23 -05:00
2017-04-02 19:34:55 -07:00
2016-08-28 23:32:41 -04:00
2017-02-10 11:46:39 -05:00
2017-05-05 12:00:11 -04:00
2016-05-03 16:08:14 -04:00
2015-10-26 22:24:22 -07:00
2016-06-17 20:23:32 -07:00
2017-03-24 13:17:07 -07:00
2016-12-16 10:24:44 -08:00
2016-11-15 12:16:13 -05:00
2017-04-14 10:07:28 +02:00