Jakub Kicinski
006a5035b4
inet: frags: flush pending skbs in fqdir_pre_exit()
...
We have been seeing occasional deadlocks on pernet_ops_rwsem since
September in NIPA. The stuck task was usually modprobe (often loading
a driver like ipvlan), trying to take the lock as a Writer.
lockdep does not track readers for rwsems so the read wasn't obvious
from the reports.
On closer inspection the Reader holding the lock was conntrack looping
forever in nf_conntrack_cleanup_net_list(). Based on past experience
with occasional NIPA crashes I looked thru the tests which run before
the crash and noticed that the crash follows ip_defrag.sh. An immediate
red flag. Scouring thru (de)fragmentation queues reveals skbs sitting
around, holding conntrack references.
The problem is that since conntrack depends on nf_defrag_ipv6,
nf_defrag_ipv6 will load first. Since nf_defrag_ipv6 loads first its
netns exit hooks run _after_ conntrack's netns exit hook.
Flush all fragment queue SKBs during fqdir_pre_exit() to release
conntrack references before conntrack cleanup runs. Also flush
the queues in timer expiry handlers when they discover fqdir->dead
is set, in case packet sneaks in while we're running the pre_exit
flush.
The commit under Fixes is not exactly the culprit, but I think
previously the timer firing would eventually unblock the spinning
conntrack.
Fixes: d5dd88794a ("inet: fix various use-after-free in defrags units")
Reviewed-by: Eric Dumazet <edumazet@google.com >
Link: https://patch.msgid.link/20251207010942.1672972-4-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2025-12-10 01:15:27 -08:00
..
2024-05-01 18:07:37 +01:00
2025-12-01 16:21:16 -05:00
2024-10-08 15:33:49 -07:00
2024-12-09 14:44:59 -08:00
2025-10-29 20:04:55 -07:00
2025-12-01 13:53:53 -08:00
2025-11-28 00:05:49 +00:00
2025-11-20 17:44:23 -08:00
2025-09-03 17:02:12 -07:00
2025-09-04 10:19:17 +02:00
2024-10-24 16:03:40 +02:00
2025-11-07 18:53:57 -08:00
2025-11-14 18:00:34 -08:00
2025-08-28 16:46:23 -07:00
2025-09-02 15:52:24 -07:00
2025-11-03 17:40:46 -08:00
2025-04-24 17:03:45 -07:00
2025-07-08 18:05:25 -07:00
2025-07-07 16:55:54 -07:00
2025-07-02 14:22:02 -07:00
2023-03-21 21:32:18 -07:00
2025-03-24 10:26:53 +00:00
2025-09-09 10:56:02 +02:00
2024-08-26 09:37:22 -07:00
2025-09-09 10:56:02 +02:00
2025-10-01 10:14:49 +02:00
2025-02-27 14:03:14 +01:00
2024-10-02 17:23:23 -04:00
2025-11-25 10:31:28 +01:00
2024-03-06 21:01:26 +01:00
2025-05-30 19:53:51 -07:00
2024-10-02 17:23:23 -04:00
2025-09-14 11:55:04 -07:00
2023-07-14 20:39:29 -07:00
2023-07-27 17:17:32 -07:00
2023-01-20 09:33:22 +00:00
2025-11-20 19:01:22 -08:00
2025-09-18 12:32:06 +02:00
2025-02-11 11:58:17 +01:00
2023-10-24 13:08:14 -07:00
2025-12-01 16:45:07 -08:00
2024-05-08 10:35:09 +01:00
2024-08-26 09:37:23 -07:00
2025-09-14 14:28:12 -07:00
2024-05-29 17:34:49 -07:00
2025-08-29 19:36:31 -07:00
2024-11-13 18:49:50 -08:00
2024-08-26 09:37:23 -07:00
2024-04-01 21:27:08 -07:00
2024-10-11 15:35:05 -07:00
2025-04-15 17:54:56 -07:00
2024-07-15 09:14:39 -07:00
2024-10-30 17:33:53 -07:00
2025-08-26 17:34:31 -07:00
2023-04-12 16:40:39 -07:00
2023-08-08 15:58:23 -07:00
2025-09-03 15:16:49 -07:00
2024-04-01 10:49:28 +01:00
2025-11-14 18:00:08 -08:00
2023-06-10 00:11:41 -07:00
2024-05-07 01:35:55 +02:00
2023-07-28 14:07:59 -07:00
2025-09-30 15:45:53 +02:00
2024-08-26 09:37:23 -07:00
2025-09-11 12:22:38 +02:00
2024-05-08 10:35:09 +01:00
2025-10-30 08:38:51 +01:00
2023-11-20 11:43:03 +01:00
2024-02-26 18:40:34 -08:00
2025-03-24 12:10:13 -07:00
2025-09-22 11:38:43 -07:00
2025-11-04 19:10:33 -08:00
2025-11-25 19:28:29 -08:00
2025-08-26 17:34:31 -07:00
2025-12-10 01:15:27 -08:00
2025-09-23 10:12:15 +02:00
2025-10-27 18:04:59 -07:00
2025-09-23 10:12:15 +02:00
2024-12-17 19:37:00 -08:00
2024-02-28 11:19:41 +00:00
2025-04-24 09:29:56 +02:00
2025-09-18 10:17:09 +02:00
2025-07-02 14:32:30 -07:00
2025-08-26 17:34:31 -07:00
2025-10-13 17:43:46 -07:00
2025-08-13 08:34:33 +02:00
2025-11-04 19:10:33 -08:00
2025-03-21 17:36:49 +08:00
2025-12-10 01:15:27 -08:00
2025-11-04 19:10:33 -08:00
2025-11-04 19:10:33 -08:00
2024-10-09 08:53:01 +02:00
2025-08-13 18:18:33 -07:00
2025-04-15 17:54:56 -07:00
2024-12-06 17:43:08 -08:00
2023-08-04 15:33:17 -07:00
2023-08-04 15:33:17 -07:00
2024-07-15 08:51:01 -07:00
2023-07-20 10:46:28 +02:00
2024-08-26 09:37:23 -07:00
2024-07-15 08:51:19 -07:00
2025-07-02 14:32:30 -07:00
2025-11-10 10:38:37 +01:00
2024-10-02 17:23:23 -04:00
2025-01-20 12:20:42 +00:00
2025-07-15 12:08:39 +02:00
2024-11-09 09:04:54 -08:00
2025-04-15 08:21:46 -07:00
2025-07-10 15:27:32 -07:00
2024-11-09 13:22:57 -08:00
2025-10-24 17:57:20 -07:00
2024-11-30 13:41:50 -08:00
2025-09-29 11:20:29 -07:00
2024-10-10 08:30:22 -07:00
2025-05-22 09:42:41 -07:00
2025-03-12 13:32:35 -07:00
2025-09-04 10:19:17 +02:00
2025-04-09 17:01:51 -07:00
2023-11-20 10:15:16 -08:00
2024-11-21 08:28:08 -08:00
2025-07-02 15:39:04 -07:00
2025-10-28 17:41:46 -07:00
2025-04-24 09:29:56 +02:00
2025-10-20 17:13:40 -07:00
2023-07-14 20:39:29 -07:00
2025-06-13 18:17:08 -07:00
2023-07-14 20:39:30 -07:00
2025-11-04 19:10:33 -08:00
2025-11-24 18:53:14 -08:00
2025-11-25 16:10:32 +01:00
2025-10-16 12:04:47 -07:00
2024-03-07 21:12:43 -08:00
2024-07-11 18:11:31 -07:00
2025-09-18 12:32:06 +02:00
2025-09-14 11:35:17 -07:00
2023-03-17 08:56:37 +00:00
2024-08-26 09:37:23 -07:00
2024-08-26 09:37:23 -07:00
2025-11-07 18:05:25 -08:00
2025-08-27 07:43:08 -07:00
2025-08-29 19:36:32 -07:00
2023-06-19 11:32:58 -07:00
2025-09-03 15:08:20 -07:00
2023-07-14 20:39:30 -07:00
2025-04-11 18:58:10 -07:00
2025-02-21 15:28:03 -08:00
2025-11-25 16:10:32 +01:00
2025-07-04 09:32:35 +02:00
2025-04-11 18:58:10 -07:00
2025-08-26 18:11:29 -07:00
2024-06-24 16:41:23 -07:00
2024-05-30 18:29:38 -07:00
2025-11-06 13:38:11 +01:00
2025-11-10 11:19:41 -08:00
2025-09-08 18:06:21 -07:00
2024-08-02 17:16:59 -07:00
2025-11-25 19:28:29 -08:00
2023-10-04 11:49:20 -07:00
2025-05-05 16:48:12 -07:00
2024-02-16 09:36:37 +00:00
2024-02-14 10:49:37 +01:00
2025-09-11 19:05:56 -07:00
2025-09-18 08:47:52 +02:00
2023-12-04 14:45:26 -08:00
2025-11-14 18:00:08 -08:00
2025-07-11 11:00:57 -07:00
2025-08-25 17:53:35 -07:00
2023-07-28 14:07:59 -07:00
2025-10-31 06:46:03 -07:00
2023-08-01 15:06:27 -07:00
2025-06-24 16:31:36 -07:00
2025-11-04 19:10:33 -08:00
2023-09-14 16:16:36 +02:00
2025-11-04 19:10:32 -08:00
2025-06-17 18:18:46 -07:00
2025-07-14 17:19:13 -07:00
2025-11-06 16:46:11 -08:00
2025-11-11 10:21:08 +01:00
2025-09-24 10:22:37 -07:00
2025-10-30 11:52:31 +01:00
2025-11-04 16:10:53 +01:00