[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1433794190.4616.8.camel@stressinduktion.org>
Date: Mon, 08 Jun 2015 22:09:50 +0200
From: Hannes Frederic Sowa <hannes@...essinduktion.org>
To: mleitner@...hat.com
Cc: Neil Horman <nhorman@...driver.com>, netdev@...r.kernel.org,
linux-sctp@...r.kernel.org, Daniel Borkmann <daniel@...earbox.net>,
Vlad Yasevich <vyasevich@...il.com>,
Michio Honda <micchie@....wide.ad.jp>
Subject: Re: [PATCH v3 2/2] sctp: fix ASCONF list handling
On Fr, 2015-06-05 at 14:08 -0300, mleitner@...hat.com wrote:
> if (sp->do_auto_asconf) {
> + spin_lock_bh(&sock_net(sk)->sctp.addr_wq_lock);
> sp->do_auto_asconf = 0;
> - list_del(&sp->auto_asconf_list);
> + list_del_rcu(&sp->auto_asconf_list);
> + spin_unlock_bh(&sock_net(sk)->sctp.addr_wq_lock);
> }
This also looks a bit unsafe to me:
My proposal would be to sock_hold/sock_put the sockets when pushing them
onto the auto_asconf_list and defer the modifications on the list until
we don't need to hold socket lock anymore (in syscalls we do have a reference
anyway).
addr_wq_lock then is only used either without lock_sock at all or only
in order addr_wq_lock -> lock_sock, which does not cause any locking
ordering issues.
Bye,
Hannes
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists