All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3.19 and earlier] fib_rules: Fix dump_rules() not to exit early
@ 2015-10-05 17:29 Roland Dreier
  2015-10-05 21:50 ` Jiri Slaby
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Roland Dreier @ 2015-10-05 17:29 UTC (permalink / raw)
  To: netdev, stable; +Cc: Roland Dreier

From: Roland Dreier <roland@purestorage.com>

Backports of 41fc014332d9 ("fib_rules: fix fib rule dumps across
multiple skbs") introduced a regression in "ip rule show" - it ends up
dumping the first rule over and over and never exiting, because 3.19
and earlier are missing commit 053c095a82cf ("netlink: make
nlmsg_end() and genlmsg_end() void"), so fib_nl_fill_rule() ends up
returning skb->len (i.e. > 0) in the success case.

Fix this by checking the return code for < 0 instead of != 0.

Signed-off-by: Roland Dreier <roland@purestorage.com>
---
Hi, this is needed for all stable trees earlier than 4.0 that have
picked up 41fc014332d9; so far looks like at least 3.10.y and 3.14.y
have made such releases.

 net/core/fib_rules.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 627e517077e4..84340a2605ed 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -606,7 +606,7 @@ static int dump_rules(struct sk_buff *skb, struct netlink_callback *cb,
 		err = fib_nl_fill_rule(skb, rule, NETLINK_CB(cb->skb).portid,
 				       cb->nlh->nlmsg_seq, RTM_NEWRULE,
 				       NLM_F_MULTI, ops);
-		if (err)
+		if (err < 0)
 			break;
 skip:
 		idx++;
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 3.19 and earlier] fib_rules: Fix dump_rules() not to exit early
  2015-10-05 17:29 [PATCH 3.19 and earlier] fib_rules: Fix dump_rules() not to exit early Roland Dreier
@ 2015-10-05 21:50 ` Jiri Slaby
  2015-10-08 12:50 ` Ben Hutchings
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Jiri Slaby @ 2015-10-05 21:50 UTC (permalink / raw)
  To: Roland Dreier, netdev, stable; +Cc: Roland Dreier

On 10/05/2015, 07:29 PM, Roland Dreier wrote:
> From: Roland Dreier <roland@purestorage.com>
> 
> Backports of 41fc014332d9 ("fib_rules: fix fib rule dumps across
> multiple skbs") introduced a regression in "ip rule show" - it ends up
> dumping the first rule over and over and never exiting, because 3.19
> and earlier are missing commit 053c095a82cf ("netlink: make
> nlmsg_end() and genlmsg_end() void"), so fib_nl_fill_rule() ends up
> returning skb->len (i.e. > 0) in the success case.
> 
> Fix this by checking the return code for < 0 instead of != 0.
> 
> Signed-off-by: Roland Dreier <roland@purestorage.com>
> ---
> Hi, this is needed for all stable trees earlier than 4.0 that have
> picked up 41fc014332d9; so far looks like at least 3.10.y and 3.14.y
> have made such releases.
> 
>  net/core/fib_rules.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
> index 627e517077e4..84340a2605ed 100644
> --- a/net/core/fib_rules.c
> +++ b/net/core/fib_rules.c
> @@ -606,7 +606,7 @@ static int dump_rules(struct sk_buff *skb, struct netlink_callback *cb,
>  		err = fib_nl_fill_rule(skb, rule, NETLINK_CB(cb->skb).portid,
>  				       cb->nlh->nlmsg_seq, RTM_NEWRULE,
>  				       NLM_F_MULTI, ops);
> -		if (err)
> +		if (err < 0)

I integrated the fix into the backport of 41fc014332d9 in 3.12 and made
a note in there. Thanks!

-- 
js
suse labs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3.19 and earlier] fib_rules: Fix dump_rules() not to exit early
  2015-10-05 17:29 [PATCH 3.19 and earlier] fib_rules: Fix dump_rules() not to exit early Roland Dreier
  2015-10-05 21:50 ` Jiri Slaby
@ 2015-10-08 12:50 ` Ben Hutchings
  2015-10-09 14:33 ` Thomas Jarosch
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Ben Hutchings @ 2015-10-08 12:50 UTC (permalink / raw)
  To: Roland Dreier, netdev, stable; +Cc: Roland Dreier

