Vasily Averin
82e85c0e7f
netfilter: x_tables: gpf inside xt_find_revision()
...
commit 8e24edddad152b998b37a7f583175137ed2e04a5 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: 656caff20e1 ("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>
2021-03-17 17:03:32 +01:00
..
2019-07-06 12:50:01 +02:00
2020-11-05 11:43:20 +01:00
2021-01-17 14:05:31 +01:00
2020-08-11 15:33:40 +02:00
2020-10-01 13:17:58 +02:00
2020-07-31 18:39:31 +02:00
2020-12-02 08:49:50 +01:00
2021-03-07 12:20:45 +01:00
2019-07-25 18:00:41 -07:00
2020-04-21 09:04:53 +02:00
2021-03-07 12:20:43 +01:00
2019-10-28 13:33:41 -07:00
2020-12-11 13:23:32 +01:00
2020-11-05 11:43:34 +01:00
2021-03-07 12:20:44 +01:00
2021-01-23 15:57:59 +01:00
2020-06-17 16:40:32 +02:00
2020-01-04 19:18:58 +01:00
2020-04-23 10:36:45 +02:00
2021-03-11 14:06:48 +01:00
2020-01-09 10:20:06 +01:00
2020-04-21 09:04:44 +02:00
2020-03-18 07:17:44 +01:00
2019-09-26 08:56:17 +02:00
2021-03-17 17:03:32 +01:00
2021-03-04 10:26:53 +01:00
2021-03-07 12:20:42 +01:00
2019-09-27 10:27:14 +02:00
2021-02-13 13:52:54 +01:00
2020-07-22 09:32:47 +02:00
2021-02-10 09:25:28 +01:00
2020-10-01 13:17:15 +02:00
2021-03-04 10:26:17 +01:00
2020-10-01 13:18:17 +02:00
2021-03-17 17:03:31 +01:00
2021-01-12 20:16:13 +01:00
2021-03-17 17:03:32 +01:00
2020-11-24 13:28:57 +01:00
2020-07-22 09:32:46 +02:00
2020-04-29 16:33:08 +02:00
2021-02-03 23:26:01 +01:00
2020-12-08 10:40:27 +01:00
2020-09-09 19:12:29 +02:00
2019-10-28 13:33:41 -07:00
2019-12-04 22:30:54 +01:00
2021-03-04 10:26:53 +01:00
2021-02-17 10:35:19 +01:00
2020-11-24 13:29:05 +01:00
2020-12-08 10:40:23 +01:00
2021-02-17 10:35:18 +01:00
2021-03-04 10:26:53 +01:00
2021-02-17 10:35:19 +01:00
2020-11-24 13:28:58 +01:00
2021-02-13 13:52:56 +01:00
2021-02-07 15:35:46 +01:00
2021-01-23 15:58:00 +01:00
2020-12-08 10:40:23 +01:00
2020-10-01 13:17:31 +02:00
2021-02-17 10:35:19 +01:00
2019-08-10 15:25:47 -07:00
2021-02-03 23:25:56 +01:00
2020-12-08 10:40:26 +01:00
2020-12-30 11:50:53 +01:00
2021-03-04 10:26:53 +01:00
2020-08-21 13:05:25 +02:00
2020-04-01 11:02:18 +02:00
2020-08-19 08:16:22 +02:00