Florian Westphal
0fb39bbe43
netfilter: nf_tables: don't skip inactive chains during update
...
There is no synchronization between packet path and the configuration plane.
The packet path uses two arrays with rules, one contains the current (active)
generation. The other either contains the last (obsolete) generation or
the future one.
Consider:
cpu1 cpu2
nft_do_chain(c);
delete c
net->gen++;
genbit = !!net->gen;
rules = c->rg[genbit];
cpu1 ignores c when updating if c is not active anymore in the new
generation.
On cpu2, we now use rules from wrong generation, as c->rg[old]
contains the rules matching 'c' whereas c->rg[new] was not updated and
can even point to rules that have been free'd already, causing a crash.
To fix this, make sure that 'current' to the 'next' generation are
identical for chains that are going away so that c->rg[new] will just
use the matching rules even if genbit was incremented already.
Fixes: 0cbc06b3faba7 ("netfilter: nf_tables: remove synchronize_rcu in commit phase")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2018-11-12 16:13:35 +01:00
..
2018-11-03 13:28:01 +01:00
2018-10-24 00:41:07 +01:00
2018-07-10 20:06:34 -07:00
2018-09-17 11:40:08 +02:00
2018-09-17 11:40:08 +02:00
2018-11-12 16:05:01 +01:00
2018-03-20 13:44:14 +01:00
2017-06-19 19:13:21 +02:00
2018-06-28 22:21:32 +09:00
2018-11-03 14:16:28 +01:00
2018-03-20 13:44:14 +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-08-03 18:37:55 +02:00
2018-04-24 10:29:14 +02:00
2017-04-26 09:30:22 +02:00
2018-03-30 11:41:18 -04:00
2018-09-21 10:14:46 +02:00
2017-07-24 13:24:46 +02:00
2018-11-03 13:28:02 +01:00
2018-11-03 13:28:02 +01:00
2018-09-20 18:07:35 +02: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-11-03 13:28:02 +01:00
2018-09-20 18:08:14 +02:00
2018-04-24 10:29:14 +02:00
2017-04-26 09:30:22 +02:00
2018-05-06 21:51:37 -04:00
2018-03-30 11:41:18 -04:00
2018-09-20 18:07:35 +02:00
2018-04-24 10:29:14 +02:00
2018-08-07 17:14:15 +02:00
2018-03-20 13:44:14 +01:00
2017-05-29 11:32:36 +02:00
2018-10-22 20:21:30 -07: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-06-28 22:21:32 +09:00
2018-03-27 13:18:09 -04:00
2018-06-26 16:48:40 +02:00
2017-04-06 22:01:38 +02:00
2018-08-03 18:37:55 +02: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-04-24 10:29:12 +02:00
2018-04-24 10:29:12 +02:00
2018-04-24 10:29:12 +02:00
2018-04-24 10:29:12 +02:00
2018-04-24 10:29:12 +02:00
2018-04-24 10:29:12 +02:00
2018-09-17 16:11:14 +02:00
2018-04-24 10:29:12 +02:00
2018-01-10 15:32:15 +01:00
2017-11-02 11:10:55 +01:00
2018-05-16 07:24:30 +02:00
2018-11-12 16:13:35 +01:00
2018-09-28 14:28:29 +02:00
2018-07-06 19:31:53 +02:00
2017-07-31 20:41:57 +02:00
2018-08-16 19:37:00 +02:00
2018-06-12 16:19:22 -07:00
2018-11-03 13:28:03 +01:00
2018-06-06 18:39:49 -07:00
2018-10-16 10:01:48 +02:00
2018-09-12 22:22:42 -07:00
2018-07-18 11:26:48 +02:00
2017-05-15 12:51:41 +02:00
2016-11-09 23:42:23 +01:00
2018-08-16 19:37:03 +02:00
2018-09-17 16:11:12 +02:00
2018-11-03 13:28:03 +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
2016-11-03 11:52:34 +01:00
2017-07-31 19:01:40 +02:00
2017-03-13 13:45:36 +01:00
2018-10-19 13:25:22 +02: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-09-28 14:28:34 +02: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-08-28 17:42:56 +02:00
2017-04-07 18:24:47 +02:00
2017-09-04 13:25:09 +02:00
2017-05-15 12:51:41 +02:00
2018-01-10 15:32:08 +01:00
2017-03-06 18:22:12 +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-10-16 10:01:49 +02: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
2016-11-03 10:56:21 +01: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-09-11 01:35:32 +02: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
2016-11-03 10:56:21 +01:00
2015-05-14 13:00:27 +02:00
2016-12-06 21:48:20 +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-02-14 21:05:38 +01:00
2017-01-18 20:32:43 +01:00
2018-02-14 21:05:37 +01:00
2018-10-19 14:00:34 +02:00
2018-03-05 23:15:44 +01:00
2018-03-05 23:15:44 +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
2017-07-01 09:08:41 -07: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
2015-08-17 21:33:06 -07:00
2016-07-03 10:55:07 +02: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
2016-06-23 13:26:49 +02:00