netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: marcelo.leitner@gmail.com
Cc: nhorman@tuxdriver.com, hannes@stressinduktion.org,
	netdev@vger.kernel.org, linux-sctp@vger.kernel.org,
	daniel@iogearbox.net, vyasevich@gmail.com,
	micchie@sfc.wide.ad.jp
Subject: Re: [PATCH v5] sctp: fix ASCONF list handling
Date: Sun, 14 Jun 2015 12:56:01 -0700 (PDT)	[thread overview]
Message-ID: <20150614.125601.1919783457395979333.davem@davemloft.net> (raw)
In-Reply-To: <57c14bf7ac9eba1ceb76615cf52f5955c8349988.1434114814.git.marcelo.leitner@gmail.com>

From: marcelo.leitner@gmail.com
Date: Fri, 12 Jun 2015 10:16:41 -0300

> From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> 
> ->auto_asconf_splist is per namespace and mangled by functions like
> sctp_setsockopt_auto_asconf() which doesn't guarantee any serialization.
> 
> Also, the call to inet_sk_copy_descendant() was backuping
> ->auto_asconf_list through the copy but was not honoring
> ->do_auto_asconf, which could lead to list corruption if it was
> different between both sockets.
> 
> This commit thus fixes the list handling by using ->addr_wq_lock
> spinlock to protect the list. A special handling is done upon socket
> creation and destruction for that. Error handlig on sctp_init_sock()
> will never return an error after having initialized asconf, so
> sctp_destroy_sock() can be called without addrq_wq_lock. The lock now
> will be take on sctp_close_sock(), before locking the socket, so we
> don't do it in inverse order compared to sctp_addr_wq_timeout_handler().
> 
> Instead of taking the lock on sctp_sock_migrate() for copying and
> restoring the list values, it's preferred to avoid rewritting it by
> implementing sctp_copy_descendant().
> 
> Issue was found with a test application that kept flipping sysctl
> default_auto_asconf on and off, but one could trigger it by issuing
> simultaneous setsockopt() calls on multiple sockets or by
> creating/destroying sockets fast enough. This is only triggerable
> locally.
> 
> Fixes: 9f7d653b67ae ("sctp: Add Auto-ASCONF support (core).")
> Reported-by: Ji Jianwen <jiji@redhat.com>
> Suggested-by: Neil Horman <nhorman@tuxdriver.com>
> Suggested-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

Applied, thank you.

  reply	other threads:[~2015-06-14 19:56 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28  0:52 [PATCH] sctp: fix ASCONF list handling mleitner
2015-05-28 10:15 ` Neil Horman
2015-05-28 11:17   ` Marcelo Ricardo Leitner
2015-05-28 13:27     ` Marcelo Ricardo Leitner
2015-05-28 14:31       ` Neil Horman
2015-05-28 14:46       ` Marcelo Ricardo Leitner
2015-05-29 13:17         ` Neil Horman
2015-05-29 16:50           ` Marcelo Ricardo Leitner
2015-06-01 14:00             ` Neil Horman
2015-06-01 22:28               ` Marcelo Ricardo Leitner
2015-06-02 13:48                 ` Neil Horman
2015-06-03 16:54                   ` [PATCH v2 1/2] sctp: rcu-ify addr_waitq mleitner
2015-06-03 17:19                     ` Marcelo Ricardo Leitner
2015-06-04 14:27                     ` Neil Horman
2015-06-05 14:18                       ` Marcelo Ricardo Leitner
2015-06-05 17:08                       ` [PATCH v3 " mleitner
2015-06-08 13:58                         ` Neil Horman
2015-06-08 14:46                         ` Hannes Frederic Sowa
2015-06-08 14:59                           ` Hannes Frederic Sowa
2015-06-08 15:19                             ` Neil Horman
2015-06-08 15:37                               ` Hannes Frederic Sowa
2015-06-09 11:36                                 ` Neil Horman
2015-06-09 19:32                                   ` Marcelo Ricardo Leitner
2015-06-10 13:31                                     ` Marcelo Ricardo Leitner
2015-06-10 19:14                                       ` Neil Horman
2015-06-11 14:30                                         ` [PATCH v4] sctp: fix ASCONF list handling mleitner
2015-06-11 23:31                                           ` David Miller
2015-06-12 13:16                                             ` [PATCH v5] " marcelo.leitner
2015-06-14 19:56                                               ` David Miller [this message]
2015-06-05 17:08                       ` [PATCH v3 2/2] " mleitner
2015-06-08 20:09                         ` Hannes Frederic Sowa
2015-06-09 15:37                           ` Marcelo Ricardo Leitner
2015-06-09 17:04                             ` Neil Horman
2015-06-03 16:54                   ` [PATCH v2 " mleitner

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=20150614.125601.1919783457395979333.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=daniel@iogearbox.net \
    --cc=hannes@stressinduktion.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=micchie@sfc.wide.ad.jp \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=vyasevich@gmail.com \
    /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).