[-- Attachment #1: Type: text/plain, Size: 985 bytes --]

On Mon, 2015-10-05 at 10:29 -0700, Roland Dreier wrote:
> From: Roland Dreier <roland@purestorage.com>
> 
> Backports of 41fc014332d9 ("fib_rules: fix fib rule dumps across
> multiple skbs") introduced a regression in "ip rule show" - it ends up
> dumping the first rule over and over and never exiting, because 3.19
> and earlier are missing commit 053c095a82cf ("netlink: make
> nlmsg_end() and genlmsg_end() void"), so fib_nl_fill_rule() ends up
> returning skb->len (i.e. > 0) in the success case.
> 
> Fix this by checking the return code for < 0 instead of != 0.
> 
> Signed-off-by: Roland Dreier <roland@purestorage.com>
> ---
> Hi, this is needed for all stable trees earlier than 4.0 that have
> picked up 41fc014332d9; so far looks like at least 3.10.y and 3.14.y
> have made such releases.
[...]

Thanks, I'm folding this into the backported patch in 3.2.

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3.19 and earlier] fib_rules: Fix dump_rules() not to exit early
  2015-10-05 17:29 [PATCH 3.19 and earlier] fib_rules: Fix dump_rules() not to exit early Roland Dreier
  2015-10-05 21:50 ` Jiri Slaby
  2015-10-08 12:50 ` Ben Hutchings
@ 2015-10-09 14:33 ` Thomas Jarosch
  2015-10-18  0:12 ` Greg KH
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Thomas Jarosch @ 2015-10-09 14:33 UTC (permalink / raw)
  To: Roland Dreier; +Cc: netdev, stable

Hi Roland,

On Monday, 5. October 2015 10:29:28 Roland Dreier wrote:
> From: Roland Dreier <roland@purestorage.com>
> 
> Backports of 41fc014332d9 ("fib_rules: fix fib rule dumps across
> multiple skbs") introduced a regression in "ip rule show" - it ends up
> dumping the first rule over and over and never exiting, because 3.19
> and earlier are missing commit 053c095a82cf ("netlink: make
> nlmsg_end() and genlmsg_end() void"), so fib_nl_fill_rule() ends up
> returning skb->len (i.e. > 0) in the success case.
> 
> Fix this by checking the return code for < 0 instead of != 0.

thanks for this fix. You just saved me an afternoon of bisecting :)

I can confirm that this fixes the mentioned issue introduced in 3.14.54.
We have an automated ipsec VPN test that failed after the upgrade:
The "ip rule list" command was hanging forever.

Cheers,
Thomas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3.19 and earlier] fib_rules: Fix dump_rules() not to exit early
  2015-10-05 17:29 [PATCH 3.19 and earlier] fib_rules: Fix dump_rules() not to exit early Roland Dreier
                   ` (2 preceding siblings ...)
  2015-10-09 14:33 ` Thomas Jarosch
@ 2015-10-18  0:12 ` Greg KH
  2015-10-18  0:34 ` Patch "fib_rules: Fix dump_rules() not to exit early" has been added to the 3.14-stable tree gregkh
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2015-10-18  0:12 UTC (permalink / raw)
  To: Roland Dreier; +Cc: netdev, stable, Roland Dreier

On Mon, Oct 05, 2015 at 10:29:28AM -0700, Roland Dreier wrote:
> From: Roland Dreier <roland@purestorage.com>
> 
> Backports of 41fc014332d9 ("fib_rules: fix fib rule dumps across
> multiple skbs") introduced a regression in "ip rule show" - it ends up
> dumping the first rule over and over and never exiting, because 3.19
> and earlier are missing commit 053c095a82cf ("netlink: make
> nlmsg_end() and genlmsg_end() void"), so fib_nl_fill_rule() ends up
> returning skb->len (i.e. > 0) in the success case.
> 
> Fix this by checking the return code for < 0 instead of != 0.
> 
> Signed-off-by: Roland Dreier <roland@purestorage.com>
> ---
> Hi, this is needed for all stable trees earlier than 4.0 that have
> picked up 41fc014332d9; so far looks like at least 3.10.y and 3.14.y
> have made such releases.

Thanks for this, now applied to 3.10 and 3.14-stable trees.

greg k-h

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Patch "fib_rules: Fix dump_rules() not to exit early" has been added to the 3.14-stable tree
  2015-10-05 17:29 [PATCH 3.19 and earlier] fib_rules: Fix dump_rules() not to exit early Roland Dreier
                   ` (3 preceding siblings ...)
  2015-10-18  0:12 ` Greg KH
@ 2015-10-18  0:34 ` gregkh
  2015-10-18  0:51 ` Patch "fib_rules: Fix dump_rules() not to exit early" has been added to the 3.10-stable tree gregkh
  2015-10-19 10:24   ` Luis Henriques
  6 siblings, 0 replies; 9+ messages in thread
From: gregkh @ 2015-10-18  0:34 UTC (permalink / raw)
  To: roland, gregkh, roland; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    fib_rules: Fix dump_rules() not to exit early

to the 3.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     fib_rules-fix-dump_rules-not-to-exit-early.patch
and it can be found in the queue-3.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From roland@kernel.org  Sat Oct 17 17:11:23 2015
From: Roland Dreier <roland@kernel.org>
Date: Mon,  5 Oct 2015 10:29:28 -0700
Subject: fib_rules: Fix dump_rules() not to exit early
To: netdev@vger.kernel.org, stable@vger.kernel.org
Cc: Roland Dreier <roland@purestorage.com>
Message-ID: <1444066168-5566-1-git-send-email-roland@kernel.org>


From: Roland Dreier <roland@purestorage.com>

Backports of 41fc014332d9 ("fib_rules: fix fib rule dumps across
multiple skbs") introduced a regression in "ip rule show" - it ends up
dumping the first rule over and over and never exiting, because 3.19
and earlier are missing commit 053c095a82cf ("netlink: make
nlmsg_end() and genlmsg_end() void"), so fib_nl_fill_rule() ends up
returning skb->len (i.e. > 0) in the success case.

Fix this by checking the return code for < 0 instead of != 0.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/core/fib_rules.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -631,7 +631,7 @@ static int dump_rules(struct sk_buff *sk
 		err = fib_nl_fill_rule(skb, rule, NETLINK_CB(cb->skb).portid,
 				       cb->nlh->nlmsg_seq, RTM_NEWRULE,
 				       NLM_F_MULTI, ops);
-		if (err)
+		if (err < 0)
 			break;
 skip:
 		idx++;


Patches currently in stable-queue which might be from roland@kernel.org are

queue-3.14/fib_rules-fix-dump_rules-not-to-exit-early.patch

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Patch "fib_rules: Fix dump_rules() not to exit early" has been added to the 3.10-stable tree
  2015-10-05 17:29 [PATCH 3.19 and earlier] fib_rules: Fix dump_rules() not to exit early Roland Dreier
                   ` (4 preceding siblings ...)
  2015-10-18  0:34 ` Patch "fib_rules: Fix dump_rules() not to exit early" has been added to the 3.14-stable tree gregkh
@ 2015-10-18  0:51 ` gregkh
  2015-10-19 10:24   ` Luis Henriques
  6 siblings, 0 replies; 9+ messages in thread
From: gregkh @ 2015-10-18  0:51 UTC (permalink / raw)
  To: roland, gregkh, roland; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    fib_rules: Fix dump_rules() not to exit early

to the 3.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     fib_rules-fix-dump_rules-not-to-exit-early.patch
and it can be found in the queue-3.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From roland@kernel.org  Sat Oct 17 17:11:23 2015
From: Roland Dreier <roland@kernel.org>
Date: Mon,  5 Oct 2015 10:29:28 -0700
Subject: fib_rules: Fix dump_rules() not to exit early
To: netdev@vger.kernel.org, stable@vger.kernel.org
Cc: Roland Dreier <roland@purestorage.com>
Message-ID: <1444066168-5566-1-git-send-email-roland@kernel.org>


From: Roland Dreier <roland@purestorage.com>

Backports of 41fc014332d9 ("fib_rules: fix fib rule dumps across
multiple skbs") introduced a regression in "ip rule show" - it ends up
dumping the first rule over and over and never exiting, because 3.19
and earlier are missing commit 053c095a82cf ("netlink: make
nlmsg_end() and genlmsg_end() void"), so fib_nl_fill_rule() ends up
returning skb->len (i.e. > 0) in the success case.

Fix this by checking the return code for < 0 instead of != 0.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/core/fib_rules.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -606,7 +606,7 @@ static int dump_rules(struct sk_buff *sk
 		err = fib_nl_fill_rule(skb, rule, NETLINK_CB(cb->skb).portid,
 				       cb->nlh->nlmsg_seq, RTM_NEWRULE,
 				       NLM_F_MULTI, ops);
-		if (err)
+		if (err < 0)
 			break;
 skip:
 		idx++;


Patches currently in stable-queue which might be from roland@kernel.org are

queue-3.10/fib_rules-fix-dump_rules-not-to-exit-early.patch

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3.19 and earlier] fib_rules: Fix dump_rules() not to exit early
  2015-10-05 17:29 [PATCH 3.19 and earlier] fib_rules: Fix dump_rules() not to exit early Roland Dreier
@ 2015-10-19 10:24   ` Luis Henriques
  2015-10-08 12:50 ` Ben Hutchings
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Luis Henriques @ 2015-10-19 10:24 UTC (permalink / raw)
  To: Roland Dreier; +Cc: netdev, stable, Roland Dreier

On Mon, Oct 05, 2015 at 10:29:28AM -0700, Roland Dreier wrote:
> From: Roland Dreier <roland@purestorage.com>
> 
> Backports of 41fc014332d9 ("fib_rules: fix fib rule dumps across
> multiple skbs") introduced a regression in "ip rule show" - it ends up
> dumping the first rule over and over and never exiting, because 3.19
> and earlier are missing commit 053c095a82cf ("netlink: make
> nlmsg_end() and genlmsg_end() void"), so fib_nl_fill_rule() ends up
> returning skb->len (i.e. > 0) in the success case.
> 
> Fix this by checking the return code for < 0 instead of != 0.
> 
> Signed-off-by: Roland Dreier <roland@purestorage.com>
> ---
> Hi, this is needed for all stable trees earlier than 4.0 that have
> picked up 41fc014332d9; so far looks like at least 3.10.y and 3.14.y
> have made such releases.
>

Thanks Roland, I'm queuing this fix for the 3.16 kernel as well.

Cheers,
--
Luís


>  net/core/fib_rules.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
> index 627e517077e4..84340a2605ed 100644
> --- a/net/core/fib_rules.c
> +++ b/net/core/fib_rules.c
> @@ -606,7 +606,7 @@ static int dump_rules(struct sk_buff *skb, struct netlink_callback *cb,
>  		err = fib_nl_fill_rule(skb, rule, NETLINK_CB(cb->skb).portid,
>  				       cb->nlh->nlmsg_seq, RTM_NEWRULE,
>  				       NLM_F_MULTI, ops);
> -		if (err)
> +		if (err < 0)
>  			break;
>  skip:
>  		idx++;
> -- 
> 2.5.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3.19 and earlier] fib_rules: Fix dump_rules() not to exit early
@ 2015-10-19 10:24   ` Luis Henriques
  0 siblings, 0 replies; 9+ messages in thread
From: Luis Henriques @ 2015-10-19 10:24 UTC (permalink / raw)
  To: Roland Dreier; +Cc: netdev, stable, Roland Dreier

On Mon, Oct 05, 2015 at 10:29:28AM -0700, Roland Dreier wrote:
> From: Roland Dreier <roland@purestorage.com>
> 
> Backports of 41fc014332d9 ("fib_rules: fix fib rule dumps across
> multiple skbs") introduced a regression in "ip rule show" - it ends up
> dumping the first rule over and over and never exiting, because 3.19
> and earlier are missing commit 053c095a82cf ("netlink: make
> nlmsg_end() and genlmsg_end() void"), so fib_nl_fill_rule() ends up
> returning skb->len (i.e. > 0) in the success case.
> 
> Fix this by checking the return code for < 0 instead of != 0.
> 
> Signed-off-by: Roland Dreier <roland@purestorage.com>
> ---
> Hi, this is needed for all stable trees earlier than 4.0 that have
> picked up 41fc014332d9; so far looks like at least 3.10.y and 3.14.y
> have made such releases.
>

Thanks Roland, I'm queuing this fix for the 3.16 kernel as well.

Cheers,
--
Lu�s


>  net/core/fib_rules.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
> index 627e517077e4..84340a2605ed 100644
> --- a/net/core/fib_rules.c
> +++ b/net/core/fib_rules.c
> @@ -606,7 +606,7 @@ static int dump_rules(struct sk_buff *skb, struct netlink_callback *cb,
>  		err = fib_nl_fill_rule(skb, rule, NETLINK_CB(cb->skb).portid,
>  				       cb->nlh->nlmsg_seq, RTM_NEWRULE,
>  				       NLM_F_MULTI, ops);
> -		if (err)
> +		if (err < 0)
>  			break;
>  skip:
>  		idx++;
> -- 
> 2.5.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-10-19 10:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-05 17:29 [PATCH 3.19 and earlier] fib_rules: Fix dump_rules() not to exit early Roland Dreier
2015-10-05 21:50 ` Jiri Slaby
2015-10-08 12:50 ` Ben Hutchings
2015-10-09 14:33 ` Thomas Jarosch
2015-10-18  0:12 ` Greg KH
2015-10-18  0:34 ` Patch "fib_rules: Fix dump_rules() not to exit early" has been added to the 3.14-stable tree gregkh
2015-10-18  0:51 ` Patch "fib_rules: Fix dump_rules() not to exit early" has been added to the 3.10-stable tree gregkh
2015-10-19 10:24 ` [PATCH 3.19 and earlier] fib_rules: Fix dump_rules() not to exit early Luis Henriques
2015-10-19 10:24   ` Luis Henriques

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.