The commit is pushed to "branch-rh7-3.10.0-693.11.6.vz7.42.x-ovz" and will 
appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.11.6.vz7.42.3
------>
commit 94b497499d2614c42f967fcab4bc0598a0b5c07d
Author: Xin Long <[email protected]>
Date:   Wed Jan 31 16:02:48 2018 +0300

    ms/dccp: call inet_add_protocol after register_pernet_subsys in dccp_v6_init
    
    Backport of ms commit a0f9a4c2ffef
    
    Patch "call inet_add_protocol after register_pernet_subsys in dccp_v4_init"
    fixed a null pointer dereference issue for dccp_ipv4 module.
    
    The same fix is needed for dccp_ipv6 module.
    
    Signed-off-by: Xin Long <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    
    https://jira.sw.ru/browse/PSBM-80708
    Signed-off-by: Kirill Tkhai <[email protected]>
---
 net/dccp/ipv6.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 20271c2e0bde..564e442a6f64 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -1166,33 +1166,33 @@ static int __init dccp_v6_init(void)
 {
        int err = proto_register(&dccp_v6_prot, 1);
 
-       if (err != 0)
+       if (err)
                goto out;
 
-       err = inet6_add_protocol(&dccp_v6_protocol, IPPROTO_DCCP);
-       if (err != 0)
-               goto out_unregister_proto;
-
        inet6_register_protosw(&dccp_v6_protosw);
 
        err = register_pernet_subsys(&dccp_v6_ops);
-       if (err != 0)
+       if (err)
                goto out_destroy_ctl_sock;
+
+       err = inet6_add_protocol(&dccp_v6_protocol, IPPROTO_DCCP);
+       if (err)
+               goto out_unregister_proto;
+
 out:
        return err;
-
+out_unregister_proto:
+       unregister_pernet_subsys(&dccp_v6_ops);
 out_destroy_ctl_sock:
-       inet6_del_protocol(&dccp_v6_protocol, IPPROTO_DCCP);
        inet6_unregister_protosw(&dccp_v6_protosw);
-out_unregister_proto:
        proto_unregister(&dccp_v6_prot);
        goto out;
 }
 
 static void __exit dccp_v6_exit(void)
 {
-       unregister_pernet_subsys(&dccp_v6_ops);
        inet6_del_protocol(&dccp_v6_protocol, IPPROTO_DCCP);
+       unregister_pernet_subsys(&dccp_v6_ops);
        inet6_unregister_protosw(&dccp_v6_protosw);
        proto_unregister(&dccp_v6_prot);
 }
_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to