From: David Miller <davem@davemloft.net>
To: den@openvz.org
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-2.6] [RAW]: Raw socket leak.
Date: Wed, 04 Jun 2008 15:16:36 -0700 (PDT) [thread overview]
Message-ID: <20080604.151636.212578810.davem@davemloft.net> (raw)
In-Reply-To: <1212154985-28103-1-git-send-email-den@openvz.org>
From: "Denis V. Lunev" <den@openvz.org>
Date: Fri, 30 May 2008 17:43:05 +0400
> The program below just leaks the raw kernel socket
>
> int main() {
> int fd = socket(PF_INET, SOCK_RAW, IPPROTO_UDP);
> struct sockaddr_in addr;
>
> memset(&addr, 0, sizeof(addr));
> inet_aton("127.0.0.1", &addr.sin_addr);
> addr.sin_family = AF_INET;
> addr.sin_port = htons(2048);
> sendto(fd, "a", 1, MSG_MORE, &addr, sizeof(addr));
> return 0;
> }
>
> Corked packet is allocated via sock_wmalloc which holds the owner socket,
> so one should uncork it and flush all pending data on close. Do this in the
> same way as in UDP.
>
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> Acked-by: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Applied, thanks Denis.
prev parent reply other threads:[~2008-06-04 22:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-30 13:43 [PATCH net-2.6] [RAW]: Raw socket leak Denis V. Lunev
2008-06-04 22:16 ` David Miller [this message]
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=20080604.151636.212578810.davem@davemloft.net \
--to=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 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).