netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: fleitner@redhat.com
Cc: dlstevens@us.ibm.com, acme@ghostprotocols.net, netdev@vger.kernel.org
Subject: Re: [PATCH] [NET]: fix multicast list when cloning sockets
Date: Mon, 30 Jul 2007 19:01:44 -0700 (PDT)	[thread overview]
Message-ID: <20070730.190144.26963470.davem@davemloft.net> (raw)
In-Reply-To: <20070730160448.GA4002@redhat.com>

From: Flavio Leitner <fleitner@redhat.com>
Date: Mon, 30 Jul 2007 13:04:48 -0300

> 
> The sock_copy() function uses memcpy() to clone the socket
> including the struct ip_mc_socklist *mc_list pointer.
> 
> The ip_mc_drop_socket() function is called when socket is closed
> to free these objects leaving the other sockets cloned from the
> same master socket with invalid pointers.
> 
> This patch sets mc_list of cloned socket to NULL.
> 
> Signed-off-by: Flavio Leitner <fleitner@redhat.com>

Allowing non-datagram sockets to end up with a non-NULL inet->mc_list
in the first place is a bug.

Multicast subscriptions cannot even be used with TCP and DCCP, which
are the only two users of these connection oriented socket functions.

The first thing that TCP and DCCP do, in fact, for input packet
processing is drop the packet if it is not unicast.

Therefore the fix really is for the inet layer to reject multicast
subscription requests on sockets for which that absolutely does not
make sense.  There is no reason these functions in
inet_connection_sock.c should need to be mindful of multicast
state. :-)


  reply	other threads:[~2007-07-31  2:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-30 16:04 [PATCH] [NET]: fix multicast list when cloning sockets Flavio Leitner
2007-07-31  2:01 ` David Miller [this message]
2007-07-31  3:00   ` Arnaldo Carvalho de Melo
2007-07-31 18:29     ` Flavio Leitner
2007-08-25  5:16       ` David Miller

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=20070730.190144.26963470.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=acme@ghostprotocols.net \
    --cc=dlstevens@us.ibm.com \
    --cc=fleitner@redhat.com \
    --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).