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=-5.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT 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 66066C46470 for ; Mon, 20 May 2019 02:00:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B6812082E for ; Mon, 20 May 2019 02:00:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eaLcUgnX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727397AbfETCA2 (ORCPT ); Sun, 19 May 2019 22:00:28 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:40011 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726901AbfETCA2 (ORCPT ); Sun, 19 May 2019 22:00:28 -0400 Received: by mail-pl1-f193.google.com with SMTP id g69so5935046plb.7; Sun, 19 May 2019 19:00:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=szNHxG8meqm9etTBVqy2eCrpsCzhCZREkY37myKt80c=; b=eaLcUgnXbgIvmnq47LUhcV9OwlPzBl3XBB+DlelTQLrzU9J2HUNlEDtEYAIxcsHK2C 3PuEP0Pz60lQ9TT38cIkYupC9iozwP5FjXbMSoEEYRi+APurkuKHg3N3QTM4vMHRUWeu Htjtc0Ez7Ncbn+8WE5qEw0DKciLm9hLyZnFIZMLSXgu+C+CcaQ9TtOMFGm/VJHXqwAEe ivXCo1m6EX59TMn24QPWiD+eJ43ipiLGNHhURZdcU4QOtucwQQavJoS13QEGWSe33RFo nhBwchrGgn0Afs3sTsgiJ+G6ObQYIEFFYM2HuzUBq7iMxueKgylzIOapgeyQg38xNbOt 3Snw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=szNHxG8meqm9etTBVqy2eCrpsCzhCZREkY37myKt80c=; b=eGyXG8bU6b6N3AVlN6JKl6zZ9VLUPVz9OMKg1v2dfqAjuRQ0rIVLtjdqoAj3YYupwo ap0VyTHa+i9Yjh+0OAVBBS+2q2ZKYFk7vgodwOYrYJ6Q+H2XMuVpHWu1A5FcVF0/8O5E Z/ZKS/agW/W9a86FBImv7G84LdMnmDQ0DS8Mao9PA/+cdWTkd+eQ+2CzQldMzavgxrlj 444pRDKLBJvQonNuVLz/tmT41j7CunPcWiHSYs20TmuXyfFNjqrwMMFfnDBnBPhZ4hat /mqO4zHWaNcwmNE/KwSWmVyAGVq/7cUs/bF7ft5mSwA3SCqXHHS7fJndvT10/ohhmM/h Vz4w== X-Gm-Message-State: APjAAAVGNKFG6QlRaC3SJj+JKr/sLs6qePUZev9Wd4s9RFd8ole+mqJH 3xqwkh6TnwPVrdvEa+DKTDg= X-Google-Smtp-Source: APXvYqybcv39OBAsitwlWlgiNXxZ0xtqorujhjy1k3bkomTh4rbMJ73GBX1J7FSkwaBG4LFU5OJrIQ== X-Received: by 2002:a17:902:e9:: with SMTP id a96mr46448758pla.37.1558317627612; Sun, 19 May 2019 19:00:27 -0700 (PDT) Received: from dhcp-12-139.nay.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id r18sm36509937pfg.141.2019.05.19.19.00.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 19 May 2019 19:00:26 -0700 (PDT) Date: Mon, 20 May 2019 10:00:16 +0800 From: Hangbin Liu To: Florian Westphal Cc: Nathan Chancellor , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Thomas Haller , David Ahern , "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: <20190520020016.GU18865@dhcp-12-139.nay.redhat.com> References: <20190515090616.669619870@linuxfoundation.org> <20190515090628.066392616@linuxfoundation.org> <20190519154348.GA113991@archlinux-epyc> <20190519202753.p5hsfe2uqmgsfbcq@breakpoint.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190519202753.p5hsfe2uqmgsfbcq@breakpoint.cc> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 19, 2019 at 10:27:53PM +0200, Florian Westphal wrote: > 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. Thanks Florian for helping check it. So we need either revert this patch, or at least backport adeb45cbb505 ("fib_rules: fix error return code") and f9d4b0c1e969 ("fib_rules: move common handling of newrule delrule msgs into fib_nl2rule"). For me, I agree to revert this patch from stable tree as it's a small fix. The issue has been there for a long time and I didn't see much complain from customer. Thanks Hangbin