Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5457571imm; Tue, 16 Oct 2018 10:30:59 -0700 (PDT) X-Google-Smtp-Source: ACcGV61Sdkg2fLeE5GarlD1RNhKVRtgk6vAClOryYLI8z9e1Iv9xH7CY/LYTLcYneE/l+cd+f+Gk X-Received: by 2002:a63:4107:: with SMTP id o7-v6mr21307554pga.256.1539711059453; Tue, 16 Oct 2018 10:30:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539711059; cv=none; d=google.com; s=arc-20160816; b=vqA6Qhps1HBdmyiD37eRqBdOidyD5srOyYQHUWMnwa4j4yxMQOt4m5HcsHoYF7GUWE MCSsaK9dqoFOmDLkWSThdqq3R6GK7WfaDwzGzo4IzBE5Mq9HrJaoGmyjFuNwXB3xfYOy J5ZBzBqtVtsMz8jc5FN6XSW8yw+hctwSSVaeWsZ+/oadv5l1MrpGOtu/7bdHBkG1WNEp 8M/6s2qRY+i1AUSSTHwMJcIpyOkixNc1U1dHZeEh0wxNykabgrdJnvtJ65tN1DrxgwjK F4ueTrwC+ZTn7BbVXrE6M6pHJiliL7e5YzPzMJs3GEA6cKQWv9slbOzfzCpYmWZfjkox /aXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MAgZVuOs1LMwfOjs6Lp5Q0YQtB8+iqN9iTgdpPfgSHM=; b=ja2NGrSMyTfEozg8t2LXvXwwP9pvucYQ7EcvnfzxxZWg+JqrZcUlojV0KJsPChaBJI YXtMacLAFbWChelfEgEM9wkNPLFOLYDcBMTOtnwvx8/jTaoQMN+7P3s1xvq1hZbm/XNr BbqjdIu76NspDNQDcZtWdLju+rEbMTBTFPGFTOFiLQufxdS00pOjFYJmlqXbTbxI0oTd 7JYQ9CaMIj54T4E963ld6UL4yPXv/tEA9HmcSof7C91FHnrGZDmmoEhCJI4HIlbgYFb8 G/MLr1VaUg7TcvwNwssIy3edmPI1b6th08qweUnCpkgV9ZFhYLjYGPIdLTQ+nNim8X9r aR6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=J516Z25Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f185-v6si14250331pgc.339.2018.10.16.10.30.43; Tue, 16 Oct 2018 10:30:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=J516Z25Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731487AbeJQBPL (ORCPT + 99 others); Tue, 16 Oct 2018 21:15:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:33734 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730396AbeJQBPK (ORCPT ); Tue, 16 Oct 2018 21:15:10 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (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 334BF2098A; Tue, 16 Oct 2018 17:23:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539710624; bh=ZHQ+WhW4KUztcIywXdqGzdneGhnuYpKOGmVQ7GXsuaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J516Z25YzmG3XdQZX0Vvcemp3KguCSCKngYBuheq9O0Qxs4nzZjbkcAx3AnrOnvMz u25YRRu5BnAwnAnLYU+skGMQrbtZFETm0kQbRsZCLpxduwtiori0gpz1AMsgKhGte7 JpmQAhE0f6yENdhs8LVUSbKVZTULImz2jViHP2r8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeff Barnhill <0xeffeff@gmail.com>, "David S. Miller" Subject: [PATCH 4.9 31/71] net/ipv6: Display all addresses in output of /proc/net/if_inet6 Date: Tue, 16 Oct 2018 19:09:28 +0200 Message-Id: <20181016170540.945727080@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181016170539.315587743@linuxfoundation.org> References: <20181016170539.315587743@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jeff Barnhill <0xeffeff@gmail.com> [ Upstream commit 86f9bd1ff61c413a2a251fa736463295e4e24733 ] The backend handling for /proc/net/if_inet6 in addrconf.c doesn't properly handle starting/stopping the iteration. The problem is that at some point during the iteration, an overflow is detected and the process is subsequently stopped. The item being shown via seq_printf() when the overflow occurs is not actually shown, though. When start() is subsequently called to resume iterating, it returns the next item, and thus the item that was being processed when the overflow occurred never gets printed. Alter the meaning of the private data member "offset". Currently, when it is not 0 (which only happens at the very beginning), "offset" represents the next hlist item to be printed. After this change, "offset" always represents the current item. This is also consistent with the private data member "bucket", which represents the current bucket, and also the use of "pos" as defined in seq_file.txt: The pos passed to start() will always be either zero, or the most recent pos used in the previous session. Signed-off-by: Jeff Barnhill <0xeffeff@gmail.com> Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/addrconf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -4068,7 +4068,6 @@ static struct inet6_ifaddr *if6_get_firs p++; continue; } - state->offset++; return ifa; } @@ -4092,13 +4091,12 @@ static struct inet6_ifaddr *if6_get_next return ifa; } + state->offset = 0; while (++state->bucket < IN6_ADDR_HSIZE) { - state->offset = 0; hlist_for_each_entry_rcu_bh(ifa, &inet6_addr_lst[state->bucket], addr_lst) { if (!net_eq(dev_net(ifa->idev->dev), net)) continue; - state->offset++; return ifa; } }