Skip to content

Commit 38ff3e6

Browse files
nhormandavem330
authored andcommitted
dccp_probe: Fix module load dependencies between dccp and dccp_probe
This was just recently reported to me. When built as modules, the dccp_probe module has a silent dependency on the dccp module. This stems from the fact that the module_init routine of dccp_probe registers a jprobe on the dccp_sendmsg symbol. Since the symbol is only referenced as a text string (the .symbol_name field in the jprobe struct) rather than the address of the symbol itself, depmod never picks this dependency up, and so if you load the dccp_probe module without the dccp module loaded, the register_jprobe call fails with an -EINVAL, and the whole module load fails. The fix is pretty easy, we can just wrap the register_jprobe call in a try_then_request_module call, which forces the dependency to get satisfied prior to the probe registration. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent cd65c3c commit 38ff3e6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎net/dccp/probe.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ static __init int dccpprobe_init(void)
163163
if (!proc_net_fops_create(&init_net, procname, S_IRUSR, &dccpprobe_fops))
164164
goto err0;
165165

166-
ret = register_jprobe(&dccp_send_probe);
166+
ret = try_then_request_module((register_jprobe(&dccp_send_probe) == 0),
167+
"dccp");
167168
if (ret)
168169
goto err1;
169170

0 commit comments

Comments
 (0)