Florian Westphal
f7fcc98dfc
netfilter: nf_conncount: split gc in two phases
...
The lockless workqueue garbage collector can race with packet path
garbage collector to delete list nodes, as it calls tree_nodes_free()
with the addresses of nodes that might have been free'd already from
another cpu.
To fix this, split gc into two phases.
One phase to perform gc on the connections: From a locking perspective,
this is the same as count_tree(): we hold rcu lock, but we do not
change the tree, we only change the nodes' contents.
The second phase acquires the tree lock and reaps empty nodes.
This avoids a race condition of the garbage collection vs. packet path:
If a node has been free'd already, the second phase won't find it anymore.
This second phase is, from locking perspective, same as insert_tree().
The former only modifies nodes (list content, count), latter modifies
the tree itself (rb_erase or rb_insert).
Fixes: 5c789e131c ("netfilter: nf_conncount: Add list lock and gc worker, and RCU for init tree search")
Reviewed-by: Shawn Bohrer <sbohrer@cloudflare.com >
Signed-off-by: Florian Westphal <fw@strlen.de >
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org >
2018-12-29 02:45:19 +01:00
..
2018-12-20 18:20:26 -08:00
2018-11-26 10:23:42 +01:00
2018-07-10 20:06:34 -07:00
2018-12-17 23:33:29 +01:00
2018-12-17 23:33:31 +01:00
2018-12-29 02:45:19 +01:00
2018-12-21 00:51:54 +01:00
2018-06-28 22:21:32 +09:00
2018-12-21 00:51:54 +01:00
2018-12-21 00:51:54 +01:00
2018-09-20 18:07:35 +02:00
2018-04-17 10:59:43 +02:00
2018-04-24 10:29:14 +02:00
2018-01-08 18:01:05 +01:00
2018-01-08 18:01:26 +01:00
2018-12-21 00:51:54 +01:00
2018-04-24 10:29:14 +02:00
2018-03-30 11:41:18 -04:00
2018-12-17 23:33:31 +01:00
2018-11-03 13:28:02 +01:00
2018-11-03 13:28:02 +01:00
2018-12-20 18:20:26 -08:00
2018-11-03 13:28:02 +01:00
2018-11-03 13:28:02 +01:00
2018-11-03 13:28:02 +01:00
2018-11-03 13:28:02 +01:00
2018-12-21 00:48:46 +01:00
2018-12-17 23:32:30 +01:00
2018-04-24 10:29:14 +02:00
2018-12-07 10:54:23 +01:00
2018-05-06 21:51:37 -04:00
2018-03-30 11:41:18 -04:00
2018-12-21 00:51:51 +01:00
2018-04-24 10:29:14 +02:00
2018-08-07 17:14:15 +02:00
2018-12-21 00:51:54 +01:00
2018-11-12 16:41:09 +01:00
2018-04-24 10:28:45 +02:00
2018-09-28 14:28:38 +02:00
2018-05-23 09:14:05 +02:00
2018-12-19 11:21:37 -08:00
2018-03-27 13:18:09 -04:00
2018-06-26 16:48:40 +02:00
2018-12-20 18:20:26 -08:00
2018-03-20 13:44:14 +01:00
2018-09-20 18:26:56 +02:00
2018-03-20 13:44:14 +01:00
2018-12-17 23:33:31 +01:00
2018-09-17 16:11:14 +02:00
2018-12-17 23:43:58 +01:00
2018-12-19 11:21:37 -08:00
2017-11-02 11:10:55 +01:00
2018-05-16 07:24:30 +02:00
2018-12-29 02:44:51 +01:00
2018-12-04 01:37:13 +01:00
2018-07-06 19:31:53 +02:00
2018-08-16 19:37:00 +02:00
2018-06-12 16:19:22 -07:00
2018-11-26 10:25:20 +01:00
2018-12-01 12:38:23 +01:00
2018-10-16 10:01:48 +02:00
2018-12-19 11:21:37 -08:00
2018-07-18 11:26:48 +02:00
2018-08-16 19:37:03 +02:00
2018-09-17 16:11:12 +02:00
2018-11-13 09:57:33 +01:00
2018-07-18 11:26:37 +02:00
2018-06-03 00:02:11 +02:00
2018-09-28 14:28:34 +02:00
2018-10-19 14:00:33 +02:00
2018-09-17 11:29:49 +02:00
2018-04-27 00:00:56 +02:00
2018-11-27 00:35:19 +01:00
2018-10-19 14:00:33 +02:00
2018-06-01 09:38:40 +02:00
2018-07-17 20:48:24 +02:00
2018-05-23 09:50:28 +02:00
2018-06-07 16:14:00 -04:00
2018-09-17 11:29:49 +02:00
2018-01-10 15:32:08 +01:00
2018-12-19 11:21:37 -08:00
2018-04-24 10:29:12 +02:00
2018-10-29 11:11:33 +01:00
2018-09-17 11:29:49 +02:00
2018-10-25 10:18:31 +02:00
2017-09-04 13:25:09 +02:00
2018-01-10 15:32:08 +01:00
2018-09-17 16:11:12 +02:00
2018-09-17 11:29:49 +02:00
2018-08-16 19:36:59 +02:00
2018-09-28 14:28:43 +02:00
2018-10-11 11:29:14 +02:00
2018-07-18 11:26:52 +02:00
2018-08-16 19:37:10 +02:00
2018-08-04 00:53:29 +02:00
2018-12-19 11:21:37 -08:00
2018-07-16 17:51:48 +02:00
2018-08-16 19:37:05 +02:00
2018-02-14 21:05:37 +01:00
2018-06-19 10:43:55 -04:00
2018-02-14 21:05:38 +01:00
2018-09-17 16:11:03 +02:00
2018-08-24 09:58:16 +02:00
2018-08-23 20:26:53 +02:00
2018-02-14 21:05:38 +01:00
2018-02-14 21:05:38 +01:00
2018-07-30 14:07:09 +02:00
2018-06-12 19:35:52 +02:00
2018-02-14 21:05:38 +01:00
2018-02-14 21:05:38 +01:00
2018-09-20 18:07:35 +02:00
2018-02-14 21:05:33 +01:00
2018-02-14 21:05:33 +01:00
2018-02-14 21:05:38 +01:00
2018-12-20 18:20:26 -08:00
2018-02-14 21:05:38 +01:00
2018-02-14 21:05:33 +01:00
2018-02-14 21:05:37 +01:00
2018-11-03 13:28:01 +01:00
2018-02-14 21:05:38 +01:00
2018-02-14 21:05:38 +01:00
2018-02-14 21:05:38 +01:00
2018-02-14 21:05:39 +01:00
2018-03-05 23:15:50 +01:00
2018-10-16 19:34:49 +02:00
2018-04-24 10:29:12 +02:00
2018-03-05 23:15:43 +01:00
2018-04-19 13:02:44 +02:00
2018-02-14 21:05:35 +01:00
2018-10-16 10:01:50 +02:00
2018-06-28 22:21:32 +09:00
2018-12-19 11:21:37 -08:00
2018-12-19 11:21:37 -08:00
2018-10-19 14:00:34 +02:00
2018-03-05 23:15:44 +01:00
2018-11-13 09:57:29 +01:00
2018-06-28 22:21:32 +09:00
2018-04-24 10:29:12 +02:00
2017-11-02 11:10:55 +01:00
2018-09-17 16:11:12 +02:00
2018-06-06 14:00:54 +02:00
2018-09-28 14:47:41 +02:00
2018-02-14 21:05:38 +01:00
2018-01-31 14:59:24 +01:00
2018-03-30 11:04:12 +02:00
2018-02-14 21:05:38 +01:00
2018-10-11 11:29:14 +02:00
2018-03-20 13:44:14 +01:00
2018-07-20 22:28:28 -07:00