From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_NEOMUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DCB6C04E87 for ; Sun, 19 May 2019 20:28:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A948206B6 for ; Sun, 19 May 2019 20:28:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730131AbfESU2E (ORCPT ); Sun, 19 May 2019 16:28:04 -0400 Received: from Chamillionaire.breakpoint.cc ([146.0.238.67]:53956 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730116AbfESU2D (ORCPT ); Sun, 19 May 2019 16:28:03 -0400 Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.89) (envelope-from ) id 1hSSPS-0004g9-41; Sun, 19 May 2019 22:27:54 +0200 Date: Sun, 19 May 2019 22:27:53 +0200 From: Florian Westphal To: Nathan Chancellor Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Thomas Haller , Hangbin Liu , "David S. Miller" , 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 Message-ID: <20190519202753.p5hsfe2uqmgsfbcq@breakpoint.cc> References: <20190515090616.669619870@linuxfoundation.org> <20190515090628.066392616@linuxfoundation.org> <20190519154348.GA113991@archlinux-epyc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190519154348.GA113991@archlinux-epyc> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Nathan Chancellor wrote: > On Wed, May 15, 2019 at 12:56:16PM +0200, Greg Kroah-Hartman wrote: > > From: Hangbin Liu > > > > [ Upstream commit e9919a24d3022f72bcadc407e73a6ef17093a849 ] [..] > > Fixes: 153380ec4b9 ("fib_rules: Added NLM_F_EXCL support to fib_nl_newrule") > > Reported-by: Thomas Haller > > Signed-off-by: Hangbin Liu > > Signed-off-by: David S. Miller > > Signed-off-by: Greg Kroah-Hartman > > --- > > 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.