[Devel] [PATCH RHEL7 COMMIT] ms/netfilter: nfnetlink_queue: Unregister pernet subsys in case of init failure

Konstantin Khorenko khorenko at virtuozzo.com
Fri Apr 8 00:24:48 PDT 2016


The commit is pushed to "branch-rh7-3.10.0-327.10.1.vz7.12.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.10.1.vz7.12.5
------>
commit 4c9df898e9742d7b6379fe5adc3a2b48d365bcec
Author: Nikolay Borisov <kernel at kyup.com>
Date:   Fri Apr 8 11:24:48 2016 +0400

    ms/netfilter: nfnetlink_queue: Unregister pernet subsys in case of init failure
    
    Commit 3bfe049807c2403 ("netfilter: nfnetlink_{log,queue}:
    Register pernet in first place") reorganised the initialisation
    order of the pernet_subsys to avoid "use-before-initialised"
    condition. However, in doing so the cleanup logic in nfnetlink_queue
    got botched in that the pernet_subsys wasn't cleaned in case
    nfnetlink_subsys_register failed. This patch adds the necessary
    cleanup routine call.
    
    Fixes: 3bfe049807c2403 ("netfilter: nfnetlink_{log,queue}: Register pernet in first place")
    Signed-off-by: Nikolay Borisov <kernel at kyup.com>
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
    
    https://jira.sw.ru/browse/PSBM-45783
    
    (cherry picked from commit 639e077b43d9c54ffb1e1b54a2de54597ceae1d8
    ("netfilter: nfnetlink_queue: Unregister pernet subsys in case of init failure"))
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 net/netfilter/nfnetlink_queue_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netfilter/nfnetlink_queue_core.c b/net/netfilter/nfnetlink_queue_core.c
index d940d18..f7a5916 100644
--- a/net/netfilter/nfnetlink_queue_core.c
+++ b/net/netfilter/nfnetlink_queue_core.c
@@ -1291,6 +1291,7 @@ static int __init nfnetlink_queue_init(void)
 
 cleanup_netlink_notifier:
 	netlink_unregister_notifier(&nfqnl_rtnl_notifier);
+	unregister_pernet_subsys(&nfnl_queue_net_ops);
 out:
 	return status;
 }


More information about the Devel mailing list