diff mbox

[Linux,4.2-rc8+...v4.3-rc2] REGRESSION: ppp: circular locking dependency detected: [pppd] ppp_dev_uninit() | rtnl_lock()

Message ID CA+icZUU0rUJZRb4R+F1N98hbfb0rbmbZ0=Jf60zb30SQHKi1Ug@mail.gmail.com
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Sedat Dilek Sept. 23, 2015, 9:21 p.m. UTC
On Wed, Sep 23, 2015 at 10:46 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Wed, Sep 23, 2015 at 12:38 PM, Guillaume Nault <g.nault@alphalink.fr> wrote:
>> On Wed, Sep 23, 2015 at 08:06:16AM +0200, Sedat Dilek wrote:
>>> Without reverting the below culprit ppp patch...
>>>
>>> commit/?id=8cb775bc0a34dc596837e7da03fd22c747be618b
>>> ("ppp: fix device unregistration upon netns deletion")
>>>
>>> ...I have an unstable Internet connection via Network-Manager/ModemManager.
>>>
>>> First I saw this with Linux v4.2.
>>>
>>
>> Thanks for reporting the issue. Can you test this patch ?
>>
>> ---
>> diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
>> index 0481daf..ed00446 100644
>> --- a/drivers/net/ppp/ppp_generic.c
>> +++ b/drivers/net/ppp/ppp_generic.c
>> @@ -2755,6 +2755,7 @@ static struct ppp *ppp_create_interface(struct net *net, int unit,
>>          */
>>         dev_net_set(dev, net);
>>
>> +       rtnl_lock();
>>         mutex_lock(&pn->all_ppp_mutex);
>>
>>         if (unit < 0) {
>> @@ -2785,7 +2786,7 @@ static struct ppp *ppp_create_interface(struct net *net, int unit,
>>         ppp->file.index = unit;
>>         sprintf(dev->name, "ppp%d", unit);
>>
>> -       ret = register_netdev(dev);
>> +       ret = register_netdevice(dev);
>>         if (ret != 0) {
>>                 unit_put(&pn->units_idr, unit);
>>                 netdev_err(ppp->dev, "PPP: couldn't register device %s (%d)\n",
>> @@ -2797,6 +2798,7 @@ static struct ppp *ppp_create_interface(struct net *net, int unit,
>>
>>         atomic_inc(&ppp_unit_count);
>>         mutex_unlock(&pn->all_ppp_mutex);
>> +       rtnl_unlock();
>>
>>         *retp = 0;
>>         return ppp;
>
> I have adapted your patch against Linux v4.2.1 and it fixes the issue for me.
> Testcase:
> 1. Stop network-manager and unload "PPP Deflate Compression module".
> 2. Reload module and restart NM.
> ( No call-traces pointing to ppp. )
>
> Do you mind to send a proper patch with subject-line and commit-message?
> Can you embed the Fixes-tag and give credits like Reported-by/Tested-by?
>
> Thanks.
>

Do not forget CC-stable Tag, too.

     Cc: stable@vger.kernel.org# v4.2+

See attached patch for-4.3.

- sed@ -

[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches#n187
[2] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches#n297

Comments

Guillaume Nault Sept. 24, 2015, 11:03 a.m. UTC | #1
On Wed, Sep 23, 2015 at 11:21:50PM +0200, Sedat Dilek wrote:
> On Wed, Sep 23, 2015 at 10:46 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> > On Wed, Sep 23, 2015 at 12:38 PM, Guillaume Nault <g.nault@alphalink.fr> wrote:
> > Do you mind to send a proper patch with subject-line and commit-message?
> > Can you embed the Fixes-tag and give credits like Reported-by/Tested-by?
>
I've just sent the patch to netdev.

> Do not forget CC-stable Tag, too.
> 
>      Cc: stable@vger.kernel.org# v4.2+
>
Well, that's not how it works for netdev. DaveM handles stable
submissions on his own.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sedat Dilek Sept. 24, 2015, 4:19 p.m. UTC | #2
On Thu, Sep 24, 2015 at 1:03 PM, Guillaume Nault <g.nault@alphalink.fr> wrote:
> On Wed, Sep 23, 2015 at 11:21:50PM +0200, Sedat Dilek wrote:
>> On Wed, Sep 23, 2015 at 10:46 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>> > On Wed, Sep 23, 2015 at 12:38 PM, Guillaume Nault <g.nault@alphalink.fr> wrote:
>> > Do you mind to send a proper patch with subject-line and commit-message?
>> > Can you embed the Fixes-tag and give credits like Reported-by/Tested-by?
>>
> I've just sent the patch to netdev.
>
>> Do not forget CC-stable Tag, too.
>>
>>      Cc: stable@vger.kernel.org# v4.2+
>>
> Well, that's not how it works for netdev. DaveM handles stable
> submissions on his own.

Thanks for the patch!

OK, I guess DaveM will take your patch into net.git#master first...
and tag it there with CC-stable?
Linux v4.2+ is affected as well.
So it will be good when GregKH might consider this patch for inclusion
into Linux 4.2.y series.

- Sedat -
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Sept. 24, 2015, 6 p.m. UTC | #3
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Thu, 24 Sep 2015 18:19:16 +0200

> OK, I guess DaveM will take your patch into net.git#master first...
> and tag it there with CC-stable?

I do not tag anything with stable.

I queue it up into a patchwork bundle and explicitly submit those
patches to stable@vger.kernel.org at a time of my own choosing.

This is a FAQ, documented in the kernel Documentation/ subdirectory.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sedat Dilek Sept. 25, 2015, 5:58 a.m. UTC | #4
On Thu, Sep 24, 2015 at 8:00 PM, David Miller <davem@davemloft.net> wrote:
> From: Sedat Dilek <sedat.dilek@gmail.com>
> Date: Thu, 24 Sep 2015 18:19:16 +0200
>
>> OK, I guess DaveM will take your patch into net.git#master first...
>> and tag it there with CC-stable?
>
> I do not tag anything with stable.
>
> I queue it up into a patchwork bundle and explicitly submit those
> patches to stable@vger.kernel.org at a time of my own choosing.
>
> This is a FAQ, documented in the kernel Documentation/ subdirectory.

OK, so this is a special handling for netdev?
I normally look at "SubmittingPatches" documentation [1] and looked in
this case especially at [2].
Can you point me to this "FAQ"?

Where do you include Guillaume's patch - in net.git#master?

Since Linux v4.2 my Internet connection via UMTS/HSPA USB modem is "unstable".
For me this is an important fix.

Thanks.

- Sedat -

[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches
[2] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches#n297
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sedat Dilek Sept. 25, 2015, 8:46 a.m. UTC | #5
On Fri, Sep 25, 2015 at 7:58 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Thu, Sep 24, 2015 at 8:00 PM, David Miller <davem@davemloft.net> wrote:
>> From: Sedat Dilek <sedat.dilek@gmail.com>
>> Date: Thu, 24 Sep 2015 18:19:16 +0200
>>
>>> OK, I guess DaveM will take your patch into net.git#master first...
>>> and tag it there with CC-stable?
>>
>> I do not tag anything with stable.
>>
>> I queue it up into a patchwork bundle and explicitly submit those
>> patches to stable@vger.kernel.org at a time of my own choosing.
>>
>> This is a FAQ, documented in the kernel Documentation/ subdirectory.
>
> OK, so this is a special handling for netdev?
> I normally look at "SubmittingPatches" documentation [1] and looked in
> this case especially at [2].
> Can you point me to this "FAQ"?
>

OK, I found it by myself.

[ Documentation/stable_kernel_rules.txt ]

"Procedure for submitting patches to the -stable tree:

 - If the patch covers files in net/ or drivers/net please follow netdev stable
   submission guidelines as described in
   Documentation/networking/netdev-FAQ.txt"

[ Documentation/networking/netdev-FAQ.txt ]

 "Q: I have created a network patch and I think it should be backported to
   stable.  Should I add a "Cc: stable@vger.kernel.org" like the references
   in the kernel's Documentation/ directory say?

A: No.  See above answer.  In short, if you think it really belongs in
   stable, then ensure you write a decent commit log that describes who
   gets impacted by the bugfix and how it manifests itself, and when the
   bug was introduced.  If you do that properly, then the commit will
   get handled appropriately and most likely get put in the patchworks
   stable queue if it really warrants it.

   If you think there is some valid information relating to it being in
   stable that does _not_ belong in the commit log, then use the three
   dash marker line as described in Documentation/SubmittingPatches to
   temporarily embed that information into the patch that you send."

[3] collects all netdev "stable" patches.

I hope I remember that for the next time dealing with such issues.

- Sedat -

[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/stable_kernel_rules.txt#n30
[2] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/netdev-FAQ.txt#n155
[3] http://patchwork.ozlabs.org/bundle/davem/stable/?state=*

> Where do you include Guillaume's patch - in net.git#master?
>
> Since Linux v4.2 my Internet connection via UMTS/HSPA USB modem is "unstable".
> For me this is an important fix.
>
> Thanks.
>
> - Sedat -
>
> [1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches
> [2] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches#n297
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

From 1109c55b54703416593be6275aeaad9aefcfe4b1 Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Wed, 23 Sep 2015 22:54:48 +0200
Subject: [PATCH] ppp: Fix circular locking dependency in
 ppp_create_interface()

From: Guillaume Nault <g.nault@alphalink.fr>

For more details see [1].

[1] http://marc.info/?t=144298854300001&r=1&w=2

Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: stable@vger.kernel.org # v4.2+
Fixes: 8cb775bc0a34 ("ppp: fix device unregistration upon netns deletion")
CC: Guillaume Nault <g.nault@alphalink.fr>
CC: David S. Miller <davem@davemloft.net>
CC: netdev@vger.kernel.org" <netdev@vger.kernel.org>
---
 drivers/net/ppp/ppp_generic.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index 0481daf9201a..ed00446759b2 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -2755,6 +2755,7 @@  static struct ppp *ppp_create_interface(struct net *net, int unit,
 	 */
 	dev_net_set(dev, net);
 
+	rtnl_lock();
 	mutex_lock(&pn->all_ppp_mutex);
 
 	if (unit < 0) {
@@ -2785,7 +2786,7 @@  static struct ppp *ppp_create_interface(struct net *net, int unit,
 	ppp->file.index = unit;
 	sprintf(dev->name, "ppp%d", unit);
 
-	ret = register_netdev(dev);
+	ret = register_netdevice(dev);
 	if (ret != 0) {
 		unit_put(&pn->units_idr, unit);
 		netdev_err(ppp->dev, "PPP: couldn't register device %s (%d)\n",
@@ -2797,6 +2798,7 @@  static struct ppp *ppp_create_interface(struct net *net, int unit,
 
 	atomic_inc(&ppp_unit_count);
 	mutex_unlock(&pn->all_ppp_mutex);
+	rtnl_unlock();
 
 	*retp = 0;
 	return ppp;
-- 
2.5.3