Shigeru Yoshida
03c1f1ef15
netfilter: Cleanup nft_net->module_list from nf_tables_exit_net()
...
syzbot reported a warning like below [1]:
WARNING: CPU: 3 PID: 9 at net/netfilter/nf_tables_api.c:10096 nf_tables_exit_net+0x71c/0x840
Modules linked in:
CPU: 2 PID: 9 Comm: kworker/u8:0 Tainted: G W 6.1.0-rc3-00072-g8e5423e991e8 #47
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-1.fc36 04/01/2014
Workqueue: netns cleanup_net
RIP: 0010:nf_tables_exit_net+0x71c/0x840
...
Call Trace:
<TASK>
? __nft_release_table+0xfc0/0xfc0
ops_exit_list+0xb5/0x180
cleanup_net+0x506/0xb10
? unregister_pernet_device+0x80/0x80
process_one_work+0xa38/0x1730
? pwq_dec_nr_in_flight+0x2b0/0x2b0
? rwlock_bug.part.0+0x90/0x90
? _raw_spin_lock_irq+0x46/0x50
worker_thread+0x67e/0x10e0
? process_one_work+0x1730/0x1730
kthread+0x2e5/0x3a0
? kthread_complete_and_exit+0x40/0x40
ret_from_fork+0x1f/0x30
</TASK>
In nf_tables_exit_net(), there is a case where nft_net->commit_list is
empty but nft_net->module_list is not empty. Such a case occurs with
the following scenario:
1. nfnetlink_rcv_batch() is called
2. nf_tables_newset() returns -EAGAIN and NFNL_BATCH_FAILURE bit is
set to status
3. nf_tables_abort() is called with NFNL_ABORT_AUTOLOAD
(nft_net->commit_list is released, but nft_net->module_list is not
because of NFNL_ABORT_AUTOLOAD flag)
4. Jump to replay label
5. netlink_skb_clone() fails and returns from the function (this is
caused by fault injection in the reproducer of syzbot)
This patch fixes this issue by calling __nf_tables_abort() when
nft_net->module_list is not empty in nf_tables_exit_net().
Fixes: eb014de4fd ("netfilter: nf_tables: autoload modules from the abort path")
Link: https://syzkaller.appspot.com/bug?id=802aba2422de4218ad0c01b46c9525cc9d4e4aa3 [1]
Reported-by: syzbot+178efee9e2d7f87f5103@syzkaller.appspotmail.com
Signed-off-by: Shigeru Yoshida <syoshida@redhat.com >
Signed-off-by: Florian Westphal <fw@strlen.de >
2022-11-08 23:16:14 +01:00
..
2022-11-02 19:22:23 +01:00
2022-11-02 09:39:14 +01:00
2022-08-22 14:26:30 +01:00
2022-08-17 08:46:30 +02:00
2022-10-03 09:17:32 -07:00
2022-05-16 13:05:40 +02:00
2022-02-04 06:30:28 +01:00
2019-07-16 13:16:59 +02:00
2022-10-03 09:17:32 -07:00
2022-07-11 16:25:15 +02:00
2022-10-03 13:02:49 -07:00
2022-05-13 18:56:28 +02:00
2022-01-09 23:30:13 +01:00
2022-05-13 18:52:16 +02:00
2022-09-20 23:50:03 +02:00
2020-07-22 01:18:05 +02:00
2022-08-11 16:50:49 +02:00
2019-06-19 17:09:52 +02:00
2022-08-31 12:12:32 +02:00
2022-09-07 15:55:23 +02:00
2022-02-04 06:30:28 +01:00
2022-01-11 10:41:44 +01:00
2022-08-31 12:12:32 +02:00
2022-07-11 16:25:15 +02:00
2021-06-18 14:47:43 +02:00
2019-06-19 17:09:55 +02:00
2021-07-02 02:07:01 +02:00
2021-06-18 14:47:43 +02:00
2021-06-18 14:47:43 +02:00
2022-02-04 05:38:15 +01:00
2022-09-07 16:46:03 +02:00
2022-03-03 13:35:22 +01:00
2022-05-13 18:56:27 +02:00
2022-08-11 16:50:25 +02:00
2022-02-04 06:30:28 +01:00
2022-09-07 15:06:26 +02:00
2019-05-30 11:26:32 -07:00
2022-08-31 12:12:32 +02:00
2019-07-16 13:16:59 +02:00
2022-07-11 16:25:15 +02:00
2022-02-04 06:30:28 +01:00
2022-06-21 10:50:41 +02:00
2022-08-24 07:43:21 +02:00
2022-03-16 11:25:04 +01:00
2022-05-18 17:34:26 +02:00
2022-08-24 07:43:21 +02:00
2022-07-11 16:25:14 +02:00
2021-08-30 01:51:36 +02:00
2020-05-27 22:20:34 +02:00
2022-07-09 09:55:43 +02:00
2022-09-07 16:46:03 +02:00
2022-09-07 16:46:04 +02:00
2022-10-03 09:17:32 -07:00
2022-11-02 10:47:22 +01:00
2022-09-07 16:46:04 +02:00
2022-09-07 16:46:04 +02:00
2022-09-07 16:46:04 +02:00
2022-05-13 18:56:27 +02:00
2021-04-26 03:20:07 +02:00
2019-06-22 08:59:24 -04:00
2022-09-07 16:46:04 +02:00
2019-07-16 13:16:59 +02:00
2022-03-01 11:51:15 +01:00
2020-07-24 15:41:54 -07:00
2022-07-15 11:49:55 +01:00
2022-11-08 23:16:14 +01:00
2022-08-05 18:50:14 -07:00
2022-06-06 19:19:15 +02:00
2022-06-27 19:22:54 +02:00
2021-05-29 01:04:53 +02:00
2022-07-11 16:25:15 +02:00
2022-06-17 23:31:20 +02:00
2022-08-22 14:26:30 +01:00
2022-03-03 14:38:48 +00:00
2022-09-07 15:55:28 +02:00
2022-07-26 21:12:42 +02:00
2022-11-08 23:16:13 +01:00
2022-08-09 20:13:29 +02:00
2022-07-11 16:40:46 +02:00
2021-10-22 11:41:16 +01:00
2021-05-29 01:04:54 +02:00
2021-05-29 01:04:54 +02:00
2022-08-09 20:13:29 +02:00
2022-03-20 00:29:46 +01:00
2022-04-05 11:55:46 +02:00
2022-04-05 11:55:46 +02:00
2022-08-31 12:12:32 +02:00
2022-03-20 00:29:46 +01:00
2022-08-09 19:38:16 +02:00
2022-07-11 16:40:46 +02:00
2022-03-20 00:29:47 +01:00
2022-03-20 00:29:47 +01:00
2022-04-11 12:10:09 +02:00
2022-05-31 23:32:53 +02:00
2022-03-20 00:29:46 +01:00
2022-03-20 00:29:47 +01:00
2022-08-09 20:13:29 +02:00
2022-04-05 11:55:46 +02:00
2022-05-26 22:50:34 +02:00
2022-03-20 00:29:46 +01:00
2022-03-20 00:29:46 +01:00
2022-03-20 00:29:46 +01:00
2022-06-08 12:30:59 +02:00
2022-06-01 15:53:39 +02:00
2022-06-08 12:30:59 +02:00
2022-03-20 00:29:46 +01:00
2022-09-07 16:46:03 +02:00
2022-11-01 21:29:06 -07:00
2022-07-26 21:12:42 +02:00
2022-04-05 11:55:46 +02:00
2022-08-09 20:13:29 +02:00
2022-03-20 00:29:46 +01:00
2022-03-20 00:29:46 +01:00
2022-03-20 00:29:46 +01:00
2020-10-31 10:40:42 +01:00
2022-03-20 00:29:46 +01:00
2022-07-11 16:40:37 +02:00
2022-06-27 19:03:37 +02:00
2021-12-24 16:58:17 +01:00
2021-05-29 01:04:27 +02:00
2022-07-02 21:04:19 +02:00
2021-05-29 01:04:27 +02:00
2022-04-22 15:49:15 +02:00
2022-08-15 11:16:47 -10:00
2022-03-20 00:29:46 +01:00
2022-08-23 21:24:34 +02:00
2022-08-24 07:43:21 +02:00
2022-07-11 16:40:46 +02:00
2020-10-30 12:57:39 +01:00
2022-09-07 16:46:03 +02:00
2019-06-19 17:09:55 +02:00
2021-06-01 23:53:51 +02:00
2021-08-17 00:45:07 +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
2022-07-11 16:40:45 +02:00
2020-07-29 20:09:18 +02:00
2020-07-29 20:09:18 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2022-07-11 16:25:15 +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
2022-07-11 16:40:45 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2022-01-22 08:33:37 +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
2020-08-28 19:55:51 +02:00
2021-11-08 12:14:05 +01: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
2021-05-29 01:04:52 +02:00
2021-09-21 03:46:56 +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
2020-06-25 00:50:31 +02:00
2019-06-19 17:09:55 +02:00
2020-12-01 09:45:29 +01:00
2021-09-21 03:46:56 +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-09-13 12:32:48 +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
2022-09-07 16:46:03 +02:00
2019-06-19 17:09:55 +02:00
2022-01-22 08:33:37 +02:00
2019-06-19 17:09:55 +02:00
2019-05-21 10:50:45 +02:00
2021-05-03 23:02:44 +02:00
2019-08-13 12:14:26 +02:00
2022-02-13 23:55:48 +01:00
2019-06-19 17:09:55 +02:00
2022-10-11 17:42:58 -06:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2022-07-11 16:40:45 +02: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
2020-07-29 20:09:18 +02:00
2022-07-21 00:56:00 +02:00
2021-03-31 22:34:10 +02:00
2019-05-21 10:50:45 +02:00