Skip to contentSkip to conversation

netfilter: nfnetlink_queue: Unregister pernet subsys in case of init failure

PATCH Applied Nikolay Borisov 3 participants 5 messages Dec 7, 2015 – Dec 9, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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')

---
 net/netfilter/nfnetlink_queue.c | 1 +
 1 file changed, 1 insertion(+)
net/netfilter/nfnetlink_queue.c +1 -0
index 7d81d280cb4f..2e94603c2dec 100644
@@ -1417,6 +1417,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;
 }
Signature · 1 line
2.5.0
#1 lore raw

Hello.

Quoted 1 line · Nikolay Borisov

Commit 3bfe049807c2403 ('netfilter: nfnetlink_{log,queue}:

Double quotes please, that's what scripts/checkpatch.pl enforces now.

Quoted 9 lines

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')

Likewise.

Quoted 2 lines

[...]

MBR, Sergei

#2 lore raw
Quoted 15 lines · Sergei Shtylyov

Hello.

Quoted 1 line · Nikolay Borisov

Commit 3bfe049807c2403 ('netfilter: nfnetlink_{log,queue}:

Double quotes please, that's what scripts/checkpatch.pl enforces now.

Quoted 7 lines

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.

Quoted 4 lines
Quoted 2 lines
Fixes 3bfe049807c2403 ('netfilter: nfnetlink_{log,queue}: Register

pernet in first place')

Likewise.

I will resend it with proper quotes (even though I think this is a minor issue) but I'd like to first gather some review feedback.

Also I dunno if this should be marked for stable.

Quoted 8 lines
Quoted 3 lines

[...]

MBR, Sergei

#3 lore raw
Quoted 18 lines · Nikolay Borisov
Quoted 15 lines · Sergei Shtylyov

Hello.

Quoted 1 line · Nikolay Borisov

Commit 3bfe049807c2403 ('netfilter: nfnetlink_{log,queue}:

Double quotes please, that's what scripts/checkpatch.pl enforces now.

Quoted 7 lines

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.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Fixes 3bfe049807c2403 ('netfilter: nfnetlink_{log,queue}: Register

pernet in first place')

Likewise.

I will resend it with proper quotes (even though I think this is a minor issue) but I'd like to first gather some review feedback.

Unless someone spots any other more relevant problem with this, I'll fix this comestic issues here, no need to resend.

Quoted 1 line

Also I dunno if this should be marked for stable.

Yes, this qualifies for -stable, will take care of that.

Thanks.

maintainer Applied
#4 lore raw
Quoted 22 lines · Pablo Neira Ayuso
Quoted 21 lines · Nikolay Borisov
Quoted 18 lines · Sergei Shtylyov

Hello.

Quoted 1 line · Nikolay Borisov

Commit 3bfe049807c2403 ('netfilter: nfnetlink_{log,queue}:

Double quotes please, that's what scripts/checkpatch.pl enforces now.

Quoted 9 lines

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')

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Likewise.

I will resend it with proper quotes (even though I think this is a minor issue) but I'd like to first gather some review feedback.

Unless someone spots any other more relevant problem with this, I'll fix this comestic issues here, no need to resend.

Applied, thanks.