Skip to content

Commit 3d36696

Browse files
dwmw2davem330
authored andcommitted
[AF_UNIX] Initialise UNIX sockets before general device initcalls
When drivers call request_module(), it tries to do something with UNIX sockets and triggers a 'runaway loop modprobe net-pf-1' warning. Avoid this by initialising AF_UNIX support earlier. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c9c1014 commit 3d36696

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎net/unix/af_unix.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2193,7 +2193,11 @@ static void __exit af_unix_exit(void)
21932193
unregister_pernet_subsys(&unix_net_ops);
21942194
}
21952195

2196-
module_init(af_unix_init);
2196+
/* Earlier than device_initcall() so that other drivers invoking
2197+
request_module() don't end up in a loop when modprobe tries
2198+
to use a UNIX socket. But later than subsys_initcall() because
2199+
we depend on stuff initialised there */
2200+
fs_initcall(af_unix_init);
21972201
module_exit(af_unix_exit);
21982202

21992203
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)