Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3764985pxk; Tue, 29 Sep 2020 05:51:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpBoHYrcxEljJYOdvMr1+MBFLZLwCkU7UZpz3yx0OIkoql0L72QkSmcGDYjA6j4kiWAk4D X-Received: by 2002:a17:906:cb92:: with SMTP id mf18mr3832201ejb.485.1601383884035; Tue, 29 Sep 2020 05:51:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601383884; cv=none; d=google.com; s=arc-20160816; b=BuatXrkCq/eJYURP4+FTeNz19zZnX0Ul7LyJWZ68JwrEz/glcN1tlvnMzSJh3ju4MU +/i2hdDK9Ei6Y9+x9BIEXw6IaWjXmrqawS18dn6mz/rHCM1qaPPG8Z5Kss/rlzfXuJ8Q fcMVJ+m9bEWU7XjwrqfLLGtbH4iA5jDK3WfIx58/KtAuR+nw/g5XmtytgkhjQNqq2TDx yVMgqj4E1Pf5EtTKwjaIYIUaIiyCrgPfY9m9dYQgbbYcLzI75ZRcZX1o1zUCswsEXjgg NfKAtYSlXlchmIu74KuDd68AQoyZDJEJbocinwMdq41yf92bxJP9o7L/+7UDOL4sXxhi wJmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PmPzMpTE8Ja+zwTHddG7Ex33T28z4ofAxhwC3NP4dm8=; b=n78C4/ziHcNoK1Ichqi9e6gq6veSjU+PmSc4AJpGkUnYWSS0QBdoYQn9VM8x1/Up05 73cwW3ZbnoRTXgTT5jD5bQlj6Z1enNUgm8GSQqZ+L0N/Euuq6QP0in9QND1/FZDqh7bc CmZvN4qZtfQ2OCXfQpFRP3/TFXG1z4tsUGM1rbYpAOGu4OG7C3j0r99WVuPTKF4NUD/2 m9tcyYneQqztV2ElAF4S8Qa7BYnzgJWPK21YP0vTzn5+9J1yoddnV0b5vwwnUftCUzXc tbVHW/EEveCurhqocbhAcGy00mcS2mSxyqIbRf3sY6qJqYpmGM2hhKT/MFHrqzVgGcoP hACg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yY1dviCj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs7si2674576ejb.410.2020.09.29.05.51.01; Tue, 29 Sep 2020 05:51:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yY1dviCj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728852AbgI2MsD (ORCPT + 99 others); Tue, 29 Sep 2020 08:48:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:39162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728383AbgI2LD1 (ORCPT ); Tue, 29 Sep 2020 07:03:27 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 A8CB021924; Tue, 29 Sep 2020 11:03:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601377407; bh=v77OFaG2P2gwceHgFCMKAJVT9dd+f6dWbjMdSsqoFEU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yY1dviCjv76deMD6xI6KOAN1sXEz5KyJ1llwuX4wV/DV03Oi9vvBBAkmcEsbB4ZIA BpxUy2uYXeAbu2NR3eGLz6kRSWw7BQ/LXz0UGizE6BYjNpbyNdSek5KerAfw2lHADD 8Iib2JJJtwErCU0Ruwk2JEv5RrPljU+RrBW/cFSs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vasily Averin , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 24/85] rt_cpu_seq_next should increase position index Date: Tue, 29 Sep 2020 12:59:51 +0200 Message-Id: <20200929105929.436621788@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105928.198942536@linuxfoundation.org> References: <20200929105928.198942536@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vasily Averin [ Upstream commit a3ea86739f1bc7e121d921842f0f4a8ab1af94d9 ] if seq_file .next fuction does not change position index, read after some lseek can generate unexpected output. https://bugzilla.kernel.org/show_bug.cgi?id=206283 Signed-off-by: Vasily Averin Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv4/route.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 542f6e0f438f1..ea1c319100a5d 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -271,6 +271,7 @@ static void *rt_cpu_seq_next(struct seq_file *seq, void *v, loff_t *pos) *pos = cpu+1; return &per_cpu(rt_cache_stat, cpu); } + (*pos)++; return NULL; } -- 2.25.1