Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934414AbcLIQbW (ORCPT ); Fri, 9 Dec 2016 11:31:22 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:55652 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933830AbcLIQVS (ORCPT ); Fri, 9 Dec 2016 11:21:18 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Shengju , David Ahern , "David S. Miller" Subject: [PATCH 4.8 10/45] rtnl: fix the loop index update error in rtnl_dump_ifinfo() Date: Fri, 9 Dec 2016 17:20:39 +0100 Message-Id: <20161209161755.337006867@linuxfoundation.org> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161209161754.912203877@linuxfoundation.org> References: <20161209161754.912203877@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1103 Lines: 33 4.8-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhang Shengju [ Upstream commit 3f0ae05d6fea0ed5b19efdbc9c9f8e02685a3af3 ] If the link is filtered out, loop index should also be updated. If not, loop index will not be correct. Fixes: dc599f76c22b0 ("net: Add support for filtering link dump by master device and kind") Signed-off-by: Zhang Shengju Acked-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/rtnetlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -1578,7 +1578,7 @@ static int rtnl_dump_ifinfo(struct sk_bu head = &net->dev_index_head[h]; hlist_for_each_entry(dev, head, index_hlist) { if (link_dump_filtered(dev, master_idx, kind_ops)) - continue; + goto cont; if (idx < s_idx) goto cont; err = rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK,