Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2233362imm; Thu, 18 Oct 2018 11:07:05 -0700 (PDT) X-Google-Smtp-Source: ACcGV63Dy/JX/ZzNZp54SkGZfA8wSMTwDtZ9IrF2JrTu3+Ib4sQrwq39fLkPKw3WFfSvPdETghvq X-Received: by 2002:a63:9409:: with SMTP id m9-v6mr28491882pge.93.1539886025668; Thu, 18 Oct 2018 11:07:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539886025; cv=none; d=google.com; s=arc-20160816; b=h3aTzlplO4NoKIbFQS0JqDuPo9QRbWS3Pl5oFWVMbvhaRSpNHi2DJInTbMK7gWjpr0 LZGyHfRTsm5EfaFunww+S+fqjg+KmApnhfO1fFNftVDOaa8bvL810UgBg+/+o5o3qwVc GDI6duO2eOkRpI2FTT2tjCpQDagW/aj8C88vNGKK3mjljDQcNCbkMcqtfwg59Mqd4MoX kkKByx8G7kQkMzu8YuPB3kUGa6aAH+vcH9o654R1wlhmrOTrcs4yJ7Am4BzRAgp39qql apeLdpH2t7f6jUPtk027JOar1qXs243/GsgKisLaxJlBIBmyHTAWY7zGEbcEPPWy/ovB yIBg== 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=Izw/QXnbc43lPL3V8l4UrJTdMzq3Op0XODfisFiuQZ8=; b=z7e2cgDJ8i/56oDXDvap5G/LGUVh+Uc8pVsMzUQdFKULELwQJ4HwGsxV/jWVa/ugtw S/GKiscET3XvorU+ipCDFmUlNCglc66HwvJO8qicBOm3JT2JOzaamDOpRhtSDOf6vU9I vsR94NWlYCDKPWH+zjYisuHhAb4He05a0eYD89jThqsuyIYr6mwZVopsZCjSO2X3igXg FnxKHGpGpkT2or7O+Pt9PqvYQG/fHWMvY/KdYnNktutaHOgDauGF1OGyS2MkqQP+VURl lXpioVSTdKG8UTY94xG83XbNsKm6buRWwHnIYP6CIRSi+oW/QDYKAwk6a/fQXe4OBuWD zgsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kjb8kaR3; 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 30-v6si22294867pla.282.2018.10.18.11.06.49; Thu, 18 Oct 2018 11:07:05 -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=kjb8kaR3; 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 S1730327AbeJSCHq (ORCPT + 99 others); Thu, 18 Oct 2018 22:07:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:56534 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726599AbeJSCHp (ORCPT ); Thu, 18 Oct 2018 22:07:45 -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 BD9782145D; Thu, 18 Oct 2018 18:05:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539885938; bh=IGuAMwOeYc98osP9nk//l6Ww9IEMo7+tl3FbUFwMoxY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kjb8kaR3gTpiXInu/QKekZpDDKsCTgpB9tEBlNExYDbGZ/1YxdNBPj/39GgoL+1nA SoqUdQpr3MEh3FYNtlsCGgOO9vqVz7FWQ/xxf6UsKmKNwuU3RwfgldJRAtpobMyWsQ txvOMMPn7IEKV611ytIaYtOSIwnw2brFTYEr6sxY= 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.4 23/48] net/ipv6: Display all addresses in output of /proc/net/if_inet6 Date: Thu, 18 Oct 2018 19:54:58 +0200 Message-Id: <20181018175429.251031680@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181018175427.133690306@linuxfoundation.org> References: <20181018175427.133690306@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.4-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 @@ -3786,7 +3786,6 @@ static struct inet6_ifaddr *if6_get_firs p++; continue; } - state->offset++; return ifa; } @@ -3810,13 +3809,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; } }