netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netfilter: nfnetlink_queue: Unregister pernet subsys in case of init failure
@ 2015-12-07 10:13 Nikolay Borisov
  2015-12-07 12:29 ` Sergei Shtylyov
  0 siblings, 1 reply; 5+ messages in thread
From: Nikolay Borisov @ 2015-12-07 10:13 UTC (permalink / raw)
  To: fruggeri; +Cc: pablo, kadlec, netfilter-devel, coreteam, netdev, davem

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@kyup.com>
---
 net/netfilter/nfnetlink_queue.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
index 7d81d280cb4f..2e94603c2dec 100644
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -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;
 }
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] netfilter: nfnetlink_queue: Unregister pernet subsys in case of init failure
  2015-12-07 10:13 [PATCH] netfilter: nfnetlink_queue: Unregister pernet subsys in case of init failure Nikolay Borisov
@ 2015-12-07 12:29 ` Sergei Shtylyov
  2015-12-07 12:58   ` Nikolay Borisov
  0 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2015-12-07 12:29 UTC (permalink / raw)
  To: Nikolay Borisov, fruggeri
  Cc: pablo, kadlec, netfilter-devel, coreteam, netdev, davem

Hello.

On 12/07/2015 01:13 PM, Nikolay Borisov wrote:

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

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

> 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.

>
> Signed-off-by: Nikolay Borisov <kernel@kyup.com>

[...]

MBR, Sergei


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] netfilter: nfnetlink_queue: Unregister pernet subsys in case of init failure
  2015-12-07 12:29 ` Sergei Shtylyov
@ 2015-12-07 12:58   ` Nikolay Borisov
  2015-12-07 13:17     ` Pablo Neira Ayuso
  0 siblings, 1 reply; 5+ messages in thread
From: Nikolay Borisov @ 2015-12-07 12:58 UTC (permalink / raw)
  To: Sergei Shtylyov, fruggeri
  Cc: pablo, kadlec, netfilter-devel, coreteam, netdev, davem



On 12/07/2015 02:29 PM, Sergei Shtylyov wrote:
> Hello.
> 
> On 12/07/2015 01:13 PM, Nikolay Borisov wrote:
> 
>> Commit 3bfe049807c2403 ('netfilter: nfnetlink_{log,queue}:
> 
>    Double quotes please, that's what scripts/checkpatch.pl enforces now.
> 
>> 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.

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.

> 
>>
>> Signed-off-by: Nikolay Borisov <kernel@kyup.com>
> 
> [...]
> 
> MBR, Sergei
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] netfilter: nfnetlink_queue: Unregister pernet subsys in case of init failure
  2015-12-07 12:58   ` Nikolay Borisov
@ 2015-12-07 13:17     ` Pablo Neira Ayuso
  2015-12-09 13:48       ` [netfilter-core] " Pablo Neira Ayuso
  0 siblings, 1 reply; 5+ messages in thread
From: Pablo Neira Ayuso @ 2015-12-07 13:17 UTC (permalink / raw)
  To: Nikolay Borisov
  Cc: Sergei Shtylyov, fruggeri, kadlec, netfilter-devel, coreteam,
	netdev, davem

On Mon, Dec 07, 2015 at 02:58:44PM +0200, Nikolay Borisov wrote:
> 
> 
> On 12/07/2015 02:29 PM, Sergei Shtylyov wrote:
> > Hello.
> > 
> > On 12/07/2015 01:13 PM, Nikolay Borisov wrote:
> > 
> >> Commit 3bfe049807c2403 ('netfilter: nfnetlink_{log,queue}:
> > 
> >    Double quotes please, that's what scripts/checkpatch.pl enforces now.
> > 
> >> 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.
> 
> 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.

> Also I dunno if this should be marked for stable.

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

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [netfilter-core] [PATCH] netfilter: nfnetlink_queue: Unregister pernet subsys in case of init failure
  2015-12-07 13:17     ` Pablo Neira Ayuso
@ 2015-12-09 13:48       ` Pablo Neira Ayuso
  0 siblings, 0 replies; 5+ messages in thread
From: Pablo Neira Ayuso @ 2015-12-09 13:48 UTC (permalink / raw)
  To: Nikolay Borisov
  Cc: Sergei Shtylyov, netdev, fruggeri, coreteam, netfilter-devel,
	kadlec, davem

On Mon, Dec 07, 2015 at 02:17:46PM +0100, Pablo Neira Ayuso wrote:
> On Mon, Dec 07, 2015 at 02:58:44PM +0200, Nikolay Borisov wrote:
> > 
> > 
> > On 12/07/2015 02:29 PM, Sergei Shtylyov wrote:
> > > Hello.
> > > 
> > > On 12/07/2015 01:13 PM, Nikolay Borisov wrote:
> > > 
> > >> Commit 3bfe049807c2403 ('netfilter: nfnetlink_{log,queue}:
> > > 
> > >    Double quotes please, that's what scripts/checkpatch.pl enforces now.
> > > 
> > >> 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.
> > 
> > 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-12-09 13:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-07 10:13 [PATCH] netfilter: nfnetlink_queue: Unregister pernet subsys in case of init failure Nikolay Borisov
2015-12-07 12:29 ` Sergei Shtylyov
2015-12-07 12:58   ` Nikolay Borisov
2015-12-07 13:17     ` Pablo Neira Ayuso
2015-12-09 13:48       ` [netfilter-core] " Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).