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

2015-09-25 Thread Sedat Dilek
On Fri, Sep 25, 2015 at 7:58 AM, Sedat Dilek  wrote:
> On Thu, Sep 24, 2015 at 8:00 PM, David Miller  wrote:
>> From: Sedat Dilek 
>> 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 sta...@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: sta...@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 linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2015-09-25 Thread Sedat Dilek
On Fri, Sep 25, 2015 at 7:58 AM, Sedat Dilek  wrote:
> On Thu, Sep 24, 2015 at 8:00 PM, David Miller  wrote:
>> From: Sedat Dilek 
>> 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 sta...@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: sta...@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 linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2015-09-24 Thread Sedat Dilek
On Thu, Sep 24, 2015 at 8:00 PM, David Miller  wrote:
> From: Sedat Dilek 
> 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 sta...@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 linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2015-09-24 Thread David Miller
From: Sedat Dilek 
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 sta...@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 linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2015-09-24 Thread Sedat Dilek
On Thu, Sep 24, 2015 at 1:03 PM, Guillaume Nault  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  wrote:
>> > On Wed, Sep 23, 2015 at 12:38 PM, Guillaume Nault  
>> > 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: sta...@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 linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2015-09-24 Thread Guillaume Nault
On Wed, Sep 23, 2015 at 11:21:50PM +0200, Sedat Dilek wrote:
> On Wed, Sep 23, 2015 at 10:46 PM, Sedat Dilek  wrote:
> > On Wed, Sep 23, 2015 at 12:38 PM, Guillaume Nault  
> > 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: sta...@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 linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2015-09-24 Thread Guillaume Nault
On Wed, Sep 23, 2015 at 11:21:50PM +0200, Sedat Dilek wrote:
> On Wed, Sep 23, 2015 at 10:46 PM, Sedat Dilek  wrote:
> > On Wed, Sep 23, 2015 at 12:38 PM, Guillaume Nault  
> > 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: sta...@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 linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2015-09-24 Thread Sedat Dilek
On Thu, Sep 24, 2015 at 1:03 PM, Guillaume Nault  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  wrote:
>> > On Wed, Sep 23, 2015 at 12:38 PM, Guillaume Nault  
>> > 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: sta...@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 linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2015-09-24 Thread David Miller
From: Sedat Dilek 
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 sta...@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 linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2015-09-24 Thread Sedat Dilek
On Thu, Sep 24, 2015 at 8:00 PM, David Miller  wrote:
> From: Sedat Dilek 
> 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 sta...@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 linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2015-09-23 Thread Sedat Dilek
On Wed, Sep 23, 2015 at 10:46 PM, Sedat Dilek  wrote:
> On Wed, Sep 23, 2015 at 12:38 PM, Guillaume Nault  
> 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(>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(>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(_unit_count);
>> mutex_unlock(>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: sta...@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
From 1109c55b54703416593be6275aeaad9aefcfe4b1 Mon Sep 17 00:00:00 2001
From: Sedat Dilek 
Date: Wed, 23 Sep 2015 22:54:48 +0200
Subject: [PATCH] ppp: Fix circular locking dependency in
 ppp_create_interface()

From: Guillaume Nault 

For more details see [1].

[1] http://marc.info/?t=14429885431=1=2

Reported-by: Sedat Dilek 
Tested-by: Sedat Dilek 
Cc: sta...@vger.kernel.org # v4.2+
Fixes: 8cb775bc0a34 ("ppp: fix device unregistration upon netns deletion")
CC: Guillaume Nault 
CC: David S. Miller 
CC: net...@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(>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(>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(_unit_count);
 	mutex_unlock(>all_ppp_mutex);
+	rtnl_unlock();
 
 	*retp = 0;
 	return ppp;
-- 
2.5.3



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

2015-09-23 Thread Sedat Dilek
On Wed, Sep 23, 2015 at 12:38 PM, Guillaume Nault  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(>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(>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(_unit_count);
> mutex_unlock(>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.

- Sedat -
From d4ace3e00129687b680977ecc5ea4c9a03e35b63 Mon Sep 17 00:00:00 2001
From: Sedat Dilek 
Date: Wed, 23 Sep 2015 22:33:31 +0200
Subject: [PATCH] ppp: Fix circular locking dependency

---
 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 fa8f5046afe9..487be20b6b12 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -2742,6 +2742,7 @@ static struct ppp *ppp_create_interface(struct net *net, int unit,
 	 */
 	dev_net_set(dev, net);
 
+	rtnl_lock();
 	mutex_lock(>all_ppp_mutex);
 
 	if (unit < 0) {
@@ -2772,7 +2773,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(>units_idr, unit);
 		netdev_err(ppp->dev, "PPP: couldn't register device %s (%d)\n",
@@ -2784,6 +2785,7 @@ static struct ppp *ppp_create_interface(struct net *net, int unit,
 
 	atomic_inc(_unit_count);
 	mutex_unlock(>all_ppp_mutex);
+	rtnl_unlock();
 
 	*retp = 0;
 	return ppp;
-- 
2.5.3



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

2015-09-23 Thread Guillaume Nault
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(>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(>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(_unit_count);
mutex_unlock(>all_ppp_mutex);
+   rtnl_unlock();
 
*retp = 0;
return ppp;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2015-09-23 Thread Guillaume Nault
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(>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(>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(_unit_count);
mutex_unlock(>all_ppp_mutex);
+   rtnl_unlock();
 
*retp = 0;
return ppp;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2015-09-23 Thread Sedat Dilek
On Wed, Sep 23, 2015 at 10:46 PM, Sedat Dilek  wrote:
> On Wed, Sep 23, 2015 at 12:38 PM, Guillaume Nault  
> 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(>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(>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(_unit_count);
>> mutex_unlock(>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: sta...@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
From 1109c55b54703416593be6275aeaad9aefcfe4b1 Mon Sep 17 00:00:00 2001
From: Sedat Dilek 
Date: Wed, 23 Sep 2015 22:54:48 +0200
Subject: [PATCH] ppp: Fix circular locking dependency in
 ppp_create_interface()

From: Guillaume Nault 

For more details see [1].

[1] http://marc.info/?t=14429885431=1=2

Reported-by: Sedat Dilek 
Tested-by: Sedat Dilek 
Cc: sta...@vger.kernel.org # v4.2+
Fixes: 8cb775bc0a34 ("ppp: fix device unregistration upon netns deletion")
CC: Guillaume Nault 
CC: David S. Miller 
CC: net...@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(>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(>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(_unit_count);
 	mutex_unlock(>all_ppp_mutex);
+	rtnl_unlock();
 
 	*retp = 0;
 	return ppp;
-- 
2.5.3



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

2015-09-23 Thread Sedat Dilek
On Wed, Sep 23, 2015 at 12:38 PM, Guillaume Nault  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(>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(>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(_unit_count);
> mutex_unlock(>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.

- Sedat -
From d4ace3e00129687b680977ecc5ea4c9a03e35b63 Mon Sep 17 00:00:00 2001
From: Sedat Dilek 
Date: Wed, 23 Sep 2015 22:33:31 +0200
Subject: [PATCH] ppp: Fix circular locking dependency

---
 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 fa8f5046afe9..487be20b6b12 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -2742,6 +2742,7 @@ static struct ppp *ppp_create_interface(struct net *net, int unit,
 	 */
 	dev_net_set(dev, net);
 
+	rtnl_lock();
 	mutex_lock(>all_ppp_mutex);
 
 	if (unit < 0) {
@@ -2772,7 +2773,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(>units_idr, unit);
 		netdev_err(ppp->dev, "PPP: couldn't register device %s (%d)\n",
@@ -2784,6 +2785,7 @@ static struct ppp *ppp_create_interface(struct net *net, int unit,
 
 	atomic_inc(_unit_count);
 	mutex_unlock(>all_ppp_mutex);
+	rtnl_unlock();
 
 	*retp = 0;
 	return ppp;
-- 
2.5.3