lkml.org 
[lkml]   [2019]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4.9 41/51] fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied
Nathan Chancellor <natechancellor@gmail.com> wrote:
> On Wed, May 15, 2019 at 12:56:16PM +0200, Greg Kroah-Hartman wrote:
> > From: Hangbin Liu <liuhangbin@gmail.com>
> >
> > [ Upstream commit e9919a24d3022f72bcadc407e73a6ef17093a849 ]

[..]

> > Fixes: 153380ec4b9 ("fib_rules: Added NLM_F_EXCL support to fib_nl_newrule")
> > Reported-by: Thomas Haller <thaller@redhat.com>
> > Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> > Signed-off-by: David S. Miller <davem@davemloft.net>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> > net/core/fib_rules.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > --- a/net/core/fib_rules.c
> > +++ b/net/core/fib_rules.c
> > @@ -429,9 +429,9 @@ int fib_nl_newrule(struct sk_buff *skb,
> > if (rule->l3mdev && rule->table)
> > goto errout_free;
> >
> > - if ((nlh->nlmsg_flags & NLM_F_EXCL) &&
> > - rule_exists(ops, frh, tb, rule)) {
> > - err = -EEXIST;
> > + if (rule_exists(ops, frh, tb, rule)) {
> > + if (nlh->nlmsg_flags & NLM_F_EXCL)
> > + err = -EEXIST;
> 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.

Not surprising, the patch can't be applied to 4.9 as-is.

In 4.9, code looks like this:

err = -EINVAL;
/* irrelevant */
if (rule_exists(ops, frh, tb, rule)) {
if (nlh->nlmsg_flags & NLM_F_EXCL)
err = -EEXIST;
goto errout_free;
}

So, if rule_exists() is true, we return -EINVAL to caller
instead of 0, unlike upstream.

I don't think this commit is stable material.

\
 
 \ /
  Last update: 2019-05-19 22:28    [W:0.047 / U:22.988 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site