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.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 190DCC17441 for ; Mon, 11 Nov 2019 18:36:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB3682184C for ; Mon, 11 Nov 2019 18:36:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497374; bh=4WJhdgNgB/WxPq4VgTBrlWHTLCa7rOxekKv6IQLcclY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ByTyOh5JrnhsJCy8SaY4yxH7LpHz6DVB0vZQm1KJhML4dw0efWC9Bmjlu7ErkGD8F T5RIxBqglaJARwweZWEh6zJKwk5siY+UXCITiUW5VrwXO48FzOk2HCgBM9MP3qby4S CssidJkMTDm5POTq8ckOkmnYztWKFLLH9/m3yDAA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728678AbfKKSgN (ORCPT ); Mon, 11 Nov 2019 13:36:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:54302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728670AbfKKSgJ (ORCPT ); Mon, 11 Nov 2019 13:36:09 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1CD9D2184C; Mon, 11 Nov 2019 18:36:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497368; bh=4WJhdgNgB/WxPq4VgTBrlWHTLCa7rOxekKv6IQLcclY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rTelq3DBQorQoRYPb/sGnflKNW0yj3HexyNHXG+pefKJcBMslv7XkXELeJC41heeP OPo/vrANbVHqsyx7pwrz5Vtoyrj6m21pLLN5hu1VezJZaGS+NG/ZjrnjOfhOvz15I9 +RL853PTP3V5SaJHsksv7rQstAu2EW/MyI0zpPMQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hendrik Donner , David Ahern , "David S. Miller" Subject: [PATCH 4.14 003/105] ipv4: Fix table id reference in fib_sync_down_addr Date: Mon, 11 Nov 2019 19:27:33 +0100 Message-Id: <20191111181423.196686464@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181421.390326245@linuxfoundation.org> References: <20191111181421.390326245@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Ahern [ Upstream commit e0a312629fefa943534fc46f7bfbe6de3fdaf463 ] Hendrik reported routes in the main table using source address are not removed when the address is removed. The problem is that fib_sync_down_addr does not account for devices in the default VRF which are associated with the main table. Fix by updating the table id reference. Fixes: 5a56a0b3a45d ("net: Don't delete routes in different VRFs") Reported-by: Hendrik Donner Signed-off-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/fib_semantics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -1471,8 +1471,8 @@ int fib_sync_down_addr(struct net_device int ret = 0; unsigned int hash = fib_laddr_hashfn(local); struct hlist_head *head = &fib_info_laddrhash[hash]; + int tb_id = l3mdev_fib_table(dev) ? : RT_TABLE_MAIN; struct net *net = dev_net(dev); - int tb_id = l3mdev_fib_table(dev); struct fib_info *fi; if (!fib_info_laddrhash || local == 0)