* [PATCH] nfnetlink_log: fix silly refcount leak
@ 2010-02-24 19:18 Alexey Dobriyan
2010-02-26 16:49 ` Patrick McHardy
0 siblings, 1 reply; 2+ messages in thread
From: Alexey Dobriyan @ 2010-02-24 19:18 UTC (permalink / raw)
To: kaber; +Cc: netfilter-devel
Quick fix for memory/module refcount leak.
Reference count of listener instance never reaches 0.
Start/stop of ulogd2 is enough to trigger this bug!
Now, refcounting there looks very fishy in particular this code:
if (!try_module_get(THIS_MODULE)) {
...
and creation of listener instance with refcount 2,
so it may very well be ripped and redone. :-)
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
net/netfilter/nfnetlink_log.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -784,7 +784,7 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
}
instance_destroy(inst);
- goto out;
+ goto out_put;
default:
ret = -ENOTSUPP;
break;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] nfnetlink_log: fix silly refcount leak
2010-02-24 19:18 [PATCH] nfnetlink_log: fix silly refcount leak Alexey Dobriyan
@ 2010-02-26 16:49 ` Patrick McHardy
0 siblings, 0 replies; 2+ messages in thread
From: Patrick McHardy @ 2010-02-26 16:49 UTC (permalink / raw)
To: Alexey Dobriyan; +Cc: netfilter-devel
Alexey Dobriyan wrote:
> Quick fix for memory/module refcount leak.
> Reference count of listener instance never reaches 0.
>
> Start/stop of ulogd2 is enough to trigger this bug!
>
> Now, refcounting there looks very fishy in particular this code:
>
> if (!try_module_get(THIS_MODULE)) {
> ...
>
> and creation of listener instance with refcount 2,
> so it may very well be ripped and redone. :-)
Applied, thanks Alexey.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-02-26 16:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-24 19:18 [PATCH] nfnetlink_log: fix silly refcount leak Alexey Dobriyan
2010-02-26 16:49 ` Patrick McHardy
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).