All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Priebe <s.priebe@profihost.ag>
To: Hannes Frederic Sowa <hannes@stressinduktion.org>,
	Florian Weimer <fweimer@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, herbert@gondor.apana.org.au
Subject: Re: Asterisk deadlocks since Kernel 4.1
Date: Fri, 4 Dec 2015 19:26:12 +0100	[thread overview]
Message-ID: <5661DAC4.8040909@profihost.ag> (raw)
In-Reply-To: <8737vlt6xb.fsf@stressinduktion.org>

Hi,

I got it fixed / at least not live / deadlocking by doing applying the 
following patch - which is the diff of the commits below on top of 4.1.13.

patch:
http://pastebin.com/raw.php?i=hiuq4bsW

all commits / changes in reverse order:

* 0ceb380 - (6 weeks ago) netlink: fix locking around 
NETLINK_LIST_MEMBERSHIPS - David Herrmann (HEAD)
* c3f272b - (7 weeks ago) netlink: Trim skb to alloc size to avoid 
MSG_TRUNC - Arad, Ronen
* 9f87e0c - (2 months ago) netlink: Replace rhash_portid with bound - 
Herbert Xu
* 35e9890 - (3 months ago) netlink: Fix autobind race condition that 
leads to zero port ID - Herbert Xu
* f1d1215 - (3 months ago) netlink, mmap: transform mmap skb into full 
skb on taps - Daniel Borkmann
* faad871 - (3 months ago) netlink, mmap: fix edge-case leakages in nf 
queue zero-copy - Daniel Borkmann
* fb18c94 - (3 months ago) netlink, mmap: don't walk rx ring on poll if 
receive queue non-empty - Daniel Borkmann
* da13789 - (3 months ago) netlink: rx mmap: fix POLLIN condition - 
Ken-ichirou MATSUZAWA
* 808071f - (3 months ago) netlink: mmap: fix lookup frame position - 
Ken-ichirou MATSUZAWA
* 589bfd5 - (3 months ago) netlink: add NETLINK_CAP_ACK socket option - 
Christophe Ricard
* d23c4eb - (4 months ago) netlink: mmap: fix tx type check - 
Ken-ichirou MATSUZAWA
* 5dcc50a - (4 months ago) netlink: make sure -EBUSY won't escape from 
netlink_insert - Daniel Borkmann
* ada2b3e - (5 months ago) netlink: don't hold mutex in rcu callback 
when releasing mmapd ring - Florian Westphal
* e0f54a3 - (5 months ago) netlink: Delete an unnecessary check before 
the function call "module_put" - Markus Elfring
* 0a5bdaf - (6 months ago) netlink: add API to retrieve all group 
memberships - David Herrmann
* 30c6472 - (7 months ago) netlink: Use random autobind rover - Herbert Xu
* 021a670 - (7 months ago) netlink: Create kernel netlink sockets in the 
proper network namespace - Eric W. Biederman
* e1b01b4 - (7 months ago) net: Pass kern from net_proto_family.create 
to sk_alloc - Eric W. Biederman
* dd4b3c9 - (7 months ago) netlink: rename private flags and states - 
Nicolas Dichtel
* 0356126 - (2 days ago) Revert "netlink: don't hold mutex in rcu 
callback when releasing mmapd ring" - Stefan Priebe
* 231d0da - (2 days ago) Revert "netlink: make sure -EBUSY won't escape 
from netlink_insert" - Stefan Priebe
* e0f56af1 - (2 days ago) Revert "netlink, mmap: transform mmap skb into 
full skb on taps" - Stefan Priebe
* 23a0326 - (2 days ago) Revert "netlink: Fix autobind race condition 
that leads to zero port ID" - Stefan Priebe
* 97f4677 - (2 days ago) Revert "netlink: Replace rhash_portid with 
bound" - Stefan Priebe
* 40c851fe - (2 days ago) Revert "netlink: Trim skb to alloc size to 
avoid MSG_TRUNC" - Stefan Priebe
* 1f2ce4a - (4 weeks ago) Linux 4.1.13 - Greg Kroah-Hartman (v4.1.13, 
origin/linux-4.1.y)

So the netlink code is in line with 4.3.

Stefan

