Vasily Averin
a7de505c4f
netfilter: x_tables: gpf inside xt_find_revision()
commit 8e24edddad upstream.
nested target/match_revfn() calls work with xt[NFPROTO_UNSPEC] lists
without taking xt[NFPROTO_UNSPEC].mutex. This can race with module unload
and cause host to crash:
general protection fault: 0000 [#1]
Modules linked in: ... [last unloaded: xt_cluster]
CPU: 0 PID: 542455 Comm: iptables
RIP: 0010:[<ffffffff8ffbd518>] [<ffffffff8ffbd518>] strcmp+0x18/0x40
RDX: 0000000000000003 RSI: ffff9a5a5d9abe10 RDI: dead000000000111
R13: ffff9a5a5d9abe10 R14: ffff9a5a5d9abd8c R15: dead000000000100
(VvS: %R15 -- &xt_match, %RDI -- &xt_match.name,
xt_cluster unregister match in xt[NFPROTO_UNSPEC].match list)
Call Trace:
[<ffffffff902ccf44>] match_revfn+0x54/0xc0
[<ffffffff902ccf9f>] match_revfn+0xaf/0xc0
[<ffffffff902cd01e>] xt_find_revision+0x6e/0xf0
[<ffffffffc05a5be0>] do_ipt_get_ctl+0x100/0x420 [ip_tables]
[<ffffffff902cc6bf>] nf_getsockopt+0x4f/0x70
[<ffffffff902dd99e>] ip_getsockopt+0xde/0x100
[<ffffffff903039b5>] raw_getsockopt+0x25/0x50
[<ffffffff9026c5da>] sock_common_getsockopt+0x1a/0x20
[<ffffffff9026b89d>] SyS_getsockopt+0x7d/0xf0
[<ffffffff903cbf92>] system_call_fastpath+0x25/0x2a
Fixes: 656caff20e ("netfilter 04/09: x_tables: fix match/target revision lookup")
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Reviewed-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-16 10:46:20 +09:00
..
2023-05-16 10:25:31 +09:00
2023-05-16 09:40:13 +09:00
2017-12-16 16:25:46 +01:00
2017-01-27 13:55:12 -08:00
2017-01-19 13:32:11 -08:00
2015-03-18 10:51:35 +01:00
2015-02-22 15:59:54 -05:00
2011-01-18 18:12:24 +01:00
2023-05-16 10:36:02 +09:00
2017-10-08 10:26:09 +02:00
2017-10-21 17:21:34 +02:00
2017-08-24 17:12:18 -07:00
2023-05-15 14:30:54 +09:00
2016-07-11 12:32:45 +02:00
2023-05-16 08:29:31 +09:00
2008-01-31 19:28:07 -08:00
2018-03-24 11:00:14 +01:00
2016-07-21 02:31:53 +02:00
2014-11-05 14:10:33 -05:00
2016-07-22 17:05:10 +02:00
2011-01-18 18:12:24 +01:00
2023-05-16 09:23:54 +09:00
2023-05-15 17:30:41 +09:00
2023-05-12 17:07:53 +09:00
2016-08-13 13:27:13 +02:00
2016-09-07 10:36:52 +02:00
2016-08-13 13:27:13 +02:00
2016-08-13 13:27:13 +02:00
2016-08-13 13:27:13 +02:00
2016-08-12 00:41:08 +02:00
2016-08-13 13:27:13 +02:00
2016-07-21 02:31:53 +02:00
2023-05-15 10:54:12 +09:00
2017-06-17 06:41:49 +02:00
2013-01-18 00:28:18 +01:00
2023-05-16 10:26:45 +09:00
2016-07-21 02:31:53 +02:00
2015-12-14 12:48:58 +01:00
2013-12-20 14:58:29 +01:00
2016-03-01 17:36:47 -05:00
2016-10-20 19:59:59 +02:00
2016-09-25 23:16:45 +02:00
2023-05-12 17:05:11 +09:00
2013-04-18 20:27:55 +02:00
2023-05-15 09:08:29 +09:00
2018-02-28 15:09:58 -08:00
2013-08-28 00:26:48 +02:00
2018-02-28 15:09:58 -08:00
2018-03-18 11:18:53 +01:00
2015-08-17 21:33:06 -07:00
2014-06-30 11:38:03 +02:00
2015-08-17 21:33:06 -07:00
2015-08-17 21:33:06 -07:00
2015-08-17 21:33:06 -07:00
2012-08-30 03:00:14 +02:00
2015-10-27 06:54:56 +01:00
2014-10-14 02:18:24 +02:00
2013-02-19 02:48:05 +01:00
2016-10-20 19:59:59 +02:00
2014-08-08 16:47:23 +02:00
2015-09-05 21:57:42 -07:00
2023-05-16 09:04:23 +09:00
2018-07-11 16:26:42 +02:00
2016-09-12 19:54:45 +02:00
2016-09-12 19:54:45 +02:00
2016-09-25 23:34:19 +02:00
2016-08-25 13:11:00 +02:00
2023-05-15 17:09:37 +09:00
2017-10-08 10:26:09 +02:00
2016-09-24 21:29:53 +02:00
2018-07-17 11:37:54 +02:00
2023-05-15 14:16:54 +09:00
2016-09-23 09:29:02 +02:00
2016-09-23 09:29:02 +02:00
2016-09-23 09:29:02 +02:00
2016-07-23 12:25:00 +02:00
2016-04-23 20:13:24 -04:00
2023-05-15 11:34:44 +09:00
2016-01-03 21:04:23 +01:00
2023-05-16 10:33:28 +09:00
2016-10-17 17:43:54 +02:00
2023-05-15 17:11:55 +09:00
2016-11-24 14:40:03 +01:00
2016-09-23 09:29:02 +02:00
2016-10-04 08:59:03 +02:00
2017-06-17 06:41:58 +02:00
2016-09-23 09:30:48 +02:00
2016-03-02 20:05:27 +01:00
2023-05-15 11:34:44 +09:00
2023-05-15 17:33:35 +09:00
2016-09-22 16:33:05 +02:00
2023-05-16 09:04:25 +09:00
2017-11-30 08:39:14 +00:00
2016-09-07 11:02:06 +02:00
2016-11-24 14:43:35 +01:00
2015-04-13 17:17:28 +02:00
2016-08-25 12:55:34 +02:00
2016-08-25 12:55:34 +02:00
2016-10-27 18:22:02 +02:00
2023-05-15 12:36:41 +09:00
2023-05-16 10:46:20 +09:00
2015-09-18 21:58:25 +02:00
2014-03-13 14:13:19 +01:00
2018-03-14 11:39:19 -07:00
2018-02-25 11:05:43 +01:00
2010-07-15 17:20:46 +02:00
2010-11-15 13:57:56 +01:00
2014-08-23 12:21:21 -07:00
2010-05-11 18:33:37 +02:00
2014-09-10 12:40:10 -07:00
2016-07-22 17:05:10 +02:00
2016-09-23 09:30:36 +02:00
2016-11-08 23:53:36 +01:00
2010-05-11 18:31:17 +02:00
2016-08-12 00:43:13 +02:00
2011-01-18 06:33:54 +01:00
2018-03-24 11:00:14 +01:00
2010-05-11 18:35:27 +02:00
2011-02-03 00:05:43 +01:00
2010-05-11 18:33:37 +02:00
2014-11-13 12:14:42 +01:00
2011-12-27 20:45:25 +01:00
2010-05-11 18:35:27 +02:00
2023-05-15 17:00:56 +09:00
2016-09-24 21:29:53 +02:00
2011-07-01 16:11:15 -07:00
2011-07-01 16:11:15 -07:00
2014-08-23 12:21:21 -07:00
2023-05-15 09:51:25 +09:00
2016-10-17 17:38:19 +02:00
2011-02-04 14:28:58 -08:00
2015-09-24 09:34:41 +09:00
2014-01-09 21:36:39 +01:00
2018-03-18 11:18:53 +01:00
2010-05-11 18:33:37 +02:00
2013-04-18 20:27:55 +02:00
2015-09-18 21:58:25 +02:00
2012-05-09 20:49:18 -04:00
2015-05-14 13:00:27 +02:00
2010-05-11 18:35:27 +02:00
2012-10-15 13:39:12 +02:00
2012-09-21 12:11:08 +02:00
2016-08-18 00:38:23 +02:00
2016-10-17 17:38:19 +02:00
2013-12-07 23:20:45 +01:00
2018-01-31 12:55:52 +01:00
2016-06-23 13:58:55 +02:00
2023-05-15 12:21:38 +09:00
2010-05-11 18:33:37 +02:00
2010-05-11 18:33:37 +02:00
2017-09-21 10:39:35 -07:00
2017-05-09 03:03:11 +00:00
2017-01-19 13:32:09 -08:00
2023-05-16 10:25:52 +09:00
2023-05-16 08:54:26 +09:00
2011-10-31 19:30:28 -04:00
2013-06-11 02:51:03 -07:00
2023-05-16 10:25:32 +09:00
2010-05-11 18:33:37 +02:00
2023-05-16 10:35:59 +09:00
2014-11-27 13:08:42 +01:00
2014-06-07 11:44:39 -07:00
2016-09-22 03:13:26 -04:00
2010-10-21 10:12:48 +11:00
2015-06-14 10:40:18 +02:00
2017-01-19 13:32:31 -08:00
2010-06-08 16:09:52 +02:00
2014-01-14 15:15:25 -08:00
2015-02-22 15:59:54 -05:00
2010-05-11 18:35:27 +02:00
2017-07-05 14:40:16 +02:00
2015-08-17 21:33:06 -07:00
2016-07-03 10:55:07 +02:00
2016-09-12 19:54:43 +02:00
2012-09-24 14:29:01 +02:00
2016-08-18 00:51:13 +02:00
2016-06-23 13:26:49 +02:00
2010-05-11 18:33:37 +02:00