Florian Westphal
1b0890cd60
netfilter: nfnetlink: avoid deadlock due to synchronous request_module
...
Thomas and Juliana report a deadlock when running:
(rmmod nf_conntrack_netlink/xfrm_user)
conntrack -e NEW -E &
modprobe -v xfrm_user
They provided following analysis:
conntrack -e NEW -E
netlink_bind()
netlink_lock_table() -> increases "nl_table_users"
nfnetlink_bind()
# does not unlock the table as it's locked by netlink_bind()
__request_module()
call_usermodehelper_exec()
This triggers "modprobe nf_conntrack_netlink" from kernel, netlink_bind()
won't return until modprobe process is done.
"modprobe xfrm_user":
xfrm_user_init()
register_pernet_subsys()
-> grab pernet_ops_rwsem
..
netlink_table_grab()
calls schedule() as "nl_table_users" is non-zero
so modprobe is blocked because netlink_bind() increased
nl_table_users while also holding pernet_ops_rwsem.
"modprobe nf_conntrack_netlink" runs and inits nf_conntrack_netlink:
ctnetlink_init()
register_pernet_subsys()
-> blocks on "pernet_ops_rwsem" thanks to xfrm_user module
both modprobe processes wait on one another -- neither can make
progress.
Switch netlink_bind() to "nowait" modprobe -- this releases the netlink
table lock, which then allows both modprobe instances to complete.
Reported-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Reported-by: Juliana Rodrigueiro <juliana.rodrigueiro@intra2net.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2019-07-15 07:56:58 +02:00
..
2019-06-25 01:32:59 +02:00
2019-07-08 19:48:57 -07:00
2019-07-04 02:29:49 +02:00
2019-07-11 10:55:49 -07:00
2019-07-09 14:38:51 -07:00
2019-05-21 10:50:45 +02:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:32 -07:00
2019-06-07 11:00:14 -07:00
2019-06-25 01:32:59 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:32 -07:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:06 +02:00
2019-06-25 01:32:59 +02:00
2019-06-19 17:09:52 +02:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:32 -07:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:32 -07:00
2019-06-26 11:07:50 +02:00
2019-05-21 10:50:45 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-05-21 10:50:45 +02:00
2019-06-28 13:36:43 -07:00
2019-06-19 17:09:55 +02:00
2019-06-22 08:59:24 -04:00
2019-06-25 01:32:59 +02:00
2019-06-19 17:09:55 +02:00
2019-05-30 14:18:18 -07:00
2019-06-19 17:09:55 +02:00
2019-05-31 18:02:45 +02:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:32 -07:00
2019-04-30 14:18:56 +02:00
2019-06-19 17:09:55 +02:00
2019-05-24 17:37:51 +02:00
2019-05-24 17:37:51 +02:00
2019-06-19 17:09:55 +02:00
2019-05-31 18:02:42 +02:00
2019-05-21 10:50:45 +02:00
2019-06-26 13:26:08 -07:00
2019-04-12 01:47:39 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-07-04 02:29:48 +02:00
2019-05-30 11:26:32 -07:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-22 08:59:24 -04:00
2019-05-30 11:26:32 -07:00
2019-04-11 20:59:34 +02:00
2019-07-08 19:48:57 -07:00
2019-06-22 08:59:24 -04:00
2019-06-22 08:59:24 -04:00
2019-06-19 17:09:55 +02:00
2019-07-08 19:48:57 -07:00
2017-11-02 11:10:55 +01:00
2019-07-04 02:29:47 +02:00
2019-07-09 14:38:51 -07:00
2019-07-05 21:34:47 +02:00
2019-07-09 14:38:51 -07:00
2019-04-30 13:35:26 +02:00
2019-06-19 17:09:55 +02:00
2019-05-24 17:37:51 +02:00
2019-05-24 17:37:51 +02:00
2019-05-24 17:37:51 +02:00
2019-06-19 17:09:55 +02:00
2019-06-02 18:06:26 -07:00
2019-06-22 08:59:24 -04:00
2019-07-15 07:56:58 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2018-08-16 19:37:03 +02:00
2019-04-08 23:01:39 +02:00
2019-04-08 23:01:42 +02:00
2019-07-09 14:38:51 -07:00
2019-06-19 17:09:55 +02:00
2018-12-29 02:45:20 +01:00
2019-06-19 17:09:55 +02:00
2019-06-25 01:32:59 +02:00
2019-06-19 17:09:55 +02:00
2019-06-25 01:32:59 +02:00
2019-06-25 01:32:59 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-05-23 14:45:36 -07:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-07-09 14:38:51 -07:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-21 22:23:35 -07:00
2019-07-09 14:38:51 -07:00
2019-06-05 17:37:15 +02:00
2019-06-19 17:09:55 +02:00
2019-06-05 17:37:15 +02:00
2019-05-21 10:50:45 +02:00
2019-07-09 14:38:51 -07:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-21 22:23:35 -07:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2018-07-18 11:26:52 +02:00
2019-07-05 21:34:23 +02:00
2018-08-16 19:37:10 +02:00
2019-04-27 17:07:21 -04:00
2019-06-19 17:09:55 +02:00
2019-06-28 19:30:50 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-05-21 10:50:45 +02:00
2018-02-14 21:05:38 +01:00
2019-06-19 17:09:55 +02:00
2018-07-30 14:07:09 +02:00
2019-05-21 11:28:45 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-22 08:59:24 -04:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-05-21 10:50:45 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-22 08:59:24 -04:00
2019-06-19 17:09:55 +02:00
2019-06-05 17:37:07 +02:00
2019-05-30 11:26:32 -07:00
2019-06-25 01:32:59 +02:00
2019-05-21 10:50:45 +02:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:38 -07:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-05-24 17:36:47 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-05-21 11:28:45 +02:00
2019-06-25 01:32:59 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-05-21 10:50:45 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2017-11-02 11:10:55 +01:00
2019-05-21 10:50:45 +02:00
2019-06-19 17:09:55 +02:00
2019-06-25 01:32:59 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-22 08:59:24 -04:00
2019-06-22 08:59:24 -04:00
2019-05-21 10:50:45 +02:00
2019-05-21 11:28:40 +02:00
2019-04-22 10:34:30 +02:00
2019-06-19 17:09:55 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00