Am 02.12.2015 um 12:40 schrieb Hannes Frederic Sowa:
> Hello Stefan,
>
> Stefan Priebe - Profihost AG <s.priebe@profihost.ag> writes:
>
>
>> here are the results.
>>
>> It works with 4.1.
>> It works with 4.2.
>> It does not work with 4.1.13.
>>
>> git bisect tells me it stopped working after those two commits were applied:
>>
>> commit d48623677191e0f035d7afd344f92cf880b01f8e
>> Author: Herbert Xu <herbert@gondor.apana.org.au>
>> Date:   Tue Sep 22 11:38:56 2015 +0800
>>
>>      netlink: Replace rhash_portid with bound
>>
>> commit 4e27762417669cb459971635be550eb7b5598286
>> Author: Herbert Xu <herbert@gondor.apana.org.au>
>> Date:   Fri Sep 18 19:16:50 2015 +0800
>>
>>      netlink: Fix autobind race condition that leads to zero port ID
>
> Cool, thanks a lot. Does this patch make a difference?
>
> diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
> index 59651af..278e94c 100644
> --- a/net/netlink/af_netlink.c
> +++ b/net/netlink/af_netlink.c
> @@ -1137,7 +1137,7 @@ static int netlink_insert(struct sock *sk, u32 portid)
>
>   	/* We need to ensure that the socket is hashed and visible. */
>   	smp_wmb();
> -	nlk_sk(sk)->bound = portid;
> +	nlk_sk(sk)->bound = true;
>
>   err:
>   	release_sock(sk);
>

  parent reply	other threads:[~2015-12-04 18:26 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-17 14:44 Asterisk deadlocks since Kernel 4.1 Stefan Priebe - Profihost AG
2015-11-17 19:15 ` Thomas Gleixner
2015-11-17 19:27   ` Stefan Priebe
2015-11-17 19:43     ` Thomas Gleixner
2015-11-18 20:23       ` Stefan Priebe
2015-11-18 21:00         ` Hannes Frederic Sowa
2015-11-18 21:20           ` Stefan Priebe
2015-11-18 21:22             ` Hannes Frederic Sowa
2015-11-19  9:35               ` Stefan Priebe - Profihost AG
2015-11-18 21:18         ` Florian Weimer
2015-11-18 21:23           ` Stefan Priebe
2015-11-19  9:39             ` Florian Weimer
2015-11-18 21:36           ` Stefan Priebe
2015-11-18 21:40             ` Hannes Frederic Sowa
2015-11-18 21:42               ` Stefan Priebe
2015-11-18 21:58                 ` Hannes Frederic Sowa
2015-11-19  9:44             ` Florian Weimer
2015-11-19  9:49               ` Stefan Priebe - Profihost AG
2015-11-19  9:56                 ` Stefan Priebe - Profihost AG
2015-11-19 11:41                   ` Hannes Frederic Sowa
2015-11-19 11:43                     ` Stefan Priebe - Profihost AG
2015-11-19 12:41                       ` Hannes Frederic Sowa
2015-11-19 12:46                         ` Stefan Priebe - Profihost AG
2015-11-19 13:19                           ` Florian Weimer
2015-11-19 19:51                             ` Stefan Priebe
2015-11-23 12:44                               ` Stefan Priebe - Profihost AG
2015-11-23 12:57                                 ` Hannes Frederic Sowa
2015-11-24 13:35                                   ` Stefan Priebe - Profihost AG
2015-12-02  9:45                                   ` Stefan Priebe - Profihost AG
2015-12-02 11:40                                     ` Hannes Frederic Sowa
2015-12-02 17:51                                       ` Philipp Hahn
2015-12-03  8:23                                       ` Stefan Priebe - Profihost AG
2015-12-04 18:26                                       ` Stefan Priebe [this message]
2015-12-05  1:08                                         ` Herbert Xu
2015-12-06 20:56                                           ` Stefan Priebe
2015-12-07  1:20                                             ` Herbert Xu
2015-12-07  6:58                                               ` Stefan Priebe - Profihost AG
2015-12-08  6:13                                                 ` netlink: Add missing goto statement to netlink_insert Herbert Xu
2015-12-08 16:21                                                   ` David Miller
2015-12-09  3:29                                                   ` Greg KH
2015-12-09  3:30                                                   ` Patch "netlink: Add missing goto statement to netlink_insert" has been added to the 4.1-stable tree gregkh
2015-12-07  7:41                                             ` Asterisk deadlocks since Kernel 4.1 Philipp Hahn
2015-12-05 14:19                                       ` Philipp Matthias Hahn
2015-12-05 15:34                                         ` Stefan Priebe
2015-12-02 17:15                                     ` Philipp Hahn
2015-12-02 18:23                                       ` Hannes Frederic Sowa
  -- strict thread matches above, loose matches on Subject: below --
2015-11-17 14:46 Stefan Priebe - Profihost AG

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=5661DAC4.8040909@profihost.ag \
    --to=s.priebe@profihost.ag \
    --cc=fweimer@redhat.com \
    --cc=hannes@stressinduktion.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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.