netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: David Ahern <dsahern@gmail.com>
Cc: Nathan Chancellor <natechancellor@gmail.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Thomas Haller <thaller@redhat.com>,
	Hangbin Liu <liuhangbin@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: [PATCH 4.9 41/51] fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied
Date: Mon, 20 May 2019 11:11:31 +0200	[thread overview]
Message-ID: <20190520091131.GA1593@kroah.com> (raw)
In-Reply-To: <20190520090429.GA25812@kroah.com>

On Mon, May 20, 2019 at 11:04:29AM +0200, Greg Kroah-Hartman wrote:
> On Sun, May 19, 2019 at 06:29:19PM -0600, David Ahern wrote:
> > On 5/19/19 9:43 AM, Nathan Chancellor wrote:
> > > Hi all,
> > > 
> > > This commit is causing issues on Android devices when Wi-Fi and mobile
> > > data are both enabled. The device will do a soft reboot consistently.
> > > So far, I've had reports on the Pixel 3 XL, OnePlus 6, Pocophone, and
> > > Note 9 and I can reproduce on my OnePlus 6.
> > > 
> > > Sorry for taking so long to report this, I just figured out how to
> > > reproduce it today and I didn't want to report it without that.
> > > 
> > > Attached is a full dmesg and the relevant snippet from Android's logcat.
> > > 
> > > Let me know what I can do to help debug,
> > > Nathan
> > > 
> > 
> > It's a backport problem. err needs to be reset to 0 before the goto.
> 
> Ah, I see it, let me go queue up a fix for this.

Here's the fix I'm queueing up now:


From b42f0ebbe4431ff7ce99c916555418f4a4c2be67 Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Mon, 20 May 2019 11:07:29 +0200
Subject: [PATCH] fib_rules: fix error in backport of e9919a24d302 ("fib_rules:
 return 0...")

When commit e9919a24d302 ("fib_rules: return 0 directly if an exactly
same rule exists when NLM_F_EXCL not supplied") was backported to 4.9.y,
it changed the logic a bit as err should have been reset before exiting
the test, like it happens in the original logic.

If this is not set, errors happen :(

Reported-by: Nathan Chancellor <natechancellor@gmail.com>
Reported-by: David Ahern <dsahern@gmail.com>
Reported-by: Florian Westphal <fw@strlen.de>
Cc: Hangbin Liu <liuhangbin@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/core/fib_rules.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index bb26457e8c21..c03dd2104d33 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -430,6 +430,7 @@ int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh)
 		goto errout_free;
 
 	if (rule_exists(ops, frh, tb, rule)) {
+		err = 0;
 		if (nlh->nlmsg_flags & NLM_F_EXCL)
 			err = -EEXIST;
 		goto errout_free;
-- 
2.21.0


      reply	other threads:[~2019-05-20  9:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190515090616.669619870@linuxfoundation.org>
2019-05-15 10:56 ` [PATCH 4.9 47/51] bonding: fix arp_validate toggling in active-backup mode Greg Kroah-Hartman
     [not found] ` <20190515090628.066392616@linuxfoundation.org>
2019-05-19 15:43   ` [PATCH 4.9 41/51] fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied Nathan Chancellor
2019-05-19 20:27     ` Florian Westphal
2019-05-20  2:00       ` Hangbin Liu
2019-05-20  0:11     ` Sasha Levin
2019-05-20  0:29     ` David Ahern
2019-05-20  9:04       ` Greg Kroah-Hartman
2019-05-20  9:11         ` Greg Kroah-Hartman [this message]

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=20190520091131.GA1593@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=natechancellor@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=thaller@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).