Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5435887imm; Tue, 16 Oct 2018 10:11:25 -0700 (PDT) X-Google-Smtp-Source: ACcGV63L/6nxIII9UYq03JRcy0nApzvbwLOmu7OR41DzCLt4/NQRjTPxGt6p5ShenVAyX1oSkfWe X-Received: by 2002:a63:1806:: with SMTP id y6-v6mr21348873pgl.187.1539709885684; Tue, 16 Oct 2018 10:11:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539709885; cv=none; d=google.com; s=arc-20160816; b=gpZ0EY/ph7gNni2e30ljg7Ujidk/NvF42K72utHcYBJqVgGqhyC+9oMMoHNahdtCdf i838hTu++8DKadgYgAsmrrqggwhYcfW+Uch/PKGHIO6FpaylNfWfmSJv47aM9n7hadyj O80ErqWD8cB6AJaXpEfkxzBxRBXGAqLQ/llaJcc6rU3V+FND/kQJEbCShcDyz5T2LXeQ Y5ewLmdVQIclzgNRIgE5UIg6RKmgsoyMG91IOTvjqfUfWsyfOYvOdGxZ/0cenUzim14S ef8//Xib5UdHGonLV115Qtoc7C4IbWgrfpMDL4W9zVxj2QYtGjFNVs5XsN8jx96qxxGk cRVw== 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=98cKREQfgog6YJtKNw5YCsuCWCQZd5JU68yj4s2brxU=; b=WAeSuJ14PYhPOVkPb+47+m58wcTR0ZHA3ZaWpsJ5E6kLa+b591eYxR3G4SBOkKLTwC 4FT4yOtQTAE9ysP6T4SDeVTnDBQ3hS8mr9sHaLrMTlXBMyKom3DzjkJ3ow/CWEA4qaDB ZhPxk2i+qkcNFcVlaQpWRiulBCSwaex13oZulApwz5Zo4oldC6cP0rgeb2UdtfUz1haM vVrQNwHaIeshiCKw+KyRw7Qdzlp5ir31r3H2WkORaPt2AR+84TWOO9h6F2dzPVWMaHgj oV+ZvU67QHO40bhfXFsfaZHzG7tTtx9qm+be0sVKL8EdouCtsYCsuq1+ntp+KxF1X9By NNkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cUfxgA9k; 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 x21-v6si11923899pll.221.2018.10.16.10.11.09; Tue, 16 Oct 2018 10:11:25 -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=cUfxgA9k; 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 S1727602AbeJQBBv (ORCPT + 99 others); Tue, 16 Oct 2018 21:01:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:41938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727132AbeJQBBv (ORCPT ); Tue, 16 Oct 2018 21:01:51 -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 98A0020866; Tue, 16 Oct 2018 17:10:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539709829; bh=nKoNpDmx8AhYbwunu7p9nbRAjvQMAzIoap93vwRQcOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cUfxgA9k5CW1p9FaiqtYRbymi+QDNaG+vnVNmxehWdVDd9ZDKa1rBrNS30gKcMojb gyFM0+8FZTHGlxZ+LOLhUYrITtYb7/f8I2qpM1huiQ1D3rXlQBP6xjb1MY9WU7Guop zZL34W9uDf8g4AgPTdPcJ2pSm7B4TsepYVNuT3sk= 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.18 011/135] net/ipv6: Display all addresses in output of /proc/net/if_inet6 Date: Tue, 16 Oct 2018 19:04:01 +0200 Message-Id: <20181016170516.196231665@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181016170515.447235311@linuxfoundation.org> References: <20181016170515.447235311@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.18-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 @@ -4203,7 +4203,6 @@ static struct inet6_ifaddr *if6_get_firs p++; continue; } - state->offset++; return ifa; } @@ -4227,13 +4226,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(ifa, &inet6_addr_lst[state->bucket], addr_lst) { if (!net_eq(dev_net(ifa->idev->dev), net)) continue; - state->offset++; return ifa; } }