From: Patrick McHardy <kaber@trash.net>
To: "Denis V. Lunev" <den@openvz.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH] memory leak in netlink user->kernel processing
Date: Mon, 01 Oct 2007 16:36:26 +0200 [thread overview]
Message-ID: <470105EA.3090209@trash.net> (raw)
In-Reply-To: <20071001142907.GA10022@iris.sw.ru>
Denis V. Lunev wrote:
> netlink_kernel_create can be called with NULL as an input callback in several
> places, f.e. in kobject_uevent_init. This means that if one sends packet from
> user to kernel for such a socket, the packet will be leaked in the socket
> queue forever.
>
> This patch adds a simple generic cleanup callback for these sockets.
This should already be handled by netlink_getsockbypid:
/* Don't bother queuing skb if kernel socket has no input
function */
nlk = nlk_sk(sock);
if ((nlk->pid == 0 && !nlk->data_ready) ||
(sock->sk_state == NETLINK_CONNECTED &&
nlk->dst_pid != nlk_sk(ssk)->pid)) {
sock_put(sock);
return ERR_PTR(-ECONNREFUSED);
}
next prev parent reply other threads:[~2007-10-01 14:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-01 14:29 [PATCH] memory leak in netlink user->kernel processing Denis V. Lunev
2007-10-01 14:36 ` Patrick McHardy [this message]
2007-10-01 14:58 ` Denis V. Lunev
2007-10-01 15:03 ` Patrick McHardy
2007-10-01 16:42 ` Eric W. Biederman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=470105EA.3090209@trash.net \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=den@openvz.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.